From 5a08101277f497a6a92cb123d1f1e2dbfb3abb22 Mon Sep 17 00:00:00 2001 From: phk Date: Thu, 9 Mar 2006 14:43:07 +0000 Subject: In addition to -b (suppress builds) add -k (suppress kernel build) and -w (suppress world). --- tools/tools/nanobsd/nanobsd.sh | 47 +++++++++++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 10 deletions(-) (limited to 'tools') diff --git a/tools/tools/nanobsd/nanobsd.sh b/tools/tools/nanobsd/nanobsd.sh index 1be2c7c..64a1c3f 100644 --- a/tools/tools/nanobsd/nanobsd.sh +++ b/tools/tools/nanobsd/nanobsd.sh @@ -461,16 +461,30 @@ customize_cmd () { # ####################################################################### +usage () { + ( + echo "Usage: $0 [-b/-k/-w] [-c config_file]" + echo " -b suppress builds (both kernel and world)" + echo " -k suppress buildkernel" + echo " -w suppress buildworld" + echo " -c specify config file" + ) 1>&2 + exit 2 +} + ####################################################################### # Parse arguments -do_build=true +do_kernel=true +do_world=true -args=`getopt bc:h $*` +set +e +args=`getopt bc:hkw $*` if [ $? -ne 0 ] ; then - echo "Usage: $0 [-c config file]" 1>&2 + usage exit 2 fi +set -e set -- $args for i @@ -479,7 +493,12 @@ do in -b) shift; - do_build=false + do_world=false + do_kernel=false + ;; + -k) + shift; + do_kernel=false ;; -c) . "$2" @@ -487,8 +506,11 @@ do shift; ;; -h) - echo "Usage: $0 [-b] [-c config file]" - exit 2 + usage + ;; + -w) + shift; + do_world=false ;; --) shift; @@ -497,8 +519,8 @@ do done if [ $# -gt 0 ] ; then - echo "Extraneous arguments" - exit 2 + echo "$0: Extraneous arguments supplied" + usage fi ####################################################################### @@ -547,13 +569,18 @@ export NANO_WORLDDIR ####################################################################### # And then it is as simple as that... -if $do_build ; then +if $do_world ; then clean_build make_conf_build build_world +else + echo "## Skipping buildworld (as instructed)" +fi + +if $do_kernel ; then build_kernel else - echo "## Skipping build steps (as instructed)" + echo "## Skipping buildkernel (as instructed)" fi clean_world -- cgit v1.1