build: scrub it like you mean it

common.sh eats up the arguments via getopts, but on return to the parent
script the arguments are restored.  To adapt the argument scrubbing to
the actual number of arguments eaten we'll sprinkle a bit of arcane shell
magic around and hope for the best.
This commit is contained in:
Franco Fichtner 2015-05-16 12:48:14 +02:00
parent 35068a9393
commit 1ae0487e3d
11 changed files with 15 additions and 19 deletions

View File

@ -27,7 +27,7 @@
set -e
. ./common.sh
. ./common.sh && $(${SCRUB_ARGS})
rm -f ${SETSDIR}/base-*-${ARCH}.txz

View File

@ -27,10 +27,7 @@
set -e
. ./common.sh
# remove all mandatory arguments
shift; shift; shift; shift; shift; shift
. ./common.sh && $(${SCRUB_ARGS})
for ARG in ${@}; do
case ${ARG} in

View File

@ -27,16 +27,21 @@
set -e
SCRUB_ARGS=:
while getopts n:f:v: OPT; do
case ${OPT} in
f)
export PRODUCT_FLAVOUR=${OPTARG}
SCRUB_ARGS=${SCRUB_ARGS};shift;shift
;;
n)
export PRODUCT_NAME=${OPTARG}
SCRUB_ARGS=${SCRUB_ARGS};shift;shift
;;
v)
export PRODUCT_VERSION=${OPTARG}
SCRUB_ARGS=${SCRUB_ARGS};shift;shift
;;
*)
echo "Usage: ${0} [-f flavour] [-n name] [-v version]" >&2

View File

@ -27,7 +27,7 @@
set -e
. ./common.sh
. ./common.sh && $(${SCRUB_ARGS})
git_clear ${PORTSDIR}
git_clear ${COREDIR}

View File

@ -27,7 +27,7 @@
set -e
. ./common.sh
. ./common.sh && $(${SCRUB_ARGS})
# rewrite the disk label, because we're install media
LABEL="${LABEL}_Install"

View File

@ -27,7 +27,7 @@
set -e
. ./common.sh
. ./common.sh && $(${SCRUB_ARGS})
rm -f ${SETSDIR}/kernel-*-${ARCH}.txz

View File

@ -28,7 +28,7 @@
set -e
. ./common.sh
. ./common.sh && $(${SCRUB_ARGS})
# rewrite the disk label, because we're install media
LABEL="${LABEL}_Install"

View File

@ -29,7 +29,7 @@
set -e
. ./common.sh
. ./common.sh && $(${SCRUB_ARGS})
. ${SRCDIR}/tools/tools/nanobsd/FlashDevice.sub
sub_FlashDevice sandisk 2g

View File

@ -27,10 +27,7 @@
set -e
. ./common.sh
# remove all mandatory arguments
shift; shift; shift; shift; shift; shift
. ./common.sh && $(${SCRUB_ARGS})
PORT_LIST=$(cat ${PRODUCT_CONFIG}/ports.conf)

View File

@ -27,7 +27,7 @@
set -e
. ./common.sh
. ./common.sh && $(${SCRUB_ARGS})
git_clear ${COREDIR}

View File

@ -27,10 +27,7 @@
set -e
. ./common.sh
# remove all mandatory arguments
shift; shift; shift; shift; shift; shift
. ./common.sh && $(${SCRUB_ARGS})
if [ -n "${1}" ]; then
# make sure the all-encompassing package is a release, too