build: Allow delimiters other than newline in {AUX,PLUGINS,PORTS}LIST (#322)

Currently, when assigning multiple items to a LIST, the following works:
```
make ports PORTSLIST="port/a
port/b"
```
while the following would fail:
```
make ports PORTSLIST="port/a port/b"
```
This commit is contained in:
Johnny S. Lee 2022-10-18 20:37:57 +08:00 committed by GitHub
parent d69e616f07
commit 64e0e1b2f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 21 additions and 30 deletions

View File

@ -31,9 +31,7 @@ SELF=audit
. ./common.sh
if [ -z "${PORTSLIST}" ]; then
PORTSLIST=$(list_packages ${CONFIGDIR}/ports.conf)
fi
PORTSLIST=$(list_packages "${PORTSLIST}" ${CONFIGDIR}/ports.conf)
setup_stage ${STAGEDIR}
setup_base ${STAGEDIR}

View File

@ -1233,5 +1233,10 @@ list_packages()
{
local LIST_MATCH=1
list_config ${@}
if [ -n "${1}" ]; then
echo "${1}" | tr ',[:blank:]' '\n'
else
shift
list_config ${@}
fi
}

View File

@ -31,9 +31,7 @@ SELF=distfiles
. ./common.sh
if [ -z "${PORTSLIST}" ]; then
PORTSLIST=$(list_packages ${CONFIGDIR}/aux.conf ${CONFIGDIR}/ports.conf)
fi
PORTSLIST=$(list_packages "${PORTSLIST}" ${CONFIGDIR}/aux.conf ${CONFIGDIR}/ports.conf)
git_branch ${SRCDIR} ${SRCBRANCH} SRCBRANCH
git_branch ${PORTSDIR} ${PORTSBRANCH} PORTSBRANCH

View File

@ -31,9 +31,7 @@ SELF=options
. ./common.sh
if [ -z "${PORTSLIST}" ]; then
PORTSLIST=$(list_packages ${CONFIGDIR}/aux.conf ${CONFIGDIR}/ports.conf)
fi
PORTSLIST=$(list_packages "${PORTSLIST}" ${CONFIGDIR}/aux.conf ${CONFIGDIR}/ports.conf)
git_branch ${SRCDIR} ${SRCBRANCH} SRCBRANCH
git_branch ${PORTSDIR} ${PORTSBRANCH} PORTSBRANCH

View File

@ -36,16 +36,14 @@ if check_packages ${SELF} ${@}; then
exit 0
fi
if [ -z "${PLUGINSLIST}" ]; then
PLUGINSCONF=${CONFIGDIR}/plugins.conf
PLUGINSCONF=${CONFIGDIR}/plugins.conf
if [ -f ${PLUGINSCONF}.local ]; then
PLUGINSCONF="${PLUGINSCONF} ${PLUGINSCONF}.local"
fi
PLUGINSLIST=$(list_packages ${PLUGINSCONF})
if [ -f ${PLUGINSCONF}.local ]; then
PLUGINSCONF="${PLUGINSCONF} ${PLUGINSCONF}.local"
fi
PLUGINSLIST=$(list_packages "${PLUGINSLIST}" ${PLUGINSCONF})
git_branch ${PLUGINSDIR} ${PLUGINSBRANCH} PLUGINSBRANCH
setup_stage ${STAGEDIR}

View File

@ -56,12 +56,8 @@ if check_packages ${SELF} ${ARGS}; then
exit 0
fi
if [ -z "${PORTSLIST}" ]; then
PORTSLIST=$(list_packages ${CONFIGDIR}/ports.conf)
fi
if [ -z "${AUXLIST}" ]; then
AUXLIST=$(list_packages ${CONFIGDIR}/aux.conf)
fi
PORTSLIST=$(list_packages "${PORTSLIST}" ${CONFIGDIR}/ports.conf)
AUXLIST=$(list_packages "${AUXLIST}" ${CONFIGDIR}/aux.conf)
git_branch ${SRCDIR} ${SRCBRANCH} SRCBRANCH
git_branch ${PORTSDIR} ${PORTSBRANCH} PORTSBRANCH

View File

@ -58,16 +58,14 @@ make -C${COREDIR} ${COREENV} style
make -C${COREDIR} ${COREENV} test
EOF
if [ -z "${PLUGINSLIST}" ]; then
PLUGINSCONF=${CONFIGDIR}/plugins.conf
PLUGINSCONF=${CONFIGDIR}/plugins.conf
if [ -f ${PLUGINSCONF}.local ]; then
PLUGINSCONF="${PLUGINSCONF} ${PLUGINSCONF}.local"
fi
PLUGINSLIST=$(list_packages ${PLUGINSCONF})
if [ -f ${PLUGINSCONF}.local ]; then
PLUGINSCONF="${PLUGINSCONF} ${PLUGINSCONF}.local"
fi
PLUGINSLIST=$(list_packages "${PLUGINSLIST}" ${PLUGINSCONF})
for PLUGIN_ORIGIN in ${PLUGINSLIST}; do
VARIANT=${PLUGIN_ORIGIN##*@}
PLUGIN=${PLUGIN_ORIGIN%%@*}