[Pm-utils] [PATCH 03/12] Have pm-functions.in read an initial list of hooks to blacklist.

Victor Lowther victor.lowther at gmail.com
Tue Mar 11 18:08:32 PDT 2008


Be a little smart about it, and allow comments.

Yes, I know this code is incorrect.  It is fixed later on on the patch series.
---
 pm/pm-functions.in |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/pm/pm-functions.in b/pm/pm-functions.in
index 76e8845..5014ee2 100644
--- a/pm/pm-functions.in
+++ b/pm/pm-functions.in
@@ -48,6 +48,18 @@ done
 
 . "${PM_FUNCTIONS}"
 
+[ -f "$PM_UTILS_LIBDIR/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" | \
+	while read entry comment; do
+		[ -z "$entry" ] && continue
+		disablehook "${entry##*/}" "${comment:-blacklist}"
+	done
+}
+
 take_suspend_lock()
 {
 	VT=$(fgconsole)
-- 
1.5.4.3



More information about the Pm-utils mailing list