On 2/20/07, Richard Hughes <[EMAIL PROTECTED]> wrote:
On Tue, 2007-02-20 at 00:59 -0500, David Zeuthen wrote:
>  1. Need a pm-utils release and the associated glue for HAL. Richard,
>     can you drive this one (I can throw staplers at Peter if needed)?
>     Thanks! This is a release blocker.

Attached patches (to pm-utils and HAL) propagate the quirk information
onto the tools via the command line.

Lightly tested by me.

I just noticed that some of the tools scripts have /bin/sh for the
shebang, but they're using [ ... == ... ] for the tests. The == isn't
supported by all POSIX shells and a single = accomplishes the same
thing. Here's what bash(1) has to say about that:

      string1 == string2
             True if the strings are equal.  = may be used in place of == for
             strict POSIX compliance.

So, those should all be changed unless you've got #!/bin/bash in the
script. Here's a patch to fix all the existing cases (prior to
Richard's patches).

--
Dan
diff --git a/tools/hal-system-power-reboot b/tools/hal-system-power-reboot
index dec4b0b..1c93aac 100755
--- a/tools/hal-system-power-reboot
+++ b/tools/hal-system-power-reboot
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 PRIVILEGE=hal-power-reboot
-if [ "$HAVE_POLKIT" == "1" ] ; then
+if [ "$HAVE_POLKIT" = "1" ] ; then
     if [ "$HAL_METHOD_INVOKED_BY_UID" != "0" ] ; then
 	RESULT=$(polkit-is-privileged --privilege $PRIVILEGE \
 	    --user $HAL_METHOD_INVOKED_BY_UID \
diff --git a/tools/hal-system-power-set-power-save b/tools/hal-system-power-set-power-save
index c933d77..a7bd972 100755
--- a/tools/hal-system-power-set-power-save
+++ b/tools/hal-system-power-set-power-save
@@ -4,7 +4,7 @@ read value
 
 if [ -n "$HALD_UNAME_S" -a -x ./$HALD_UNAME_S/hal-system-power-set-power-save-$HALD_UNAME_S ]; then
     ./$HALD_UNAME_S/hal-system-power-set-power-save-$HALD_UNAME_S $value
-    if [ "x$?" == "x0" ]; then
+    if [ "x$?" = "x0" ]; then
         hal-set-property --udi $HAL_PROP_INFO_UDI \
         --key "power_management.is_powersave_set" --bool "$value"
     fi
diff --git a/tools/hal-system-power-shutdown b/tools/hal-system-power-shutdown
index 33a3226..df3d14a 100755
--- a/tools/hal-system-power-shutdown
+++ b/tools/hal-system-power-shutdown
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 PRIVILEGE=hal-power-poweroff
-if [ "$HAVE_POLKIT" == "1" ] ; then
+if [ "$HAVE_POLKIT" = "1" ] ; then
     if [ "$HAL_METHOD_INVOKED_BY_UID" != "0" ] ; then
 	RESULT=$(polkit-is-privileged --privilege $PRIVILEGE \
 	    --user $HAL_METHOD_INVOKED_BY_UID \
diff --git a/tools/hal-system-power-suspend b/tools/hal-system-power-suspend
index 8199689..bd698b7 100755
--- a/tools/hal-system-power-suspend
+++ b/tools/hal-system-power-suspend
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 PRIVILEGE=hal-power-suspend
-if [ "$HAVE_POLKIT" == "1" ] ; then
+if [ "$HAVE_POLKIT" = "1" ] ; then
     if [ "$HAL_METHOD_INVOKED_BY_UID" != "0" ] ; then
 	RESULT=$(polkit-is-privileged --privilege $PRIVILEGE \
 	    --user $HAL_METHOD_INVOKED_BY_UID \
diff --git a/tools/linux/hal-system-power-suspend-linux b/tools/linux/hal-system-power-suspend-linux
index 180d4a1..0decfd6 100755
--- a/tools/linux/hal-system-power-suspend-linux
+++ b/tools/linux/hal-system-power-suspend-linux
@@ -19,7 +19,7 @@ unsupported() {
 read seconds_to_sleep
 
 #PMU systems cannot use /sys/power/state yet, so use a helper to issue an ioctl
-if [ "$HAL_PROP_LAPTOP_PANEL_ACCESS_METHOD" == "pmu" ]; then
+if [ "$HAL_PROP_LAPTOP_PANEL_ACCESS_METHOD" = "pmu" ]; then
 	hal-system-power-pmu sleep
 	if [ $? -ne 0 ]; then
 		echo "org.freedesktop.Hal.Device.SystemPowerManagement.NotSupported" >&2
diff --git a/tools/linux/hal-system-video-resume-linux b/tools/linux/hal-system-video-resume-linux
index 852ee76..9b869e6 100755
--- a/tools/linux/hal-system-video-resume-linux
+++ b/tools/linux/hal-system-video-resume-linux
@@ -23,11 +23,11 @@ checkvbetool() {
 }
 
 # We might need to do one or many of these quirks
-if [ "$HAL_PROP_VIDEO_ADAPTER_PM_VBE_POST" == "true" ]; then
+if [ "$HAL_PROP_VIDEO_ADAPTER_PM_VBE_POST" = "true" ]; then
 	checkvbetool
 	/usr/sbin/vbetool post
 fi
-if [ "$HAL_PROP_VIDEO_ADAPTER_PM_VBESTATE_RESTORE" == "true" ]; then
+if [ "$HAL_PROP_VIDEO_ADAPTER_PM_VBESTATE_RESTORE" = "true" ]; then
 	checkvbetool
 	if [ -f /var/run/vbestate ]; then
 		/usr/sbin/vbetool vbestate restore < /var/run/vbestate
@@ -37,7 +37,7 @@ if [ "$HAL_PROP_VIDEO_ADAPTER_PM_VBESTATE_RESTORE" == "true" ]; then
         	exit 1
 	fi
 fi
-if [ "$HAL_PROP_VIDEO_ADAPTER_PM_VBEMODE_RESTORE" == "true" ]; then
+if [ "$HAL_PROP_VIDEO_ADAPTER_PM_VBEMODE_RESTORE" = "true" ]; then
 	checkvbetool
 	if [ -f /var/run/vbemode ]; then
 		/usr/sbin/vbetool vbemode set `cat /var/run/vbemode`
@@ -47,7 +47,7 @@ if [ "$HAL_PROP_VIDEO_ADAPTER_PM_VBEMODE_RESTORE" == "true" ]; then
         	exit 1
 	fi
 fi
-if [ "$HAL_PROP_VIDEO_ADAPTER_PM_DPMS_ON" == "true" ]; then
+if [ "$HAL_PROP_VIDEO_ADAPTER_PM_DPMS_ON" = "true" ]; then
 	checkvbetool
 	/usr/sbin/vbetool dpms on > /dev/null 2>&1
 fi
diff --git a/tools/linux/hal-system-video-suspend-linux b/tools/linux/hal-system-video-suspend-linux
index 7d6214b..53d62fd 100755
--- a/tools/linux/hal-system-video-suspend-linux
+++ b/tools/linux/hal-system-video-suspend-linux
@@ -24,27 +24,27 @@ checkvbetool() {
 
 
 # 1=s3_bios, 2=s3_mode, 3=both
-if [ "$HAL_PROP_VIDEO_ADAPTER_PM_S3_BIOS" == "true" ] && [ "$HAL_PROP_VIDEO_ADAPTER_PM_S3_MODE" == "true" ]; then
+if [ "$HAL_PROP_VIDEO_ADAPTER_PM_S3_BIOS" = "true" ] && [ "$HAL_PROP_VIDEO_ADAPTER_PM_S3_MODE" = "true" ]; then
 	echo -n 3 > /proc/sys/kernel/acpi_video_flags
-elif [ "$HAL_PROP_VIDEO_ADAPTER_PM_S3_BIOS" == "true" ]; then
+elif [ "$HAL_PROP_VIDEO_ADAPTER_PM_S3_BIOS" = "true" ]; then
 	echo -n 1 > /proc/sys/kernel/acpi_video_flags
-elif [ "$HAL_PROP_VIDEO_ADAPTER_PM_S3_MODE" == "true" ]; then
+elif [ "$HAL_PROP_VIDEO_ADAPTER_PM_S3_MODE" = "true" ]; then
 	echo -n 2 > /proc/sys/kernel/acpi_video_flags
 fi
 
 # We might need to do one or many of these quirks
-#if [ "$HAL_PROP_VIDEO_ADAPTER_PM_VGA_MODE_3" == "true" ]; then
+#if [ "$HAL_PROP_VIDEO_ADAPTER_PM_VGA_MODE_3" = "true" ]; then
 #	# TODO: we need to set mode3
 #fi
-if [ "$HAL_PROP_VIDEO_ADAPTER_PM_DPMS_SUSPEND" == "true" ]; then
+if [ "$HAL_PROP_VIDEO_ADAPTER_PM_DPMS_SUSPEND" = "true" ]; then
 	checkvbetool
 	/usr/sbin/vbetool dpms suspend
 fi
-if [ "$HAL_PROP_VIDEO_ADAPTER_PM_VBESTATE_RESTORE" == "true" ]; then
+if [ "$HAL_PROP_VIDEO_ADAPTER_PM_VBESTATE_RESTORE" = "true" ]; then
 	checkvbetool
 	/usr/sbin/vbetool vbestate save > /var/run/vbestate
 fi
-if [ "$HAL_PROP_VIDEO_ADAPTER_PM_VBEMODE_RESTORE" == "true" ]; then
+if [ "$HAL_PROP_VIDEO_ADAPTER_PM_VBEMODE_RESTORE" = "true" ]; then
 	checkvbetool
 	/usr/sbin/vbetool vbemode get > /var/run/vbemode
 fi
_______________________________________________
Pm-utils mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/pm-utils

Reply via email to