FreeBSD Bugzilla – Attachment 118622 Details for
Bug 160896
[nanobsd] [patch] use getopts, jobs option, delay -c usage improvements to nanobsd.sh
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 3.85 KB, created by
Enji Cooper
on 2011-09-22 08:40:07 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Enji Cooper
Created:
2011-09-22 08:40:07 UTC
Size:
3.85 KB
patch
obsolete
>Index: tools/tools/nanobsd/nanobsd.sh >=================================================================== >--- tools/tools/nanobsd/nanobsd.sh (revision 225704) >+++ tools/tools/nanobsd/nanobsd.sh (working copy) >@@ -58,7 +58,7 @@ > #NANO_DISKIMGDIR="" > > # Parallel Make >-NANO_PMAKE="make -j 3" >+NANO_PMAKE="make" > > # The default name for any image we create. > NANO_IMGNAME="_.disk.full" >@@ -588,6 +588,8 @@ > # after the build completed, for instance to copy the finished > # image to a more convenient place: > # cp ${NANO_DISKIMGDIR}/_.disk.image /home/ftp/pub/nanobsd.disk >+ # The following line is needed to keep bash from barfing on the file. >+ : > ) > > ####################################################################### >@@ -758,102 +760,103 @@ > # Progress Print > # Print $2 at level $1. > pprint() { >- if [ "$1" -le $PPLEVEL ]; then >- runtime=$(( `date +%s` - $NANO_STARTTIME )) >- printf "%s %.${1}s %s\n" "`date -u -r $runtime +%H:%M:%S`" "#####" "$2" 1>&3 >- fi >+ if [ "$1" -le $PPLEVEL ]; then >+ runtime=$(( $(date +'%s') - ${NANO_STARTTIME} )) >+ printf "%s %.${1}s %s\n" "$(date -u -r $runtime +%H:%M:%S)" "#####" "$2" >&3 >+ fi > } > > usage () { >- ( >- echo "Usage: $0 [-bfiknqvw] [-c config_file]" >- echo " -b suppress builds (both kernel and world)" >- echo " -f suppress code slice extraction" >- echo " -i suppress disk image build" >- echo " -k suppress buildkernel" >- echo " -n add -DNO_CLEAN to buildworld, buildkernel, etc" >- echo " -q make output more quiet" >- echo " -v make output more verbose" >- echo " -w suppress buildworld" >- echo " -c specify config file" >- ) 1>&2 >+ cat >&2 <<EOF >+usage: ${0##*/} [-biknqvw] [-c config_file] >+ -b suppress builds (both kernel and world) >+ -c config_file config file to use after defining all >+ internal variables. >+ -i suppress disk image build >+ -j make-jobs number of make jobs to invoke >+ -k suppress buildkernel >+ -n add -DNO_CLEAN to buildworld, buildkernel, etc >+ -q make output more quiet >+ -v make output more verbose >+ -w suppress buildworld >+EOF > exit 2 > } > > ####################################################################### > # Parse arguments > >+set +e >+ > do_clean=true > do_kernel=true > do_world=true > do_image=true > do_copyout_partition=true >+make_jobs=3 >+nano_conf= > >-set +e >-args=`getopt bc:fhiknqvw $*` >-if [ $? -ne 0 ] ; then >- usage >- exit 2 >-fi >-set -e >- >-set -- $args >-for i >+while getopts 'bc:hij:knqvw' optch > do >- case "$i" >- in >- -b) >+ case "$optch" in >+ b) > do_world=false > do_kernel=false >- shift > ;; >- -k) >- do_kernel=false >- shift >+ c) >+ if [ -f "$OPTARG" ]; then >+ nano_conf=$OPTARG >+ fi > ;; >- -c) >- . "$2" >- shift >- shift >- ;; >- -f) >+ f) > do_copyout_partition=false >- shift > ;; >- -h) >+ h) > usage > ;; >- -i) >+ i) > do_image=false >- shift > ;; >- -n) >+ j) >+ echo $OPTARG | egrep -q '^[[:digit:]]+$' && [ $OPTARG -gt 0 ] >+ if [ $? -ne 0 ]; then >+ echo "${0##*/}: -j value must be a positive integer." >+ usage >+ fi >+ make_jobs=$OPTARG >+ ;; >+ k) >+ do_kernel=false >+ ;; >+ n) > do_clean=false >- shift > ;; >- -q) >- PPLEVEL=$(($PPLEVEL - 1)) >- shift >+ q) >+ : $(( PPLEVEL -= 1)) > ;; >- -v) >- PPLEVEL=$(($PPLEVEL + 1)) >- shift >+ v) >+ : $(( PPLEVEL += 1)) > ;; >- -w) >+ w) > do_world=false >- shift > ;; >- --) >- shift >- break >+ *) >+ usage >+ ;; > esac > done > >+shift $(( $OPTIND - 1 )) >+ > if [ $# -gt 0 ] ; then >- echo "$0: Extraneous arguments supplied" >+ echo "${0##*/}: extraneous arguments supplied" > usage > fi > >+NANO_PMAKE="$NANO_PMAKE -j $make_jobs" >+ >+set -e >+ > ####################################################################### > # Setup and Export Internal variables > # >@@ -865,6 +868,11 @@ > NANO_MAKE_CONF_BUILD=${MAKEOBJDIRPREFIX}/make.conf.build > NANO_MAKE_CONF_INSTALL=${NANO_OBJ}/make.conf.install > >+if [ -n "$nano_conf" ]; then >+ echo "Sourcing $nano_conf" >+ . "$nano_conf" >+fi >+ > if [ -d ${NANO_TOOLS} ] ; then > true > elif [ -d ${NANO_SRC}/${NANO_TOOLS} ] ; then
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 160896
: 118622 |
118623