I've got version 1.0~a37-2 of live-helper on my machine (the latest
from sid) and lh_clean doesn't deal with incorrect arguments properly
- it calls itself with the --usage flag if it doesn't understand an
argument.  There is no '--usage' case in the switch tree.  The
attached patch fixes this, using text from the man page for lh_clean.

Rather than call the script and invoke another copy of the shell, it
might be preferrable to have a "usage" subroutine that is called by
the '--help' or '--usage' flags and also in case of a bad argument.
This would prevent the infinite-loop behavior I saw - even if the sub
were to become undefined it would simply fall through rather than
start a bunch of new processes (nearly a thousand by the time I
figured out what was going on).  I didn't implement this in my patch
in case there's some subtlety I'm missing.

Thanks!
Will
--- lh_clean.orig       2007-11-28 02:09:29.000000000 +0000
+++ lh_clean    2007-11-28 02:11:07.000000000 +0000
@@ -116,6 +116,37 @@
 
                        rm -f .stage/source*
                        ;;
+               --usage)
+                       cat <<EOF
+lh_clean  [live-helper options]  [--all]  [--cache]  [--chroot] [--binary] [--purge] [--remove] [--stage]
+       [--source]
+
+       --all
+           removes chroot, binary, stage, and source. This is the default operation.
+
+       --cache
+           removes all cache directories.
+
+       --chroot
+           unmounts and removes the chroot directory. If bootstrap cache is available, the system  is  reset  to
+           bootstrap stage.
+
+       --binary
+           removes all binary related caches, directories, and stages files.
+
+       --purge
+           removes everything (including cache) but config.
+
+       --remove
+           removes everything (including package cache, but not stage cache) but config.
+
+       --stage
+           removes all stage files.
+
+       --source
+           removes all source related caches, directories, and stage files.
+EOF
+                       ;;
 
                *)
                        "${0}" --usage

_______________________________________________
debian-live-devel mailing list
debian-live-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/debian-live-devel

Reply via email to