Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/build.sh,v rcsdiff: /ftp/cvs/cvsroot/src/build.sh,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.294 retrieving revision 1.294.2.3 diff -u -p -r1.294 -r1.294.2.3 --- src/build.sh 2014/08/10 05:56:36 1.294 +++ src/build.sh 2014/11/14 14:58:27 1.294.2.3 @@ -1,5 +1,5 @@ #! /usr/bin/env sh -# $NetBSD: build.sh,v 1.294 2014/08/10 05:56:36 matt Exp $ +# $NetBSD: build.sh,v 1.294.2.3 2014/11/14 14:58:27 martin Exp $ # # Copyright (c) 2001-2011 The NetBSD Foundation, Inc. # All rights reserved. @@ -1034,8 +1034,8 @@ Usage: ${progname} [-EhnorUuxy] [-a arch sourcesets Create source sets in RELEASEDIR/source/sets. syspkgs Create syspkgs in RELEASEDIR/RELEASEMACHINEDIR/binary/syspkgs. - iso-image Create CD-ROM image in RELEASEDIR/iso. - iso-image-source Create CD-ROM image with source in RELEASEDIR/iso. + iso-image Create CD-ROM image in RELEASEDIR/images. + iso-image-source Create CD-ROM image with source in RELEASEDIR/images. live-image Create bootable live image in RELEASEDIR/RELEASEMACHINEDIR/installation/liveimage. install-image Create bootable installation image in @@ -1100,6 +1100,7 @@ parseoptions() { opts='a:B:C:D:Ehj:M:m:N:nO:oR:rS:T:UuV:w:X:xY:yZ:' opt_a=false + opt_m=false if type getopts >/dev/null 2>&1; then # Use POSIX getopts. @@ -1177,6 +1178,7 @@ parseoptions() -m) eval ${optargcmd} MACHINE="${OPTARG}" + opt_m=true ;; -N) @@ -1312,25 +1314,6 @@ parseoptions() exit $? ;; - makewrapper|cleandir|obj|tools|build|distribution|release|sets|sourcesets|syspkgs|params) - ;; - - iso-image) - op=iso_image # used as part of a variable name - ;; - - iso-image-source) - op=iso_image_source # used as part of a variable name - ;; - - live-image) - op=live_image # used as part of a variable name - ;; - - install-image) - op=install_image # used as part of a variable name - ;; - kernel=*|releasekernel=*|kernel.gdb=*) arg=${op#*=} op=${op%%=*} @@ -1346,10 +1329,6 @@ parseoptions() ;; - modules) - op=modules - ;; - install=*|installmodules=*) arg=${op#*=} op=${op%%=*} @@ -1357,8 +1336,24 @@ parseoptions() bomb "Must supply a directory with \`install=...'" ;; - rump|rumptest) - op=${op} + build|\ + cleandir|\ + distribution|\ + install-image|\ + iso-image-source|\ + iso-image|\ + live-image|\ + makewrapper|\ + modules|\ + obj|\ + params|\ + release|\ + rump|\ + rumptest|\ + sets|\ + sourcesets|\ + syspkgs|\ + tools) ;; *) @@ -1366,22 +1361,26 @@ parseoptions() ;; esac + # ${op} may contain chars that are not allowed in variable + # names. Replace them with '_' before setting do_${op}. + op="$( echo "$op" | tr -s '.-' '__')" eval do_${op}=true done [ -n "${operations}" ] || usage "Missing operation to perform." # Set up MACHINE*. On a NetBSD host, these are allowed to be unset. # - # MACHINE_ARCH from the environment may be overridden by getarch - # (based on the MACHINE), but MACHINE_ARCH from the -a option should - # not be overridden. - # if [ -z "${MACHINE}" ]; then [ "${uname_s}" = "NetBSD" ] || bomb "MACHINE must be set, or -m must be used, for cross builds." MACHINE=${uname_m} fi - $opt_a || getarch + if $opt_m && ! $opt_a; then + # Settings implied by the command line -m option + # override MACHINE_ARCH from the environment (if any). + getarch + fi + [ -n "${MACHINE_ARCH}" ] || getarch validatearch # Set up default make(1) environment. @@ -1864,7 +1863,7 @@ createmakewrapper() eval cat <