[devtools] makechrootpkg: keep *DEST, MAKEFLAGS & PACKAGER

Message ID 20190323142233.7113-1-anthraxx@archlinux.org
State Accepted
Headers show
Series
  • [devtools] makechrootpkg: keep *DEST, MAKEFLAGS & PACKAGER
Related show

Commit Message

Eli Schwartz via arch-projects March 23, 2019, 2:22 p.m. UTC
From: Matt Robinson <git@nerdoftheherd.com>

If makechrootpkg is called as non-root, the {SRC,SRCPKG,PKG,LOG}DEST,
MAKEFLAGS and PACKAGER environment variables are lost in the call to
check_root().

Add these to the passed keepenv list so that they are preserved instead.
---
 makechrootpkg.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/makechrootpkg.in b/makechrootpkg.in
index 4b72a36..dc647b3 100644
--- a/makechrootpkg.in
+++ b/makechrootpkg.in
@@ -341,7 +341,7 @@  main() {
 	[[ -n $makepkg_user && -z $(id -u "$makepkg_user") ]] && die 'Invalid makepkg user.'
 	makepkg_user=${makepkg_user:-${SUDO_USER:-$USER}}
 
-	check_root SOURCE_DATE_EPOCH,GNUPGHOME
+	check_root SOURCE_DATE_EPOCH,GNUPGHOME,SRCDEST,SRCPKGDEST,PKGDEST,LOGDEST,MAKEFLAGS,PACKAGER
 
 	# Canonicalize chrootdir, getting rid of trailing /
 	chrootdir=$(readlink -e "$passeddir")