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:
parent
35068a9393
commit
1ae0487e3d
|
@ -27,7 +27,7 @@
|
|||
|
||||
set -e
|
||||
|
||||
. ./common.sh
|
||||
. ./common.sh && $(${SCRUB_ARGS})
|
||||
|
||||
rm -f ${SETSDIR}/base-*-${ARCH}.txz
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
set -e
|
||||
|
||||
. ./common.sh
|
||||
. ./common.sh && $(${SCRUB_ARGS})
|
||||
|
||||
git_clear ${PORTSDIR}
|
||||
git_clear ${COREDIR}
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
set -e
|
||||
|
||||
. ./common.sh
|
||||
. ./common.sh && $(${SCRUB_ARGS})
|
||||
|
||||
# rewrite the disk label, because we're install media
|
||||
LABEL="${LABEL}_Install"
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
set -e
|
||||
|
||||
. ./common.sh
|
||||
. ./common.sh && $(${SCRUB_ARGS})
|
||||
|
||||
rm -f ${SETSDIR}/kernel-*-${ARCH}.txz
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
set -e
|
||||
|
||||
. ./common.sh
|
||||
. ./common.sh && $(${SCRUB_ARGS})
|
||||
|
||||
# rewrite the disk label, because we're install media
|
||||
LABEL="${LABEL}_Install"
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
set -e
|
||||
|
||||
. ./common.sh
|
||||
. ./common.sh && $(${SCRUB_ARGS})
|
||||
|
||||
. ${SRCDIR}/tools/tools/nanobsd/FlashDevice.sub
|
||||
sub_FlashDevice sandisk 2g
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
set -e
|
||||
|
||||
. ./common.sh
|
||||
. ./common.sh && $(${SCRUB_ARGS})
|
||||
|
||||
git_clear ${COREDIR}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue