Package: util-vserver
Version: 0.30.214-4
Severity: minor
Tags: patch

Hi

it is a bit confusing that some config options in
/etc/default/util-vserver are enabled by "true" and some by "yes"
string. I think that all of them should accept same (or even better
both).

Attached patch does this (and also removes extra $ in message).

-- 
        Michal Čihař | http://cihar.com | http://blog.cihar.com


-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.22-2-vserver-amd64 (SMP w/1 CPU core)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages util-vserver depends on:
ii  debconf                       1.5.16     Debian configuration management sy
ii  iproute                       20070313-1 Professional tools to control the 
ii  libbeecrypt6                  4.1.2-6    open source C library of cryptogra
ii  libc6                         2.6.1-6    GNU C Library: Shared libraries
ii  make                          3.81-3     The GNU version of the "make" util
ii  net-tools                     1.60-17.2  The NET-3 networking toolkit

Versions of packages util-vserver recommends:
ii  binutils            2.18.1~cvs20071027-1 The GNU assembler, linker and bina
ii  debootstrap         1.0.6                Bootstrap a basic Debian system

-- debconf information:
  util-vserver/prerm_stop_running_vservers: true
  util-vserver/postrm_remove_vserver_configs: false
--- util-vserver.orig   2007-10-29 03:42:07.000000000 +0100
+++ util-vserver        2007-10-29 03:46:42.000000000 +0100
@@ -46,6 +46,15 @@
     legacy=yes
 fi
 
+# Check whether value is true/enabled
+is_true() {
+    if [ "x$1" = "xtrue" -o "x$1" = "xyes" ] ; then
+        return 0
+    else
+        return 1
+    fi
+}
+
 # Print the vserver name in priority/alpha order
 # This function is only used for legacy configs
 sortserver(){
@@ -71,7 +80,7 @@
        do
                ONBOOT=
                . $name.conf
-               if [ "$ONBOOT" = "yes" ] ; then
+               if is_true "$ONBOOT" ; then
                echo "Starting Linux-VServer guests..."
                        $_VSERVER_LEGACY $name start
                else
@@ -94,7 +103,7 @@
        $_VSERVER_INFO - FEATURE iattr
        if [ $? -eq 0 ]
        then
-               echo -n $"Fixing visibility of /proc entries for Linux-VServer 
guests..."
+               echo -n "Fixing visibility of /proc entries for Linux-VServer 
guests..."
                $_VPROCUNHIDE
                if [ $? -ne 0 ]
                then
@@ -129,9 +138,9 @@
        setattr --barrier $vrootactual
 
        # Then start up vservers with $MARK if $AUTO is set to start things
-       if [ "$AUTO" = "true" ]
+       if is_true "$AUTO"
                then
-               if [ "$BACKGROUND" = "yes" ]
+               if is_true "$BACKGROUND"
                then
                        echo "Starting Linux-VServers in background"
                        /usr/lib/util-vserver/vserver-wrapper start  >/dev/tty8 
</dev/tty8 2>/dev/tty8 &
@@ -154,7 +163,7 @@
 {
     if [ -e /proc/self/vinfo ]
     then
-       if [ "$AUTO" = "true" ]
+       if is_true "$AUTO"
        then
                /usr/lib/util-vserver/vserver-wrapper stop;
        fi
@@ -186,8 +195,8 @@
 case "$1" in
     start)
           # First run the legacy starts, if there are any
-          if [ "$legacy" = "yes" ]; then
-             if [ "$BACKGROUND" = "yes" ] ; then
+          if is_true "$legacy" ; then
+             if is_true "$BACKGROUND" ; then
                  startservers >/dev/tty8 </dev/tty8 2>/dev/tty8 &
              else
                  startservers
@@ -199,7 +208,7 @@
           ;;
     stop)
         # First stop the legacy vservers
-         if [ "$legacy" = "yes" ]; then
+         if is_true "$legacy" ; then
              echo "Stopping Vservers"
             cd $__CONFDIR
             for name in `sortserver -r`
@@ -210,7 +219,7 @@
         fi
         # Then stop the modern vservers
         stop
-        if [ "$ALWAYS_STOP" = "true" ]
+        if is_true "$ALWAYS_STOP"
         then
                forcestop
         fi
@@ -226,7 +235,7 @@
             ;;
     status)
        # Do tests for old legacy interface
-           if [ "$legacy" = "yes" ]; then
+           if is_true "$legacy" ; then
                cd $__CONFDIR
                for serv in *.conf
                do

Reply via email to