Abort if expandPackagesToBeInstalled fails

Test: gd
This commit is contained in:
Michele Locati 2019-12-23 08:55:33 +01:00
parent a124af02a7
commit 58f33d2e90
No known key found for this signature in database
GPG Key ID: 98B7CE2E7234E28B

View File

@ -560,10 +560,19 @@ buildRequiredPackageLists() {
esac
if test -n "$buildRequiredPackageLists_persistent"; then
PACKAGES_PERSISTENT="$(expandPackagesToBeInstalled $buildRequiredPackageLists_persistent)"
if test -s "$IPE_ERRFILE"; then
cat "$IPE_ERRFILE" >&2
exit 1
fi
fi
if test -n "$buildRequiredPackageLists_volatile"; then
buildRequiredPackageLists_packages="$(expandPackagesToBeInstalled $buildRequiredPackageLists_volatile)"
if test -s "$IPE_ERRFILE"; then
cat "$IPE_ERRFILE" >&2
exit 1
fi
resetIFS
for buildRequiredPackageLists_package in $(expandPackagesToBeInstalled $buildRequiredPackageLists_volatile); do
for buildRequiredPackageLists_package in $buildRequiredPackageLists_packages; do
if ! stringInList "$buildRequiredPackageLists_package" "$PACKAGES_PERSISTENT"; then
PACKAGES_VOLATILE="$PACKAGES_VOLATILE $buildRequiredPackageLists_package"
fi
@ -585,9 +594,9 @@ expandPackagesToBeInstalled() {
alpine)
expandPackagesToBeInstalled_log="$(apk add --simulate $@ 2>&1 || printf '\nERROR: apk failed\n')"
if test -n "$(printf '%s' "$expandPackagesToBeInstalled_log" | grep -E '^ERROR:')"; then
printf 'FAILED TO LIST THE WHOLE PACKAGE LIST FOR\n' >&2
printf '%s ' "$@" >&2
printf '\n\nCOMMAND OUTPUT:\n%s\n' "$expandPackagesToBeInstalled_log" >&2
printf 'FAILED TO LIST THE WHOLE PACKAGE LIST FOR\n' >"$IPE_ERRFILE"
printf '%s ' "$@" >>"$IPE_ERRFILE"
printf '\n\nCOMMAND OUTPUT:\n%s\n' "$expandPackagesToBeInstalled_log" >>"$IPE_ERRFILE"
exit 1
fi
IFS='
@ -602,9 +611,9 @@ expandPackagesToBeInstalled() {
debian)
expandPackagesToBeInstalled_log="$(DEBIAN_FRONTEND=noninteractive apt-get install -sy $@ 2>&1 || printf '\nE: apt-get failed\n')"
if test -n "$(printf '%s' "$expandPackagesToBeInstalled_log" | grep -E '^E:')"; then
printf 'FAILED TO LIST THE WHOLE PACKAGE LIST FOR\n' >&2
printf '%s ' "$@" >&2
printf '\n\nCOMMAND OUTPUT:\n%s\n' "$expandPackagesToBeInstalled_log" >&2
printf 'FAILED TO LIST THE WHOLE PACKAGE LIST FOR\n' >"$IPE_ERRFILE"
printf '%s ' "$@" >"$IPE_ERRFILE"
printf '\n\nCOMMAND OUTPUT:\n%s\n' "$expandPackagesToBeInstalled_log" >"$IPE_ERRFILE"
exit 1
fi
expandPackagesToBeInstalled_inNewPackages=0
@ -1120,6 +1129,8 @@ cleanup() {
}
resetIFS
mkdir -p /tmp/src
IPE_ERRFILE="$(mktemp -p /tmp/src)"
PHP_MAJMIN_VERSION=$(getPHPMajorMinor)
case "$PHP_MAJMIN_VERSION" in
506 | 700 | 701 | 702 | 703 | 704) ;;