makechrootpkg: with -n, check if the package failed to install

We previously whitelisted this return code because split packages can
frequently conflict each other, so makepkg -i is *expected* to fail in
such a case. However, there is no good reason to let this succeed if the
pkgbase only builds one pkgname -- that will always be a severe issue.

Add a check for how many split

Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
This commit is contained in:
Eli Schwartz 2019-08-08 19:58:23 -04:00 committed by Levente Polyak
parent 7b0a11677a
commit be44b9cde1
No known key found for this signature in database
GPG Key ID: FC1B547C8D8172C8
1 changed files with 8 additions and 1 deletions

View File

@ -232,8 +232,15 @@ _chrootbuild() {
sudo --preserve-env=SOURCE_DATE_EPOCH -iu builduser bash -c 'cd /startdir; makepkg "$@"' -bash "$@"
ret=$?
case $ret in
0|14)
0)
return 0;;
14)
# whitelist "The package failed to install." but only if there are multiple split packages
# in which case they might be conflicting
local pkgfiles=(/pkgdest/*.pkg.tar.xz)
(( ${#pkgfiles[@]} > 1))
return $?;;
*)
return $ret;;
esac