slackware-current/source/ap/pm-utils/patches/hook-exit-code-log.patch

20 lines
622 B
Diff
Raw Normal View History

diff -up pm-utils-1.4.1/pm/pm-functions.in.orig pm-utils-1.4.1/pm/pm-functions.in
--- pm-utils-1.4.1/pm/pm-functions.in.orig 2011-08-22 14:52:58.976213050 +0200
+++ pm-utils-1.4.1/pm/pm-functions.in 2011-08-22 14:57:26.000000000 +0200
@@ -195,11 +195,13 @@ hook_ok()
_run_hook() {
# $1 = hook to run
# rest of args passed to hook unchanged.
+ local hook_status
log "Running hook $*:"
hook_ok "$1" && "$@"
+ hook_status=$?
log ""
- log -n "$*: "
- hook_exit_status $? && LAST_HOOK="${1##*/}" || inhibit
+ log -n "$*: "
+ hook_exit_status $hook_status && LAST_HOOK="${1##*/}" || inhibit
}
if profiling; then