--- a/lib/pvl/apply.sh Tue Mar 03 12:42:26 2015 +0200
+++ b/lib/pvl/apply.sh Tue Mar 03 12:43:00 2015 +0200
@@ -45,18 +45,18 @@
local update=
local out="$1"
- debug "$out"
+ log_debug "$out"
if [ ${#@} -eq 1 ]; then
- debug " update: empty deps"
+ log_changed " update: empty deps"
return 2
elif [ ! -e "$out" ]; then
- debug " update: dest missing"
+ log_changed " update: dest missing"
return 2
elif [ "$APPLY_FORCE" = 1 ]; then
- debug " update: forced"
+ log_changed " update: forced"
return 2
fi
@@ -64,16 +64,16 @@
for dep in "${@:2}"; do
# check
if [ ! -e "$dep" ]; then
- warn "$out: Missing source: $dep"
+ warn "$out: Missing source: $dep"
elif [ "$out" -ot "$dep" ]; then
- debug " update: $dep"
+ log_changed " changed: $dep"
return 1
else
- debug " check: $dep"
+ log_debug " check: $dep"
fi
done
- debug " up-to-date"
+ log_debug " up-to-date"
return 0
}
--- a/lib/pvl/log.sh Tue Mar 03 12:42:26 2015 +0200
+++ b/lib/pvl/log.sh Tue Mar 03 12:43:00 2015 +0200
@@ -8,6 +8,7 @@
LOG_FORCE=y
LOG_APPLY=y
LOG_CHECK=
+LOG_CHANGED=
LOG_NOOP=y
LOG_SKIP=
LOG_DEBUG=
@@ -41,6 +42,7 @@
LOG_DIFF=
;;
v)
+ LOG_CHANGED=y
LOG_CHECK=y
LOG_SKIP=y
;;
@@ -103,6 +105,10 @@
[ $LOG_CHECK ] && log_color '32' " $*" || true
}
+function log_changed {
+ [ $LOG_CHANGED ] && log_color '1;32' " $*" || true
+}
+
function log_noop {
[ $LOG_NOOP ] && log_color '2;34' " $*" || true
}