hal: Branch 'master'

Holger Macht homac at kemper.freedesktop.org
Mon Apr 21 00:39:43 PDT 2008


 tools/linux/hal-dockstation-undock-linux |    3 ++-
 tools/linux/hal-system-wol-linux         |    9 ++++++---
 2 files changed, 8 insertions(+), 4 deletions(-)

New commits:
commit 04a1a5b20ead1a3f64579d266ba3e0309bb014b5
Author: Holger Macht <holger at homac.de>
Date:   Mon Apr 21 09:29:05 2008 +0200

    output errors to stderr and provide a description
    
    HAL requires scripts to return an exception _and_ a description line in
    the error case. Otherwise the exception is not properly forwarded to the
    caller.

diff --git a/tools/linux/hal-dockstation-undock-linux b/tools/linux/hal-dockstation-undock-linux
index a29f43a..e85e632 100644
--- a/tools/linux/hal-dockstation-undock-linux
+++ b/tools/linux/hal-dockstation-undock-linux
@@ -2,7 +2,8 @@
 
 DOCKED=`cat $HAL_PROP_LINUX_SYSFS_PATH/docked`
 if [ "$DOCKED" = "0" ]; then
- 	echo "org.freedesktop.Hal.Device.DockStation.NotDocked"
+ 	echo "org.freedesktop.Hal.Device.DockStation.NotDocked" >&2
+ 	echo "System not docked" >&2
 	exit 1
 fi
 
diff --git a/tools/linux/hal-system-wol-linux b/tools/linux/hal-system-wol-linux
index 36909c3..35ab994 100755
--- a/tools/linux/hal-system-wol-linux
+++ b/tools/linux/hal-system-wol-linux
@@ -13,7 +13,8 @@ IFACE="$HAL_PROP_NET_INTERFACE"
 wol_get_flags() {
     SUPPORT_FLAGS=`ethtool $IFACE | awk '/Supports Wake-on:/{if ($3 ~ /g/) print $3 }'`
     [ -n "$SUPPORT_FLAGS" ] && return 0
-    echo "org.freedesktop.Hal.Device.WakeOnLAN.NotSupported"
+    echo "org.freedesktop.Hal.Device.WakeOnLAN.NotSupported" >&2
+    echo "Network interface does not support Wake On LAN" >&2
     exit 1
 }
 
@@ -54,7 +55,8 @@ wol_disable() {
 
 which ethtool >/dev/null 2>&1
 if [ "$?" != "0" ]; then
-    echo "org.freedesktop.Hal.Device.WakeOnLan.NoEthtool"
+    echo "org.freedesktop.Hal.Device.WakeOnLan.NoEthtool" >&2
+    echo -e "No ethtool found in \$PATH" >&2
     exit 1
 fi
 
@@ -71,7 +73,8 @@ case "`basename $0`" in
 	elif [ "$enable" = "false" ]; then
 	    wol_disable
 	else
-	    echo "org.freedesktop.Hal.Device.WakeOnLAN.InvalidArgument"
+	    echo "org.freedesktop.Hal.Device.WakeOnLAN.InvalidArgument" >&2
+	    echo "argument must be of boolean type" >&2
 	    exit 1
 	fi
 	;;


More information about the hal-commit mailing list