Bug#335870: ltsp-server: ltsp-build-client fails if some options as an empty value

2005-10-27 Thread Vagrant Cascadian
 but because of the loop: 
   while [ -n $1 ] ; do 
 .. 
 test -n $1  shift 
   done 
 
 the --late-packages was ignored because of
   --security-mirror 
 
 I modified the loop to use
   while [ $# -gt 0 ] ; do 
 .. 
 shift 
   done 

this does break if using a fussy shell like posh as /bin/sh

i'm thinking something like this would work, though:

while [ $# -gt 0 ] ; do
  ..
  test $# -gt 0  shift
done

thanks for pointing this out.

patch in baz repository:
http://llama.freegeek.org/~vagrant/baz-archive/[EMAIL PROTECTED]

[EMAIL PROTECTED]/ltsp--debianfixes--0--patch-42

live well,
  vagrant


signature.asc
Description: Digital signature


Bug#335870: ltsp-server: ltsp-build-client fails if some options as an empty value

2005-10-26 Thread Finn-Arne Johansen
Package: ltsp-server
Version: 0.58debian2
Severity: normal
Tags: patch

I tried to install using this command-line:
ltsp-build-client \
  --root /opt/ltsp/i386 \
  --mirror file:///cdrom \
  --dist sarge \
  --components main local \
  --security-mirror  \
  --late-packages kernel-image-2.6-386 kernel-image-netbootable

This should give me an bootable chroot with a 2.6-kernel
but because of the loop: 
  while [ -n $1 ] ; do 
.. 
test -n $1  shift 
  done 

the --late-packages was ignored because of
  --security-mirror 

I modified the loop to use
  while [ $# -gt 0 ] ; do 
.. 
shift 
  done 

Now things work the way I want them

-- System Information:
Debian Release: 3.1
Architecture: i386 (i686)
Kernel: Linux 2.6.13-x300
Locale: LANG=nb_NO, LC_CTYPE=nb_NO (charmap=ISO-8859-1)

Versions of packages ltsp-server depends on:
ii  atftpd   0.7-7   advanced TFTP server
ii  debootstrap  0.2.45-0.2  Bootstrap a basic Debian system
ii  netkit-inetd 0.10-10 The Internet Superserver
ii  nfs-kernel-server1:1.0.6-3.1 Kernel NFS server support
ii  syslinux 2.11-0.1Bootloader for Linux/i386 using MS

-- no debconf information

*** ltsp-build-client.diff
--- /usr/sbin/ltsp-build-client.org 2005-10-26 13:07:01.0 +0200
+++ /usr/sbin/ltsp-build-client 2005-10-26 13:59:26.774579215 +0200
@@ -68,34 +68,34 @@
 }
 
 # process commandline arguments
-while [ -n $1 ]; do
-  case $1 in
+while [ $# -gt 0 ]; do
+  case $1 in
 --root) ROOT=$2
-  test -n $1  shift
+  shift
   ;;
 --dist) DIST=$2
-  test -n $1  shift
+  shift
   ;;
 --components) COMPONENTS=$2
-  test -n $1  shift
+  shift
   ;;
 --mirror) MIRROR=$2
-  test -n $1  shift
+  shift
   ;;
 --extra-mirror) EXTRA_MIRROR=$2
-  test -n $1  shift
+  shift
   ;;
 --exclude) EXCLUDE=$2
-  test -n $1  shift
+  shift
   ;;
 --security-mirror) SECURITY_MIRROR=$2
-  test -n $1  shift
+  shift
   ;;
 --early-packages) EARLY_PACKAGES=$2
-  test -n $1  shift
+  shift
   ;;
 --late-packages) LATE_PACKAGES=$2
-  test -n $1  shift
+  shift
   ;;
 --help) get_help
   exit 0
@@ -107,7 +107,7 @@
   exit 1
   ;;
   esac
-  test -n $1  shift
+  shift
 done
 
 test -z $ROOT  ROOT=/opt/ltsp/$(dpkg --print-architecture)


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]