[Debian-eeepc-devel] [SCM] Maintenance of eeepc-acpi-scripts debian package branch, master, updated. 4656d93f6da33dd174d70e48e49613022b904ef1
Damyan Ivanov
dmn at debian.org
Sat Sep 27 07:20:56 UTC 2008
The following commit has been merged in the master branch:
commit 6a8966e1049805fdb7d9dae339ac5f38b019cb9d
Author: Damyan Ivanov <dmn at debian.org>
Date: Sat Sep 27 09:08:34 2008 +0300
make package removal check depend on the functions.sh, not doc dir; streamline loading of functions and default file
diff --git a/actions/hotkey.sh b/actions/hotkey.sh
index 5009cc7..a574911 100755
--- a/actions/hotkey.sh
+++ b/actions/hotkey.sh
@@ -1,10 +1,14 @@
#!/bin/sh
# do nothing if package is removed
-[ -d /usr/share/doc/eeepc-acpi-scripts ] || exit 0
+PKG=eeepc-acpi-scripts
+FUNC_LIB=/usr/share/$PKG/functions.sh
+DEFAULT=/etc/default/$PKG
+[ -e $FUNC_LIB ] || exit 0
+
+if [ -e "$DEFAULT" ]; then . "$DEFAULT"; fi
+. $FUNC_LIB
-. /etc/default/eeepc-acpi-scripts
-. /usr/share/eeepc-acpi-scripts/functions.sh
. /etc/acpi/lib/notify.sh
code=$3
diff --git a/actions/suspend.sh b/actions/suspend.sh
index ac680ea..fa5953b 100755
--- a/actions/suspend.sh
+++ b/actions/suspend.sh
@@ -1,16 +1,16 @@
#!/bin/sh
# do nothing if package is removed
-[ -d /usr/share/doc/eeepc-acpi-scripts ] || exit 0
+FUNC_LIB=/usr/share/eeepc-acpi-scripts/functions.sh
+[ -e $FUNC_LIB ] || exit 0
+
+. /etc/default/eeepc-acpi-scripts
+. $FUNC_LIB
if (runlevel | grep -q [06]) || (pidof '/sbin/shutdown' > /dev/null); then
exit 0
fi
-[ -r /etc/default/eeepc-acpi-scripts ] && . /etc/default/eeepc-acpi-scripts
-
-. /usr/share/eeepc-acpi-scripts/functions.sh
-
if [ "$LOCK_SCREEN_ON_SUSPEND" = "yes" ]; then
lock_x_screen
fi
diff --git a/actions/vga-toggle.sh b/actions/vga-toggle.sh
index 6a90bb4..ee50023 100755
--- a/actions/vga-toggle.sh
+++ b/actions/vga-toggle.sh
@@ -1,10 +1,13 @@
#!/bin/sh
# do nothing if package is removed
-[ -d /usr/share/doc/eeepc-acpi-scripts ] || exit 0
+PKG=eeepc-acpi-scripts
+FUNC_LIB=/usr/share/$PKG/functions.sh
+DEFAULT=/etc/default/$PKG
+[ -e $FUNC_LIB ] || exit 0
-. /etc/default/eeepc-acpi-scripts
-. /usr/share/eeepc-acpi-scripts/functions.sh
+if [ -e "$DEFAULT" ]; then . "$DEFAULT"; fi
+. $FUNC_LIB
# return: 0 on disconnect, 1 on connected vga, 2 else
getvga_status(){
diff --git a/actions/volume.sh b/actions/volume.sh
index 5c06820..904d71d 100755
--- a/actions/volume.sh
+++ b/actions/volume.sh
@@ -3,10 +3,13 @@
# Volume controls
# do nothing if package is removed
-[ -d /usr/share/doc/eeepc-acpi-scripts ] || exit 0
+PKG=eeepc-acpi-scripts
+FUNC_LIB=/usr/share/$PKG/functions.sh
+DEFAULT=/etc/default/$PKG
+[ -e $FUNC_LIB ] || exit 0
-. /etc/default/eeepc-acpi-scripts
-. /usr/share/eeepc-acpi-scripts/functions.sh
+if [ -e "$DEFAULT" ]; then . "$DEFAULT"; fi
+. $FUNC_LIB
. /etc/acpi/lib/notify.sh
action=$1
--
Maintenance of eeepc-acpi-scripts debian package
More information about the Debian-eeepc-devel
mailing list