rpms/pm-utils/devel pm-utils-99hd-apm-restore, 1.6, 1.7 pm-utils.spec, 1.117, 1.118

Till Maas till at fedoraproject.org
Thu Jun 25 20:36:09 UTC 2009


Author: till

Update of /cvs/pkgs/rpms/pm-utils/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv23616

Modified Files:
	pm-utils-99hd-apm-restore pm-utils.spec 
Log Message:
- add hdparm executable check to pm-utils-99hd-apm-restore
- convert tabs to spaces in pm-utils-99hd-apm-restore for whitespace consistency
- fix e-mail address in pm-utils-99hd-apm-restore
- bump spec because of pm-utils-99hd-apm-restore changes, rebuid only needed
  for s390(x)



Index: pm-utils-99hd-apm-restore
===================================================================
RCS file: /cvs/pkgs/rpms/pm-utils/devel/pm-utils-99hd-apm-restore,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -p -r1.6 -r1.7
--- pm-utils-99hd-apm-restore	15 Apr 2008 12:27:47 -0000	1.6
+++ pm-utils-99hd-apm-restore	25 Jun 2009 20:35:38 -0000	1.7
@@ -1,7 +1,7 @@
 #!/bin/bash
 # vim:noexpandtab
 #
-#    Author: Till Maas <opensource till name>
+#    Author: Till Maas <opensource at till.name>
 #    This program is free software: you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
 #    the Free Software Foundation, either version 2 of the License, or
@@ -15,8 +15,17 @@
 PATH=/sbin:/bin:/usr/sbin:/usr/bin
 
 source "${PM_FUNCTIONS}"
+
+
+
 source /etc/pm-utils-hd-apm-restore.conf
 
+if [ ! -x "$(which hdparm 2>/dev/null)" ]
+then
+    echo "hdparm not found in path '${PATH}' or not executable."
+    exit $NA
+fi
+
 HD_APM_DEVICES=""
 for udi in $(hal-find-by-capability --capability storage)
 do
@@ -29,43 +38,43 @@ do
 done
 
 case "$1" in
-	hibernate|suspend)
-		for DEVICE in ${HD_APM_DEVICES}
-		do
-			HD_APM_FEATURE=$(hdparm -I "/dev/${DEVICE}" | grep "Advanced Power Management feature set")
-			if [[ "${HD_APM_FEATURE}" != "" ]]
-			then
-				if (echo "${HD_APM_FEATURE}" | grep -q "*" )
-				then
-					HD_APM_LEVEL=$(hdparm -I "/dev/${DEVICE}" | grep "Advanced power management level" | cut -d" " -f 5)
-				else
-					HD_APM_LEVEL=255
-				fi
-				if [[ "${HD_APM_LEVEL}" != "unknown" ]]
-				then
-					echo "saving level ${HD_APM_LEVEL} for device ${DEVICE}"
-					savestate "${DEVICE}" "${HD_APM_LEVEL}"
-				else
-					echo "Advanced Power Management value of device ${DEVICE} unknown"
-				fi
-			else
-				echo "Advanced Power Management not supported by device ${DEVICE}."
-			fi
-		done
-		;;
-	thaw|resume)
-		for DEVICE in ${HD_APM_DEVICES}
-		do
-			HD_APM_LEVEL=$(restorestate "${DEVICE}")
-			if [[ "${HD_APM_LEVEL}" != "" ]]
-			then
-				echo "restoring level ${HD_APM_LEVEL} for device ${DEVICE}"
-				hdparm -B "${HD_APM_LEVEL}" "/dev/${DEVICE}"
-			fi
-		done
-		;;
-	*)
-		;;
+    hibernate|suspend)
+        for DEVICE in ${HD_APM_DEVICES}
+        do
+            HD_APM_FEATURE=$(hdparm -I "/dev/${DEVICE}" | grep "Advanced Power Management feature set")
+            if [[ "${HD_APM_FEATURE}" != "" ]]
+            then
+                if (echo "${HD_APM_FEATURE}" | grep -q "*" )
+                then
+                    HD_APM_LEVEL=$(hdparm -I "/dev/${DEVICE}" | grep "Advanced power management level" | cut -d" " -f 5)
+                else
+                    HD_APM_LEVEL=255
+                fi
+                if [[ "${HD_APM_LEVEL}" != "unknown" ]]
+                then
+                    echo "saving level ${HD_APM_LEVEL} for device ${DEVICE}"
+                    savestate "${DEVICE}" "${HD_APM_LEVEL}"
+                else
+                    echo "Advanced Power Management value of device ${DEVICE} unknown"
+                fi
+            else
+                echo "Advanced Power Management not supported by device ${DEVICE}."
+            fi
+        done
+        ;;
+    thaw|resume)
+        for DEVICE in ${HD_APM_DEVICES}
+        do
+            HD_APM_LEVEL=$(restorestate "${DEVICE}")
+            if [[ "${HD_APM_LEVEL}" != "" ]]
+            then
+                echo "restoring level ${HD_APM_LEVEL} for device ${DEVICE}"
+                hdparm -B "${HD_APM_LEVEL}" "/dev/${DEVICE}"
+            fi
+        done
+        ;;
+    *)
+        ;;
 esac
 
 exit $?


Index: pm-utils.spec
===================================================================
RCS file: /cvs/pkgs/rpms/pm-utils/devel/pm-utils.spec,v
retrieving revision 1.117
retrieving revision 1.118
diff -u -p -r1.117 -r1.118
--- pm-utils.spec	24 Apr 2009 13:06:38 -0000	1.117
+++ pm-utils.spec	25 Jun 2009 20:35:38 -0000	1.118
@@ -2,7 +2,7 @@ Name: pm-utils
 Summary: Power management utilities and scripts for Fedora
 License: GPLv2
 Version: 1.2.5
-Release: 1%{?dist}.1
+Release: 2%{?dist}
 Group: System Environment/Base
 URL: http://pm-utils.freedesktop.org
 # for chvt
@@ -106,6 +106,9 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Thu Jun 25 2009 Till Maas <opensource at till.name> - 1.2.5-2
+- add check for hdparm in hd-apm-restore
+
 * Fri Apr 24 2009 Karsten Hopp <karsten at redhat.com> 1.2.5-1.1
 - we don't have kbd and hdparm on s390(x), disable build requirements
 




More information about the fedora-extras-commits mailing list