summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2018-08-14 03:20:58 +0200
committerAllan McRae <allan@archlinux.org>2018-08-29 06:58:32 +0200
commit16f6aae33087ec04c1dc90aa84f7d3dde4333046 (patch)
treea776574440a883155b1401aaaebb2e8759e871a3 /scripts
parent48c8f9f2a24632dabe5b1c74a474e3940ddd8748 (diff)
downloadpacman-16f6aae33087ec04c1dc90aa84f7d3dde4333046.tar.gz
pacman-16f6aae33087ec04c1dc90aa84f7d3dde4333046.tar.xz
makepkg: fix pkgver() function not aborting on errors
`run_function_safe pkgver` is evaluated in a subshell and therefore does not abort when it should. Explicitly check the return outside of the subshell and abort if necessary. Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/makepkg.sh.in3
1 files changed, 3 insertions, 0 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 76b9322a..4e8f9dc3 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -188,6 +188,9 @@ enter_fakeroot() {
# Re-sources the PKGBUILD afterwards to allow for other variables that use $pkgver
update_pkgver() {
newpkgver=$(run_function_safe pkgver)
+ if (( $? != 0 )); then
+ error_function pkgver
+ fi
if ! check_pkgver "$newpkgver"; then
error "$(gettext "pkgver() generated an invalid version: %s")" "$newpkgver"
exit $E_PKGBUILD_ERROR