summaryrefslogtreecommitdiff
path: root/pm
diff options
context:
space:
mode:
authorVictor Lowther <victor.lowther@gmail.com>2008-03-11 19:54:21 -0500
committerVictor Lowther <victor.lowther@gmail.com>2008-03-11 19:54:21 -0500
commita30d46c64050f919f96baf626ae13d79d1023317 (patch)
treeba61a0a8cdcc0325fae6935042e53287b60aeb9d /pm
parent02685b1ea67e656c646f8bcbad6645df08441ee5 (diff)
Optionally ignore two leading digits in the hook filename in hook_ok
Requested by Michael Biebl.
Diffstat (limited to 'pm')
-rw-r--r--pm/pm-functions.in6
1 files changed, 5 insertions, 1 deletions
diff --git a/pm/pm-functions.in b/pm/pm-functions.in
index 120bc33..0adfb6a 100644
--- a/pm/pm-functions.in
+++ b/pm/pm-functions.in
@@ -91,7 +91,11 @@ hook_exit_status(){
hook_ok()
{
- [ -f "$STORAGEDIR/disable_hook:${1##*/}" ] && return $DX
+ local hook="${1##*/}"
+ ## the actual name as passed to us.
+ [ -f "$STORAGEDIR/disable_hook:$hook" ] && return $DX
+ ## name with zeros chopped off the filename
+ [ -f "$STORAGEDIR/disable_hook:${hook#[0-9][0-9]}" ] && return $DX
[ -x "$1" ] || return $NX
return 0
}