[Debian-eeepc-commits] [SCM] Maintenance of eeepc-acpi-scripts debian package branch, master, updated. 1.1.0-beta.1-19-g43f593b

Darren Salt linux at youmustbejoking.demon.co.uk
Wed Jun 10 17:18:10 UTC 2009


The following commit has been merged in the master branch:
commit 5aebb42c3d60c5adf60dc72f0ca4f62793d0fd8e
Author: Tanguy Ortolo <tanguy+debian at ortolo.eu>
Date:   Wed Jun 10 16:47:26 2009 +0200

    tests broken when empty variables
    
    I had some problems with my Eee PC 901, that does not have a bluetooth kill
    switch in /proc/ or /sys/: even if there is a modprobe-based fallback, pressing
    the corresponding hotkey always left it enabled.
    
    I finally found the problem: $BT_CTL was empty, and tested with [ -e $BT_CTL ],
    that (with dash as /bin/sh) is [ -e ], that is... true! "$BT_CTL" (the empty
    string) should be used instead of $BT_CTL (nothing).

diff --git a/etc/acpi/actions/hotkey.sh b/etc/acpi/actions/hotkey.sh
index 6fc3f59..b8a3c45 100755
--- a/etc/acpi/actions/hotkey.sh
+++ b/etc/acpi/actions/hotkey.sh
@@ -4,7 +4,7 @@
 PKG=eeepc-acpi-scripts
 FUNC_LIB=/usr/share/$PKG/functions.sh
 DEFAULT=/etc/default/$PKG
-[ -e $FUNC_LIB ] || exit 0
+[ -e "$FUNC_LIB" ] || exit 0
 
 case $(runlevel) in
     *0|*6)
@@ -59,7 +59,7 @@ show_bluetooth() {
 
 handle_bluetooth_toggle() {
     . /etc/acpi/lib/bluetooth.sh
-    if [ -e $BT_CTL ] || [ "$BLUETOOTH_FALLBACK_TO_HCITOOL" = "yes" ]; then
+    if [ -e "$BT_CTL" ] || [ "$BLUETOOTH_FALLBACK_TO_HCITOOL" = "yes" ]; then
 	toggle_bluetooth
 	show_bluetooth
     else
@@ -77,7 +77,7 @@ show_camera() {
 
 handle_camera_toggle() {
     . /etc/acpi/lib/camera.sh
-    if [ -e $CAM_CTL ]; then
+    if [ -e "$CAM_CTL" ]; then
 	toggle_camera
 	show_camera
     else
diff --git a/etc/acpi/actions/suspend.sh b/etc/acpi/actions/suspend.sh
index c326752..a5c803c 100755
--- a/etc/acpi/actions/suspend.sh
+++ b/etc/acpi/actions/suspend.sh
@@ -2,7 +2,7 @@
 
 # do nothing if package is removed
 FUNC_LIB=/usr/share/eeepc-acpi-scripts/functions.sh
-[ -e $FUNC_LIB ] || exit 0
+[ -e "$FUNC_LIB" ] || exit 0
 
 . /etc/default/eeepc-acpi-scripts
 . $FUNC_LIB
diff --git a/etc/acpi/actions/vga-toggle.sh b/etc/acpi/actions/vga-toggle.sh
index 70e0249..4321520 100755
--- a/etc/acpi/actions/vga-toggle.sh
+++ b/etc/acpi/actions/vga-toggle.sh
@@ -4,7 +4,7 @@
 PKG=eeepc-acpi-scripts
 FUNC_LIB=/usr/share/$PKG/functions.sh
 DEFAULT=/etc/default/$PKG
-[ -e $FUNC_LIB ] || exit 0
+[ -e "$FUNC_LIB" ] || exit 0
 
 if [ -e "$DEFAULT" ]; then . "$DEFAULT"; fi
 . $FUNC_LIB
diff --git a/etc/acpi/actions/volume.sh b/etc/acpi/actions/volume.sh
index 0e2c804..63f4b47 100755
--- a/etc/acpi/actions/volume.sh
+++ b/etc/acpi/actions/volume.sh
@@ -6,7 +6,7 @@
 PKG=eeepc-acpi-scripts
 FUNC_LIB=/usr/share/$PKG/functions.sh
 DEFAULT=/etc/default/$PKG
-[ -e $FUNC_LIB ] || exit 0
+[ -e "$FUNC_LIB" ] || exit 0
 
 . $FUNC_LIB
 . /etc/acpi/lib/notify.sh
diff --git a/etc/acpi/actions/wireless.sh b/etc/acpi/actions/wireless.sh
index 617826a..bfc2fbf 100755
--- a/etc/acpi/actions/wireless.sh
+++ b/etc/acpi/actions/wireless.sh
@@ -7,7 +7,7 @@ wlan_control="$RFKILL"
 
 [ -n "$wlan_control" -a -e $wlan_control ] \
     || wlan_control=/sys/devices/platform/eeepc/wlan # pre-2.6.28
-[ -e $wlan_control ] || wlan_control=/proc/acpi/asus/wlan # pre-2.6.26
+[ -e "$wlan_control" ] || wlan_control=/proc/acpi/asus/wlan # pre-2.6.26
 
 STATE="$(cat $wlan_control)"
 
diff --git a/etc/acpi/lib/bluetooth.sh b/etc/acpi/lib/bluetooth.sh
index a4db72e..58b342f 100644
--- a/etc/acpi/lib/bluetooth.sh
+++ b/etc/acpi/lib/bluetooth.sh
@@ -4,8 +4,8 @@
 
 detect_rfkill eeepc-bluetooth
 BT_CTL="$RFKILL"
-[ -e $BT_CTL ] || BT_CTL=/sys/devices/platform/eeepc/bluetooth # pre-2.6.28
-[ -e $BT_CTL ] || BT_CTL=/proc/acpi/asus/bluetooth # pre-2.6.26
+[ -e "$BT_CTL" ] || BT_CTL=/sys/devices/platform/eeepc/bluetooth # pre-2.6.28
+[ -e "$BT_CTL" ] || BT_CTL=/proc/acpi/asus/bluetooth # pre-2.6.26
 # check if bluetooth is switched on and return success (exit code 0 if it is
 # return failure (exit code 1) if it is not
 #
@@ -13,7 +13,7 @@ BT_CTL="$RFKILL"
 # if not, uses hcitool to see if there is a hci0 device
 bluetooth_is_on()
 {
-    if [ -e $BT_CTL ]; then
+    if [ -e "$BT_CTL" ]; then
         [ $( cat $BT_CTL ) = "1" ]
     else
         if [ "$BLUETOOTH_FALLBACK_TO_HCITOOL" = "yes" ]; then
@@ -27,7 +27,7 @@ bluetooth_is_on()
 toggle_bluetooth()
 {
     if bluetooth_is_on; then
-        if [ -e $BT_CTL ]; then
+        if [ -e "$BT_CTL" ]; then
             echo 0 > $BT_CTL
             # udev should unload the module now
         elif [ "$BLUETOOTH_FALLBACK_TO_HCITOOL" = "yes" ]; then
@@ -40,7 +40,7 @@ toggle_bluetooth()
 	    done
         fi
     else
-        if [ -e $BT_CTL ]; then
+        if [ -e "$BT_CTL" ]; then
             echo 1 > $BT_CTL
             # udev should load the module now
         elif [ "$BLUETOOTH_FALLBACK_TO_HCITOOL" = "yes" ]; then
diff --git a/etc/acpi/lib/camera.sh b/etc/acpi/lib/camera.sh
index 1aab001..e2949d3 100644
--- a/etc/acpi/lib/camera.sh
+++ b/etc/acpi/lib/camera.sh
@@ -3,7 +3,7 @@
 # to be sourced
 
 CAM_CTL=/sys/devices/platform/eeepc/camera
-[ -e $CAM_CTL ] || CAM_CTL=/proc/acpi/asus/camera #pre-2.6.26
+[ -e "$CAM_CTL" ] || CAM_CTL=/proc/acpi/asus/camera #pre-2.6.26
 # check if camera is enabled and return success (exit code 0 if it is
 # return failure (exit code 1) if it is not
 #
@@ -11,7 +11,7 @@ CAM_CTL=/sys/devices/platform/eeepc/camera
 # if not, assume there is not camera and return false
 camera_is_on()
 {
-    if [ -e $CAM_CTL ]; then
+    if [ -e "$CAM_CTL" ]; then
         [ $( cat $CAM_CTL ) = "1" ]
     else
         false
@@ -23,7 +23,7 @@ toggle_camera()
     if camera_is_on; then
         echo 0 > $CAM_CTL
     else
-        if [ -e $CAM_CTL ]; then
+        if [ -e "$CAM_CTL" ]; then
             echo 1 > $CAM_CTL
         fi
     fi
diff --git a/etc/acpi/lib/notify.sh b/etc/acpi/lib/notify.sh
index 2221a06..dea99c9 100644
--- a/etc/acpi/lib/notify.sh
+++ b/etc/acpi/lib/notify.sh
@@ -21,7 +21,7 @@ notify() {
 
     # try to show a nice OSD notification via GNOME OSD service
     GOSDC=/usr/bin/gnome-osd-client
-    if [ -z "$OSD_SHOWN" ] && [ -x $GOSDC ]; then
+    if [ -z "$OSD_SHOWN" ] && [ -x "$GOSDC" ]; then
 	if ps -u $user -o cmd= | grep -q '^/usr/bin/python /usr/bin/gnome-osd-event-bridge'; then
 	    if echo "$MSG" | grep -q '[0-9]'; then
 		animations='off'
diff --git a/functions.sh b/functions.sh
index 49748b6..0fd2d21 100644
--- a/functions.sh
+++ b/functions.sh
@@ -57,7 +57,7 @@ detect_x_display()
     fi
     _home=$(getent passwd $_user | cut -d: -f6)
     XAUTHORITY=$_home/.Xauthority
-    if [ -f $XAUTHORITY ]; then
+    if [ -f "$XAUTHORITY" ]; then
         export XAUTHORITY
         export DISPLAY=:0
         user=$_user
@@ -75,7 +75,7 @@ lock_x_screen()
     # activate screensaver if available
     if [ -S /tmp/.X11-unix/X0 ]; then
         detect_x_display
-        if [ -f $XAUTHORITY ]; then
+        if [ -f "$XAUTHORITY" ]; then
             for ss in xscreensaver gnome-screensaver; do
                 [ -x /usr/bin/$ss-command ] \
                     && pidof /usr/bin/$ss > /dev/null \

-- 
Maintenance of eeepc-acpi-scripts debian package



More information about the Debian-eeepc-commits mailing list