[pacman-dev] [PATCH] makepkg: fix broken check for the fakeroot binary

Eli Schwartz eschwartz at archlinux.org
Mon Nov 5 00:06:13 UTC 2018


In commit d8ee8d0c99c3820951e2e49dbdb71a5390bd1dc4 we made use of
fakeroot absolutely mandatory, and disabled a lot of the code which
checked to see if this now-defunct BUILDENV option was set, before
setting up the environment to use fakeroot. Unfortunately, we missed one
spot.

The check_software routine still checked to see if fakeroot was
enabled, but due to the option being removed, thought that it was in
fact disabled, and as a result this check would never run.

Fix by unconditionally checking for the fakeroot binary. While in
theory, users could be using --verifysource or --packagelist or
--printsrcinfo without, strictly speaking, needing fakeroot, they are
sure to be building the software too, anyway, so this use case is not
one we need to support.

Signed-off-by: Eli Schwartz <eschwartz at archlinux.org>
---
 scripts/makepkg.sh.in | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 8b39ca9a..db71d044 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1000,11 +1000,9 @@ check_software() {
 	fi
 
 	# fakeroot - correct package file permissions
-	if check_buildenv "fakeroot" "y" && (( EUID > 0 )); then
-		if ! type -p fakeroot >/dev/null; then
-			error "$(gettext "Cannot find the %s binary.")" "fakeroot"
-			ret=1
-		fi
+	if ! type -p fakeroot >/dev/null; then
+		error "$(gettext "Cannot find the %s binary.")" "fakeroot"
+		ret=1
 	fi
 
 	# gpg - package signing
-- 
2.19.1


More information about the pacman-dev mailing list