[pacman-dev,v2,2/2] makepkg: fix broken check for the fakeroot binary

Message ID 20181114015548.20360-2-eschwartz@archlinux.org
State New
Headers show
Series
  • [pacman-dev,v2,1/2] makepkg: add internal variable to track when we're building a package
Related show

Commit Message

Eli Schwartz Nov. 14, 2018, 1:55 a.m. UTC
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 checking to see if we are trying to build either a package or a
source package, and if so, checking for fakeroot. These are the only two
situations where fakeroot is needed.

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
---

v2: add check to see if we need fakeroot

 scripts/makepkg.sh.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index be8b761e..21d59814 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -993,7 +993,7 @@  check_software() {
 	fi
 
 	# fakeroot - correct package file permissions
-	if check_buildenv "fakeroot" "y" && (( EUID > 0 )); then
+	if (( SOURCEONLY || BUILDPKG )); then
 		if ! type -p fakeroot >/dev/null; then
 			error "$(gettext "Cannot find the %s binary.")" "fakeroot"
 			ret=1