build: fix argument scrubbing, remove obsolete gettext-tools from core

This commit is contained in:
Franco Fichtner 2017-04-27 19:14:36 +02:00
parent a420970cf5
commit df43aa9126
27 changed files with 41 additions and 70 deletions

View File

@ -29,7 +29,7 @@ set -e
SELF=base
. ./common.sh && $(${SCRUB_ARGS})
. ./common.sh
BASE_SET=$(find ${SETSDIR} -name "base-*-${PRODUCT_ARCH}.txz")

View File

@ -1,6 +1,6 @@
#!/bin/sh
# Copyright (c) 2016 Franco Fichtner <franco@opnsense.org>
# Copyright (c) 2016-2107 Franco Fichtner <franco@opnsense.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@ -29,7 +29,7 @@ set -e
SELF=boot
. ./common.sh && $(${SCRUB_ARGS})
. ./common.sh
if [ -z "${1}" ]; then
echo ">> No image given."

View File

@ -1,6 +1,6 @@
#!/bin/sh
# Copyright (c) 2016 Franco Fichtner <franco@opnsense.org>
# Copyright (c) 2016-2017 Franco Fichtner <franco@opnsense.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@ -29,7 +29,7 @@ set -e
SELF=chroot
. ./common.sh && $(${SCRUB_ARGS})
. ./common.sh
echo ">>> chroot'ing into ${STAGEDIR}/${1}..."

View File

@ -29,7 +29,7 @@ set -e
SELF=clean
. ./common.sh && $(${SCRUB_ARGS})
. ./common.sh
for ARG in ${@}; do
case ${ARG} in

View File

@ -29,7 +29,6 @@
set -e
OPTS="a:B:b:C:c:d:E:e:F:f:G:g:K:k:L:l:m:n:o:P:p:R:S:s:T:t:U:u:v:V:"
SCRUB_ARGS=":"
while getopts ${OPTS} OPT; do
case ${OPT} in
@ -37,123 +36,96 @@ while getopts ${OPTS} OPT; do
export PRODUCT_TARGET=${OPTARG%%:*}
export PRODUCT_ARCH=${OPTARG##*:}
export PRODUCT_HOST=$(uname -p)
SCRUB_ARGS=${SCRUB_ARGS};shift;shift
;;
B)
export PORTSBRANCH=${OPTARG}
SCRUB_ARGS=${SCRUB_ARGS};shift;shift
;;
b)
export SRCBRANCH=${OPTARG}
SCRUB_ARGS=${SCRUB_ARGS};shift;shift
;;
C)
export COREDIR=${OPTARG}
SCRUB_ARGS=${SCRUB_ARGS};shift;shift
;;
c)
export PRODUCT_SPEED=${OPTARG}
SCRUB_ARGS=${SCRUB_ARGS};shift;shift
;;
d)
export PRODUCT_DEVICE=${OPTARG}
SCRUB_ARGS=${SCRUB_ARGS};shift;shift
;;
E)
export COREBRANCH=${OPTARG}
SCRUB_ARGS=${SCRUB_ARGS};shift;shift
;;
e)
export PLUGINSBRANCH=${OPTARG}
SCRUB_ARGS=${SCRUB_ARGS};shift;shift
;;
F)
export PRODUCT_KERNEL=${OPTARG}
SCRUB_ARGS=${SCRUB_ARGS};shift;shift
;;
f)
export PRODUCT_FLAVOUR=${OPTARG}
SCRUB_ARGS=${SCRUB_ARGS};shift;shift
;;
G)
export PORTSREFBRANCH=${OPTARG}
SCRUB_ARGS=${SCRUB_ARGS};shift;shift
;;
g)
export TOOLSBRANCH=${OPTARG}
SCRUB_ARGS=${SCRUB_ARGS};shift;shift
;;
K)
if [ -n "${OPTARG}" ]; then
export PRODUCT_PUBKEY=${OPTARG}
fi
SCRUB_ARGS=${SCRUB_ARGS};shift;shift
;;
k)
if [ -n "${OPTARG}" ]; then
export PRODUCT_PRIVKEY=${OPTARG}
fi
SCRUB_ARGS=${SCRUB_ARGS};shift;shift
;;
L)
if [ -n "${OPTARG}" ]; then
export PRODUCT_SIGNCMD=${OPTARG}
fi
SCRUB_ARGS=${SCRUB_ARGS};shift;shift
;;
l)
if [ -n "${OPTARG}" ]; then
export PRODUCT_SIGNCHK=${OPTARG}
fi
SCRUB_ARGS=${SCRUB_ARGS};shift;shift
;;
m)
export PRODUCT_MIRROR=${OPTARG}
SCRUB_ARGS=${SCRUB_ARGS};shift;shift
;;
n)
export PRODUCT_NAME=${OPTARG}
SCRUB_ARGS=${SCRUB_ARGS};shift;shift
;;
o)
if [ -n "${OPTARG}" ]; then
export STAGEDIRPREFIX=${OPTARG}
fi
SCRUB_ARGS=${SCRUB_ARGS};shift;shift
;;
P)
export PORTSDIR=${OPTARG}
SCRUB_ARGS=${SCRUB_ARGS};shift;shift
;;
p)
export PLUGINSDIR=${OPTARG}
SCRUB_ARGS=${SCRUB_ARGS};shift;shift
;;
R)
export PORTSREFDIR=${OPTARG}
SCRUB_ARGS=${SCRUB_ARGS};shift;shift
;;
S)
export SRCDIR=${OPTARG}
SCRUB_ARGS=${SCRUB_ARGS};shift;shift
;;
s)
export PRODUCT_SETTINGS=${OPTARG}
SCRUB_ARGS=${SCRUB_ARGS};shift;shift
;;
T)
export TOOLSDIR=${OPTARG}
SCRUB_ARGS=${SCRUB_ARGS};shift;shift
;;
t)
export PRODUCT_TYPE=${OPTARG}
SCRUB_ARGS=${SCRUB_ARGS};shift;shift
;;
U)
case "${OPTARG}" in
''|-devel)
export PRODUCT_SUFFIX=${OPTARG}
SCRUB_ARGS=${SCRUB_ARGS};shift;shift
;;
*)
echo "SUFFIX wants empty string or '-devel'" >&2
@ -165,15 +137,12 @@ while getopts ${OPTS} OPT; do
if [ "${OPTARG}" = "yes" ]; then
export PRODUCT_UEFI=${OPTARG}
fi
SCRUB_ARGS=${SCRUB_ARGS};shift;shift
;;
v)
export PRODUCT_VERSION=${OPTARG}
SCRUB_ARGS=${SCRUB_ARGS};shift;shift
;;
V)
export PRODUCT_ADDITIONS=${OPTARG}
SCRUB_ARGS=${SCRUB_ARGS};shift;shift
;;
*)
echo "${0}: Unknown argument '${OPT}'" >&2
@ -182,6 +151,8 @@ while getopts ${OPTS} OPT; do
esac
done
shift $((${OPTIND} - 1))
if [ -z "${PRODUCT_NAME}" -o \
-z "${PRODUCT_TYPE}" -o \
-z "${PRODUCT_ARCH}" -o \

View File

@ -1,6 +1,6 @@
#!/bin/sh
# Copyright (c) 2014-2016 Franco Fichtner <franco@opnsense.org>
# Copyright (c) 2014-2017 Franco Fichtner <franco@opnsense.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@ -29,7 +29,7 @@ set -e
SELF=core
. ./common.sh && $(${SCRUB_ARGS})
. ./common.sh
check_packages ${SELF} ${@}
@ -40,7 +40,7 @@ setup_chroot ${STAGEDIR}
extract_packages ${STAGEDIR}
remove_packages ${STAGEDIR} ${@}
# register persistent packages to avoid bouncing
install_packages ${STAGEDIR} pkg git gettext-tools
install_packages ${STAGEDIR} pkg git
lock_packages ${STAGEDIR}
for BRANCH in master ${COREBRANCH}; do

View File

@ -29,7 +29,7 @@ set -e
SELF=distfiles
. ./common.sh && $(${SCRUB_ARGS})
. ./common.sh
PORTS_LIST=$(
cat ${CONFIGDIR}/skim.conf ${CONFIGDIR}/ports.conf | \

View File

@ -29,7 +29,7 @@ set -e
SELF=dvd
. ./common.sh && $(${SCRUB_ARGS})
. ./common.sh
check_images ${SELF} ${@}

View File

@ -1,6 +1,6 @@
#!/bin/sh
# Copyright (c) 2016 Franco Fichtner <franco@opnsense.org>
# Copyright (c) 2016-2017 Franco Fichtner <franco@opnsense.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@ -29,7 +29,7 @@ set -e
SELF=info
. ./common.sh && $(${SCRUB_ARGS})
. ./common.sh
TAGNAME=
if [ -n "${1}" ]; then

View File

@ -29,7 +29,7 @@ set -e
SELF=kernel
. ./common.sh && $(${SCRUB_ARGS})
. ./common.sh
KERNEL_SET=$(find ${SETSDIR} -name "kernel-*-${PRODUCT_ARCH}.txz")

View File

@ -1,6 +1,6 @@
#!/bin/sh
# Copyright (c) 2015-2016 Franco Fichtner <franco@opnsense.org>
# Copyright (c) 2015-2017 Franco Fichtner <franco@opnsense.org>
# Copyright (c) 2004-2009 Scott Ullrich <sullrich@gmail.com>
#
# Redistribution and use in source and binary forms, with or without
@ -30,7 +30,7 @@ set -e
SELF=nano
. ./common.sh && $(${SCRUB_ARGS})
. ./common.sh
check_images ${SELF} ${@}

View File

@ -29,7 +29,7 @@ set -e
SELF=plugins
. ./common.sh && $(${SCRUB_ARGS})
. ./common.sh
PLUGINS_LIST=$(
cat ${CONFIGDIR}/plugins.conf | while read PLUGIN_ORIGIN PLUGIN_IGNORE; do

View File

@ -29,7 +29,7 @@ set -e
SELF=ports
. ./common.sh && $(${SCRUB_ARGS})
. ./common.sh
PORTS_LIST=$(
cat ${CONFIGDIR}/ports.conf | while read PORT_ORIGIN PORT_IGNORE; do

View File

@ -29,7 +29,7 @@ set -e
SELF=prefetch
. ./common.sh && $(${SCRUB_ARGS})
. ./common.sh
# XXX does not adapt to FreeBSD version used
ABI="FreeBSD:11:${PRODUCT_ARCH}/${PRODUCT_SETTINGS}"

View File

@ -1,6 +1,6 @@
#!/bin/sh
# Copyright (c) 2016 Franco Fichtner <franco@opnsense.org>
# Copyright (c) 2016-2017 Franco Fichtner <franco@opnsense.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@ -29,7 +29,7 @@ set -e
SELF=print
. ./common.sh && $(${SCRUB_ARGS})
. ./common.sh
for ARG in ${@}; do
echo ${ARG}=\"$(printenv ${ARG})\"

View File

@ -1,6 +1,6 @@
#!/bin/sh
# Copyright (c) 2015 Franco Fichtner <franco@opnsense.org>
# Copyright (c) 2015-2017 Franco Fichtner <franco@opnsense.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@ -29,7 +29,7 @@ set -e
SELF=rebase
. ./common.sh && $(${SCRUB_ARGS})
. ./common.sh
BASE_OBSOLETE=$(find ${SETSDIR} -name "base-*-${PRODUCT_ARCH}.obsolete")
BASE_SET=$(find ${SETSDIR} -name "base-*-${PRODUCT_ARCH}.txz")

View File

@ -1,6 +1,6 @@
#!/bin/sh
# Copyright (c) 2015-2016 Franco Fichtner <franco@opnsense.org>
# Copyright (c) 2015-2017 Franco Fichtner <franco@opnsense.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@ -29,7 +29,7 @@ set -e
SELF=release
. ./common.sh && $(${SCRUB_ARGS})
. ./common.sh
RELEASE_SET="${SETSDIR}/release-${PRODUCT_VERSION}-${PRODUCT_FLAVOUR}-${PRODUCT_ARCH}.tar"

View File

@ -29,7 +29,7 @@ set -e
SELF=rename
. ./common.sh && $(${SCRUB_ARGS})
. ./common.sh
for ARG in ${@}; do
case ${ARG} in

View File

@ -1,6 +1,6 @@
#!/bin/sh
# Copyright (c) 2014-2016 Franco Fichtner <franco@opnsense.org>
# Copyright (c) 2014-2017 Franco Fichtner <franco@opnsense.org>
# Copyright (c) 2010-2011 Scott Ullrich <sullrich@gmail.com>
#
# Redistribution and use in source and binary forms, with or without
@ -30,7 +30,7 @@ set -e
SELF=serial
. ./common.sh && $(${SCRUB_ARGS})
. ./common.sh
check_images ${SELF} ${@}

View File

@ -1,6 +1,6 @@
#!/bin/sh
# Copyright (c) 2016 Franco Fichtner <franco@opnsense.org>
# Copyright (c) 2016-2017 Franco Fichtner <franco@opnsense.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@ -29,7 +29,7 @@ set -e
SELF=sign
. ./common.sh && $(${SCRUB_ARGS})
. ./common.sh
BASE_SET=$(find ${SETSDIR} -name "base-*-${PRODUCT_ARCH}.txz")
if [ -f "${BASE_SET}" ]; then

View File

@ -29,7 +29,7 @@ set -e
SELF=skim
. ./common.sh && $(${SCRUB_ARGS})
. ./common.sh
setup_stage ${STAGEDIR}

View File

@ -29,7 +29,7 @@ set -e
SELF=test
. ./common.sh && $(${SCRUB_ARGS})
. ./common.sh
git_branch ${COREDIR} ${COREBRANCH} COREBRANCH
git_branch ${PLUGINSDIR} ${PLUGINSBRANCH} PLUGINSBRANCH

View File

@ -29,7 +29,7 @@ set -e
SELF=update
. ./common.sh && $(${SCRUB_ARGS})
. ./common.sh
for ARG in ${@}; do
case ${ARG} in

View File

@ -29,7 +29,7 @@ set -e
SELF=verify
. ./common.sh && $(${SCRUB_ARGS})
. ./common.sh
setup_stage ${STAGEDIR}
setup_base ${STAGEDIR}

View File

@ -1,6 +1,6 @@
#!/bin/sh
# Copyright (c) 2014-2016 Franco Fichtner <franco@opnsense.org>
# Copyright (c) 2014-2017 Franco Fichtner <franco@opnsense.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@ -29,7 +29,7 @@ set -e
SELF=vga
. ./common.sh && $(${SCRUB_ARGS})
. ./common.sh
check_images ${SELF} ${@}

View File

@ -1,6 +1,6 @@
#!/bin/sh
# Copyright (c) 2016 Franco Fichtner <franco@opnsense.org>
# Copyright (c) 2016-2017 Franco Fichtner <franco@opnsense.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@ -29,7 +29,7 @@ set -e
SELF=vm
. ./common.sh && $(${SCRUB_ARGS})
. ./common.sh
check_images ${SELF} ${@}

View File

@ -29,7 +29,7 @@ set -e
SELF=xtools
. ./common.sh && $(${SCRUB_ARGS})
. ./common.sh
if [ ${PRODUCT_HOST} = ${PRODUCT_ARCH} ]; then
echo ">>> No need to build xtools on native build"