makechrootpkg: respect GNUPGHOME

Previously, makechrootpkg hardcoded ~/.gnupg. Therefore, if a user
uses a custom GPG home directory, the siganture checking would fail.
Now makechrootpkg uses $GNUPGHOME, with a fallback to ~/.gnupg.

Signed-off-by: Emiel Wiedijk <me@aimileus.nl>
This commit is contained in:
Emiel Wiedijk 2018-02-27 11:16:24 -05:00 committed by Bartłomiej Piotrowski
parent ab3368f061
commit ffb5003fda
1 changed files with 3 additions and 2 deletions

View File

@ -252,7 +252,8 @@ download_sources() {
chmod 1777 "$builddir"
# Ensure sources are downloaded
sudo -u "$makepkg_user" env SRCDEST="$SRCDEST" BUILDDIR="$builddir" \
sudo -u "$makepkg_user" --preserve-env=GNUPGHOME \
env SRCDEST="$SRCDEST" BUILDDIR="$builddir" \
makepkg --config="$copydir/etc/makepkg.conf" --verifysource -o ||
die "Could not download sources."
@ -341,7 +342,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
check_root SOURCE_DATE_EPOCH,GNUPGHOME
# Canonicalize chrootdir, getting rid of trailing /
chrootdir=$(readlink -e "$passeddir")