[Pm-utils] POSIXification of pm-utils

Till Maas opensource at till.name
Sun Jan 13 00:12:46 PST 2008

On Sun January 13 2008, Victor Lowther wrote:

> Major changes:
> * Renamed the hooks directory to sleep.d

I like this

> * Generalized the hook-running infrastructure and modified
> pm-powersave to use it instead of having its own copy.

and this.

> Comments, patches, flames, praise, etc. welcome!
       58 	local bases=$(for f in $syshooks/*[!~] $phooks/*[!~];
       59 		do echo ${f##*/} ; done | 
       60 		sed 's/\*\[\!\^\]//g' |sort -n | uniq)

I guess the "^" should be a "~" in the sed regular expression. I do not know, 
but is there no nicer solution to implement the bash "nullglob" feature? 
Repeating the pathname-expansion pattern with a lot of backslashes for sed.

echo -e "99video\n99999suspend" | sort -n
does work here as expected in bash. But zzz is a funny name in this 
context. :-)

      215 # reload all the modules in no particular order.
      216 modreload()
      217 {
      218 	for x in /var/run/pm-suspend/module:* ; do
      219 		[ -f "${x}" ] && modprobe "${x##*:}" >/dev/null 2>&1
      220 	done
      221 }
Here it would be a little nice to have the nullglob feature, too. Also I like 
speaking variable names for than "x", e.g. "module".

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: This is a digitally signed message part.
Url : http://lists.freedesktop.org/archives/pm-utils/attachments/20080113/573f502a/attachment.pgp 

More information about the Pm-utils mailing list