Switching lh_clean to proper command line arguments.

This commit is contained in:
Daniel Baumann 2007-11-18 16:14:50 +01:00
parent f9242b2d49
commit fefbe2259e
1 changed files with 17 additions and 17 deletions

View File

@ -20,7 +20,7 @@ done
# Setting static variables # Setting static variables
DESCRIPTION="clean up system build directories" DESCRIPTION="clean up system build directories"
HELP="" HELP=""
USAGE="${PROGRAM} [all|cache|chroot|binary|purge|stage|source]" USAGE="${PROGRAM} [--all] [--cache] [--chroot] [--binary] [--purge] [--remove] [--stage] [--source]"
Arguments "${@}" Arguments "${@}"
@ -37,7 +37,7 @@ rm -f .lock
if [ -z "${@}" ] if [ -z "${@}" ]
then then
ARGUMENTS="all" ARGUMENTS="--all"
else else
ARGUMENTS="${@}" ARGUMENTS="${@}"
fi fi
@ -52,18 +52,18 @@ fi
for ARGUMENT in ${ARGUMENTS} for ARGUMENT in ${ARGUMENTS}
do do
case "${ARGUMENT}" in case "${ARGUMENT}" in
all) --all)
"${0}" chroot "${0}" --chroot
"${0}" binary "${0}" --binary
"${0}" stage "${0}" --stage
"${0}" source "${0}" --source
;; ;;
cache) --cache)
${LH_ROOT_COMMAND} rm -rf cache ${LH_ROOT_COMMAND} rm -rf cache
;; ;;
chroot) --chroot)
Echo_message "Cleaning chroot" Echo_message "Cleaning chroot"
${LH_ROOT_COMMAND} umount -f chroot/sys > /dev/null 2>&1 || true ${LH_ROOT_COMMAND} umount -f chroot/sys > /dev/null 2>&1 || true
${LH_ROOT_COMMAND} umount -f chroot/proc/sys/fs/binfmt_misc > /dev/null 2>&1 || true ${LH_ROOT_COMMAND} umount -f chroot/proc/sys/fs/binfmt_misc > /dev/null 2>&1 || true
@ -78,7 +78,7 @@ do
rm -f .stage/chroot* rm -f .stage/chroot*
;; ;;
binary) --binary)
${LH_ROOT_COMMAND} umount -f binary.tmp > /dev/null 2>&1 || true ${LH_ROOT_COMMAND} umount -f binary.tmp > /dev/null 2>&1 || true
rm -rf binary.tmp binary.deb binary.udeb rm -rf binary.tmp binary.deb binary.udeb
rm -f binary.iso rm -f binary.iso
@ -92,21 +92,21 @@ do
rm -f .stage/binary* rm -f .stage/binary*
;; ;;
remove) --remove)
"${0}" all "${0}" --all
rm -rf cache/packages_* rm -rf cache/packages_*
;; ;;
purge) --purge)
"${0}" all "${0}" --all
"${0}" cache "${0}" --cache
;; ;;
stage) --stage)
rm -rf .stage rm -rf .stage
;; ;;
source) --source)
rm -f source.iso rm -f source.iso
rm -f source.img rm -f source.img
rm -f source*.tar rm -f source*.tar