From 39a3a48a18c236dd7fd28f3e171b8452e726d5b0 Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Sun, 29 Nov 2015 14:02:50 -0800 Subject: [PATCH] enter_chroot: add support for passing through GNUPGHOME When running under jenkins the $GNUPGHOME may be located under the current build directory instead of $HOME to avoid conflicting with other jobs on the same build host. --- common.sh | 1 + sdk_lib/enter_chroot.sh | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/common.sh b/common.sh index a097c47ef1..3e101a41c7 100644 --- a/common.sh +++ b/common.sh @@ -231,6 +231,7 @@ load_environment_whitelist() { GIT_PROXY_COMMAND GIT_SSH RSYNC_PROXY + GNUPGHOME GPG_AGENT_INFO SSH_AGENT_PID SSH_AUTH_SOCK diff --git a/sdk_lib/enter_chroot.sh b/sdk_lib/enter_chroot.sh index 236a0beb86..bf4cf842f3 100755 --- a/sdk_lib/enter_chroot.sh +++ b/sdk_lib/enter_chroot.sh @@ -293,9 +293,10 @@ setup_env() { fi # Mount GnuPG's data directory for signing uploads - if [[ -d "$SUDO_HOME/.gnupg" ]]; then + : ${GNUPGHOME:="$SUDO_HOME/.gnupg"} + if [[ -d "${GNUPGHOME}" ]]; then debug "Mounting GnuPG" - setup_mount "${SUDO_HOME}/.gnupg" "--bind" "/home/${SUDO_USER}/.gnupg" + setup_mount "${GNUPGHOME}" "--bind" "${GNUPGHOME}" # bind mount the gpg agent dir if available GPG_AGENT_DIR="${GPG_AGENT_INFO%/*}"