tags 405772 + patch
found 405772 0.99debian9
thanks

Package: ltsp-client
Version: 0.99debian9
Followup-For: Bug #405772

attached is new patch for proper boolean support that also handles SWAP
related booleans.

also available as patches 342 and 343 in the following bzr branch:

http://llama.freegeek.org/~vagrant/bzr/ltsp/features/vagrant-ltsp-boolean

live well,
  vagrant
=== modified file 'client/ltsp_functions'
--- client/ltsp_functions	2006-02-21 20:21:36 +0000
+++ client/ltsp_functions	2007-01-07 15:57:35 +0000
@@ -36,3 +36,10 @@
     [ -d /tmp/info ] || mkdir /tmp/info
     eval "echo \$${VAR}" >/tmp/info/${VAR}
 }
+
+get_boolean(){
+    case "$(echo $1 | tr 'A-Z' 'a-z')" in
+       true|y|yes) return 0 ;; 
+       *) return 1 ;; 
+    esac
+}

=== modified file 'debian/ltsp-client.init'
--- debian/ltsp-client.init	2006-11-14 22:21:04 +0000
+++ debian/ltsp-client.init	2007-01-07 15:57:34 +0000
@@ -35,7 +35,7 @@
 }
 
 start_sound() {
-    if [ -n "$SOUND" ]; then
+    if get_boolean "$SOUND" ; then
         # Detect and report a common problem with thin clients
 		if [ ! -f /dev/dsp ] ; then
 		    warn "Sound requested but /dev/dsp is missing.  Continuing."

=== modified file 'debian/ltsp-client.ltsp-client-setup.init'
--- debian/ltsp-client.ltsp-client-setup.init	2006-12-21 20:54:57 +0000
+++ debian/ltsp-client.ltsp-client-setup.init	2007-01-07 15:57:34 +0000
@@ -36,7 +36,7 @@
 }
 
 configure_localdev() {
-    if [ -n "$LOCALDEV" ]; then
+    if get_boolean "$LOCALDEV" ; then
         if [ ! -d /var/run/drives ];then
             mkdir /var/run/drives
         fi
@@ -62,19 +62,19 @@
 }
 
 configure_swap() {
-    if [ "$USE_LOCAL_SWAP" = "Y" ]; then
+    if get_boolean "$USE_LOCAL_SWAP" ; then
         # Enable local swap partition if found on local disk
         for part in `sfdisk -l 2>/dev/null | awk '/ 82 / { print $1}'`; do
             swap_devices="$swap_devices $part"
         done
     fi
-    if [ "$NBD_SWAP" = "Y" ]; then
+    if get_boolean "$NBD_SWAP" ; then
         SWAP_SERVER=${SWAP_SERVER:-"$SERVER"}
         NBD_PORT=${NBD_PORT:-"9210"}
         modprobe nbd
         nbd-client $SWAP_SERVER $NBD_PORT /dev/nbd0 && swap_devices="$swap_devices /dev/nbd0"
     fi
-    if [ "$ENCRYPT_SWAP" = "Y" ]; then
+    if get_boolean "$ENCRYPT_SWAP" ; then
         if [ -x /sbin/cryptsetup ]; then
             modprobe dm_crypt
         else
@@ -85,7 +85,7 @@
     num=0
     for device in $swap_devices ; do
         swap="$device"
-        if [ "$ENCRYPT_SWAP" = "Y" ]; then
+        if get_boolean "$ENCRYPT_SWAP" ; then
             if [ -x /sbin/cryptsetup ]; then
                 cryptsetup -d /dev/urandom create swap$num $swap && swap="/dev/mapper/swap$num"
                 num=$(($num+1))

Reply via email to