[Pm-utils] [PATCH 3/6] Cleaned up the logging output in run_hooks.
Victor Lowther
victor.lowther at gmail.com
Mon Mar 17 17:35:41 PDT 2008
---
pm/pm-functions.in | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/pm/pm-functions.in b/pm/pm-functions.in
index 4fa1ad1..0d8d73f 100644
--- a/pm/pm-functions.in
+++ b/pm/pm-functions.in
@@ -136,7 +136,12 @@ run_hooks() {
local nifs="
"
IFS="${nifs}" # tolerate spaces in filenames.
- [ "$3" = "reverse" ] && sort="sort -r"
+ if [ "$3" = "reverse" ]; then
+ sort="sort -r"
+ log "$(date): Running $1 hooks backwards"
+ else
+ log "$(date): Running $1 hooks"
+ fi
for base in $(IFS="${oifs}"; for f in "$syshooks/"*[!~] "$phooks/"*[!~];
do [ -O "$f" ] && echo ${f##*/} ; done | $sort | uniq) ;
do
@@ -147,7 +152,7 @@ run_hooks() {
elif [ -f "$phooks/$base" ]; then
hook="$phooks/$base"
fi
- log $(date): running ${hook} $2
+ log "${hook} $2:"
hook_ok "$hook" && (
IFS="${oifs}"
"${hook}" $2
@@ -179,6 +184,7 @@ init_logfile()
fi
export LOGGING=true
exec > "$1" 2>&1
+ log "$(date): $0 running."
}
--
1.5.4.3
More information about the Pm-utils
mailing list