summaryrefslogtreecommitdiff
path: root/lib/libalpm/hook.c
Commit message (Collapse)AuthorAge
* Cast events to void* before passing to callbackAllan McRae2016-01-15
| | | | | | | | Silence warnings from clang about typecasting alignment. Reported-by: Rikard Falkeborn Original-patch-by: Olivier Brunel Signed-off-by: Allan McRae <allan@archlinux.org>
* Update copyright years for 2016Allan McRae2016-01-04
| | | | | | make update-copyright OLD=2015 NEW=2016 Signed-off-by: Allan McRae <allan@archlinux.org>
* alpm: Abort ASAP on failure in pre-transaction hooksOlivier Brunel2015-12-15
| | | | | | | | | | | | | | | There is no need to run any/remaining pre-transaction hooks as soon as a failure has occured, which will lead to aborting the transaction. So if an error occured during the first phase (reading directories/parsing files), or as soon as a hook flagged abort_on_fail does fail, we stop processing them and return. (For post-transaction hooks, all hooks are run regardless since there's no aborting.) Signed-off-by: Olivier Brunel <jjk@jjacky.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* alpm-hooks: add Description fieldAllan McRae2015-12-15
| | | | | | | | | The "Description" field allows a hook to provide a some text for frontends to use in describing what the hook is doing. For example: Description = updating info page directory Signed-off-by: Allan McRae <allan@archlinux.org>
* Show progress processing hooksAllan McRae2015-12-15
| | | | | | | Introduces the ALPM_EVENT_HOOK_RUN_{START,DONE} events that are triggered at the start and end of running an individual hook. Signed-off-by: Allan McRae <allan@archlinux.org>
* Add events ALPM_EVENT_HOOK_{START,DONE}Olivier Brunel2015-12-15
| | | | | | | Add events to let frontends know when hooks are being processed (and when it's done), as that might be useful to update the UI. Signed-off-by: Olivier Brunel <jjk@jjacky.com>
* Collect all triggered hooks before running themAllan McRae2015-12-15
| | | | | | | | Having a first pass that checks which hooks are triggered followed by a second pass of the triggered hooks allows us to only provide output when a hook is actually triggered. Signed-off-by: Allan McRae <allan@archlinux.org>
* hooks: pass matched targets to hooksAndrew Gregory2015-11-28
| | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* allow specifying input to scriptletsAndrew Gregory2015-11-28
| | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* allow arguments in hook Exec fieldsAndrew Gregory2015-11-28
| | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* _alpm_hook_run: check path length before copyingAndrew Gregory2015-10-28
| | | | | | | | | If a hook path equals or exceeds PATH_MAX characters the path will be left unterminated. Pre-calculating the path length also allows us to use the more efficient memcpy over strncpy. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* hook.c: print invalid option nameAndrew Gregory2015-10-27
| | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* order hooks by file nameAndrew Gregory2015-10-27
| | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* validate hooks after parsingAndrew Gregory2015-10-18
| | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* run hooks during trans_commitAndrew Gregory2015-10-18
| | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* add hook data types and parserAndrew Gregory2015-10-18
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>