All pastes #931716 Raw Edit

Untitled

public text v1 · immutable
·published 2008-03-07 09:52 UTC
rendered paste body
diff -r d010d391d29d src/safe-build.in
--- a/src/safe-build.in Thu Mar 06 07:15:23 2008 +1100
+++ b/src/safe-build.in Fri Mar 07 20:49:57 2008 +1100
@@ -370,6 +370,7 @@ print_help() {
     echo "  -c    --chroot              chroot back into the directory"
     echo "  -C    --clean               uninstall packages to a clean state"
     echo "  -u    --umount              unmount the chroot (shutdown)"
+    echo "  -cf   --config-file <file>  use alternate config file"
     echo "  -v,   --version             print version and exit"
     echo "  -h,   --help                print help and exit"
 }
@@ -394,6 +395,13 @@ parse_options() {
                 SAFE_BUILD_SETUP_IMAGE='yes' ;;
                        -C|--clean)
                                SAFE_BUILD_CLEAN='yes' ;;
+            -cf|--config-file)
+                if [ ! "$2" ]; then
+                    echo "${SAFE_BUILD_COMMAND##*/}: option $1 required an argument"
+                    exit 1
+                fi
+                SAFE_BUILD_CONFIG_FILE="$2"
+                shift ;;
                        -v|--version)
                                echo "${SAFE_BUILD_COMMAND##*/} chroot wrapper $SAFE_BUILD_VERSION Copyright (c) 2008 by Danny Rawlins "
                                exit 0 ;;