abuild: ensure a package has deps before printing them
After the first dep is printed, `shift` is called to avoid the special case where the first dep cannot have a comma prepended. However, if there are no deps for a package (seen early on in the aports main repo in acf-jquery), $# is 0. POSIX specifies that `shift` has two options when the shift operand (1) is greater than $#: - if non-interactive, it can exit the shell - if it does not exit the shell, it must return a non-zero exit code Since we run the shell with -e, the second case folds in to the first. BusyBox ash does not implement this behaviour, but bash does when called as /bin/sh or when the `posix` shopt is set.
This commit is contained in:
parent
2b709f7e20
commit
f1faef7868
|
@ -1838,6 +1838,10 @@ parse_aports_makedepends() {
|
||||||
for j in $pkgname $subpackages; do
|
for j in $pkgname $subpackages; do
|
||||||
echo "o ${j%%:*} $dir"
|
echo "o ${j%%:*} $dir"
|
||||||
set -- $deps
|
set -- $deps
|
||||||
|
if [ $# -eq 0 ]; then
|
||||||
|
echo "d ${j%%:*}"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
echo -n "d ${j%%:*} $1"
|
echo -n "d ${j%%:*} $1"
|
||||||
shift
|
shift
|
||||||
while [ $# -gt 0 ]; do
|
while [ $# -gt 0 ]; do
|
||||||
|
|
Loading…
Reference in New Issue