diff options
author | Victor Lowther <victor.lowther@gmail.com> | 2008-03-06 20:30:47 -0600 |
---|---|---|
committer | Victor Lowther <victor.lowther@gmail.com> | 2008-03-06 20:30:47 -0600 |
commit | 96442732e5b8729332cc715e992392aeb3b8cae9 (patch) | |
tree | dfee19cbc3533ac1e65a61a617a2a6d9098439fa | |
parent | e3403ecac7243e571dd6bdc01b38f15af39e543e (diff) |
Change the default blacklist location to PM_SYSCONFDIR.
Also add before_hooks support to run_hooks.
-rw-r--r-- | pm/pm-functions.in | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/pm/pm-functions.in b/pm/pm-functions.in index 5014ee2..cd666b0 100644 --- a/pm/pm-functions.in +++ b/pm/pm-functions.in @@ -48,13 +48,14 @@ done . "${PM_FUNCTIONS}" -[ -f "$PM_UTILS_LIBDIR/blacklist" ] && { +[ -f "$PM_UTILS_SYSCONFDIR/blacklist" ] && { # loop through the blacklist file, adding entries to our hook blacklist. # Blacklist file format: # name debugging text # Comments begin with hash signs. - sed 's,#.*$,,g' < "$PM_UTILS_LIBDIR/blacklist" | \ + sed 's,#.*$,,g' < "$PM_UTILS_SYSCONFDIR/blacklist" | \ while read entry comment; do + # skip blank lines [ -z "$entry" ] && continue disablehook "${entry##*/}" "${comment:-blacklist}" done @@ -101,6 +102,7 @@ run_hooks() { # Currently only power and sleep are meaningful. local syshooks="${PM_UTILS_ETCDIR}/$1.d" local phooks="${PM_UTILS_LIBDIR}/$1.d" + command_exists before_hooks && before_hooks local sort="sort" local base local hook |