[Pm-utils] various errors in pm/functions

Stefan Seyfried seife at suse.de
Wed Oct 11 12:40:24 PDT 2006


On Tue, Oct 10, 2006 at 12:13:58PM -0400, Peter Jones wrote:
 
> Actually, I'm committing this, instead:
> 
> @@ -62,13 +62,19 @@ run_hooks()
>         [ -f /var/run/pm-suspend ] && . /var/run/pm-suspend
>         rm -f /var/run/pm-suspend
>  
> -       files="/etc/pm/hooks/*"
> +       files="/etc/pm/hooks/*[^~]"
>         if [ "$2" = "reverse" ]; then
> -               files=$(echo $files | awk '{ for (i=NF; i>=1; i--) if ($i !~ /~$/ { print $i } }')
> +               filea=($files)
> +               filen=${#filea[*]}
> +               while [ "$filen" -gt 0 ]; do
> +                       file="${filea[$filen]}"
> +                       [ -x $file ] && $file $1
> +               done

we never get out of this loop.

Index: pm/functions
===================================================================
RCS file: /cvs/pm-utils/pm-utils/pm/functions,v
retrieving revision 1.21
diff -u -p -r1.21 functions
--- pm/functions	10 Oct 2006 16:14:50 -0000	1.21
+++ pm/functions	11 Oct 2006 19:38:56 -0000
@@ -67,6 +67,7 @@ run_hooks()
 		filea=($files)
 		filen=${#filea[*]}
 		while [ "$filen" -gt 0 ]; do
+			let filen--
 			file="${filea[$filen]}"
 			[ -x $file ] && $file $1
 		done





-- 
Stefan Seyfried
QA / R&D Team Mobile Devices        |              "Any ideas, John?"
SUSE LINUX Products GmbH, Nürnberg  | "Well, surrounding them's out." 


More information about the Pm-utils mailing list