From 86045b965e0b8439bc94d7af7c8bd5d1e6ea3fe2 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sat, 29 Oct 2011 20:37:28 +0200 Subject: makechrootpkg: Make host pubring.gpg available to check signed sources --- makechrootpkg.in | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/makechrootpkg.in b/makechrootpkg.in index 645992e..d182c46 100644 --- a/makechrootpkg.in +++ b/makechrootpkg.in @@ -173,11 +173,18 @@ mkdir -p "$copydir/build" # Remove anything in there UNLESS -R (repack) was passed to makepkg $repack || rm -rf "$copydir"/build/* -# Read .makepkg.conf even if called via sudo +# Read .makepkg.conf and .gnupg/pubring.gpg even if called via sudo if [[ -n $SUDO_USER ]]; then - makepkg_conf="$(eval echo ~$SUDO_USER)/.makepkg.conf" + SUDO_HOME="$(eval echo ~$SUDO_USER)" + makepkg_conf="$SUDO_HOME/.makepkg.conf" + if [[ -r "$SUDO_HOME/.gnupg/pubring.gpg" ]]; then + install -D "$SUDO_HOME/.gnupg/pubring.gpg" "$copydir/build/.gnupg/pubring.gpg" + fi else makepkg_conf="$HOME/.makepkg.conf" + if [[ -r "$HOME/.gnupg/pubring.gpg" ]]; then + install -D "$HOME/.gnupg/pubring.gpg" "$copydir/build/.gnupg/pubring.gpg" + fi fi # Get SRC/PKGDEST from makepkg.conf @@ -247,7 +254,10 @@ cp PKGBUILD "$copydir/build/" chown -R nobody "$copydir"/{build,pkgdest,srcdest} -echo 'nobody ALL = NOPASSWD: /usr/bin/pacman' > "$copydir/etc/sudoers.d/nobody-pacman" +cat > "$copydir/etc/sudoers.d/nobody-pacman" <