The log is called by _rmmod and modreload, so let's have it defined in the same file and do not expect the pm-functions is sourced first. --- pm/functions.in | 9 +++++++++ pm/pm-functions.in | 10 ---------- 2 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/pm/functions.in b/pm/functions.in index bd649db..f464293 100644 --- a/pm/functions.in +++ b/pm/functions.in @@ -17,6 +17,15 @@ is_set() # for great debugging! is_set "${PM_DEBUG}" && set -x +# Simple little logging function. +# We do it this way because 'echo -n' is not posix. +log() +{ + is_set "$LOGGING" || return 0; + local fmt='%s\n' + [ "$1" = "-n" ] && { fmt='%s'; shift; } + printf "$fmt" "$*" +} # try to take the lock. Fail if we cannot get it. try_lock() diff --git a/pm/pm-functions.in b/pm/pm-functions.in index c82be30..bad9817 100644 --- a/pm/pm-functions.in +++ b/pm/pm-functions.in @@ -85,16 +85,6 @@ done . "${PM_FUNCTIONS}" -# Simple little logging function. -# We do it this way because 'echo -n' is not posix. -log() -{ - is_set "$LOGGING" || return 0; - local fmt='%s\n' - [ "$1" = "-n" ] && { fmt='%s'; shift; } - printf "$fmt" "$*" -} - profiling() { [ "$PM_PROFILE" = "true" ]; } if profiling; then -- 1.7.1 _______________________________________________ Pm-utils mailing list Pm-utils@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/pm-utils