[Debian-eeepc-commits] [SCM] Maintenance of eeepc-acpi-scripts debian package branch, master, updated. 1.1.1-27-g59fee08

Darren Salt linux at youmustbejoking.demon.co.uk
Fri Aug 14 12:16:45 UTC 2009


The following commit has been merged in the master branch:
commit 59fee08d618ee0673ff474b58679735e4ca53740
Author: Darren Salt <linux at youmustbejoking.demon.co.uk>
Date:   Fri Aug 14 13:15:10 2009 +0100

    Init script fixups for when /etc/default/eeepc-acpi-scripts is missing.
    Ensure that we default to "automatic" for our S.H.E. handling.

diff --git a/debian/changelog b/debian/changelog
index a3fa6cc..654c1a8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+eeepc-acpi-scripts (1.1.3) UNRELEASED; urgency=low
+
+  [ Darren Salt ]
+  * Init script fixups for when /etc/default/eeepc-acpi-scripts is missing;
+    ensure that we default to "automatic" for our S.H.E. handling. 
+
+ -- Darren Salt <linux at youmustbejoking.demon.co.uk>  Fri, 14 Aug 2009 13:10:21 +0100
+
 eeepc-acpi-scripts (1.1.2) unstable; urgency=low
 
   [ Darren Salt ]
diff --git a/debian/eeepc-acpi-scripts.init b/debian/eeepc-acpi-scripts.init
index c064fe8..48290da 100644
--- a/debian/eeepc-acpi-scripts.init
+++ b/debian/eeepc-acpi-scripts.init
@@ -90,11 +90,13 @@ case "$1" in
 
     log_action_end_msg 0
 
-    if [ -f /etc/default/eeepc-acpi-scripts -a -f /etc/acpi/lib/shengine.sh ]; then
+    if [ -f /etc/acpi/lib/shengine.sh ]; then
 	log_action_begin_msg 'Setting super hybrid engine according to configuration'
-	. /etc/default/eeepc-acpi-scripts
+	if [ -f /etc/default/eeepc-acpi-scripts ]; then
+	    . /etc/default/eeepc-acpi-scripts
+	fi
 	. /etc/acpi/lib/shengine.sh
-	if [ "$SHENGINE_SETTING" != auto ]; then
+	if [ "${SHENGINE_SETTING:-auto}" != auto ]; then
 	    log_action_cont_msg '(manual)'
 	elif [ "$(cat /sys/class/power_supply/AC0/online 2>/dev/null)" = 0 ]; then
 	    log_action_cont_msg '(battery)'
diff --git a/etc/acpi/actions/ac_adapter.sh b/etc/acpi/actions/ac_adapter.sh
index ee02ae8..df1448a 100755
--- a/etc/acpi/actions/ac_adapter.sh
+++ b/etc/acpi/actions/ac_adapter.sh
@@ -22,7 +22,7 @@ case "$code" in
     # AC adapter present
     0000008[01]\ 00000001)
 	. /etc/acpi/lib/shengine.sh
-	if [ "$SHENGINE_SETTING" = auto ]; then
+	if [ "${SHENGINE_SETTING:-auto}" = auto ]; then
 	    PWR_CLOCK_AC="${PWR_CLOCK_AC:-0}"
 	    if [ $(get_shengine -) -gt "$PWR_CLOCK_AC" ]; then
 		handle_shengine "$PWR_CLOCK_AC" -
@@ -33,7 +33,7 @@ case "$code" in
     # AC adapter not present
     0000008[01]\ 00000000)
 	. /etc/acpi/lib/shengine.sh
-	if [ "$SHENGINE_SETTING" = auto ]; then
+	if [ "${SHENGINE_SETTING:-auto}" = auto ]; then
 	    PWR_CLOCK_BATTERY="${PWR_CLOCK_BATTERY:-$(($SHENGINE_LIMIT - 1))}"
 	    if [ $(get_shengine -) -lt "$PWR_CLOCK_BATTERY" ]; then
 		handle_shengine "$PWR_CLOCK_BATTERY" -
diff --git a/etc/acpi/lib/shengine.sh b/etc/acpi/lib/shengine.sh
index 0248718..ba91a70 100644
--- a/etc/acpi/lib/shengine.sh
+++ b/etc/acpi/lib/shengine.sh
@@ -11,7 +11,7 @@ SHENGINE_SETTING="$(cat "$SHENGINE_CONFIG" 2>/dev/null || :)"
 
 get_shengine()
 {
-    if [ "$SHENGINE_SETTING" = auto -a "$1" = '' ]; then
+    if [ "${SHENGINE_SETTING:-auto}" = auto -a "$1" = '' ]; then
 	echo 255
     elif [ -e "$SHENGINE_CTL" ]; then
         echo $(( $(cat "$SHENGINE_CTL") & 0xFF ))
@@ -22,7 +22,7 @@ get_shengine()
 
 set_shengine()
 {
-    if [ -e "$SHENGINE_CTL" -a "$SHENGINE_SETTING" = auto ]; then
+    if [ -e "$SHENGINE_CTL" -a "${SHENGINE_SETTING:-auto}" = auto ]; then
 	echo "$1" > "$SHENGINE_CTL"
     fi
 }
@@ -31,7 +31,7 @@ cycle_shengine()
 {
     if [ -e "$SHENGINE_CTL" ]; then
 	SHENGINE_CLOCKING=$(get_shengine)
-	if [ "$SHENGINE_SETTING" = auto ]; then
+	if [ "${SHENGINE_SETTING:-auto}" = auto ]; then
 	    SHENGINE_CLOCKING=0
 	    SHENGINE_SETTING=manual
 	    echo manual >"$SHENGINE_CONFIG"

-- 
Maintenance of eeepc-acpi-scripts debian package



More information about the Debian-eeepc-commits mailing list