From d8a006b4f28917c7e675d2eeea5c925a5171e334 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 13 Jan 2020 09:18:29 +0100 Subject: update-keys: make local gpg and gpg on buildmaster silent, too, ane more importantly: not swallow input --- update-keys | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/update-keys b/update-keys index ca68887..5c7592a 100755 --- a/update-keys +++ b/update-keys @@ -6,7 +6,8 @@ TMPDIR=$(mktemp -d) trap "rm -rf '${TMPDIR}'" EXIT KEYSERVER='hkp://keys.gnupg.net' -GPG="gpg --quiet --batch --no-tty --no-permission-warning --keyserver "${KEYSERVER}" --homedir ${TMPDIR}" +GPG_OPTIONS='--quiet --batch --no-tty --no-permission-warning' +GPG="gpg ${GPG_OPTIONS} --keyserver "${KEYSERVER}" --homedir ${TMPDIR}" pushd "$(dirname "$0")" >/dev/null @@ -31,8 +32,8 @@ while read -ra data; do keyid="${data[0]}" username="${data[@]:1}" ${GPG} --recv-keys ${keyid} &>/dev/null - gpg -a --export ${keyid} | ${GPG} --import &>/dev/null - ssh buildmaster "gpg -a --export ${keyid}" | ${GPG} --import &>/dev/null + gpg ${GPG_OPTIONS} -a --export ${keyid} /dev/null + ssh buildmaster "gpg ${GPG_OPTIONS} -a --export ${keyid}" /dev/null printf 'minimize\nquit\ny\n' | \ ${GPG} --command-fd 0 --edit-key ${keyid} ${GPG} --yes --lsign-key ${keyid} &>/dev/null @@ -44,8 +45,8 @@ ${GPG} --import-ownertrust < archlinux32-trusted 2>/dev/null while read -ra data; do keyid="${data[0]}" ${GPG} --recv-keys ${keyid} &>/dev/null - gpg -a --export ${keyid} | ${GPG} --import &>/dev/null - ssh buildmaster "gpg -a --export ${keyid}" | ${GPG} --import &>/dev/null + gpg ${GPG_OPTIONS} -a --export ${keyid} | ${GPG} --import &>/dev/null + ssh buildmaster "gpg ${GPG_OPTIONS} -a --export ${keyid}" | ${GPG} --import &>/dev/null done < packager-keyids while read -ra data; do keyid="${data[0]}" @@ -65,8 +66,8 @@ while read -ra data; do keyid="${data[0]}" username="${data[2]}" ${GPG} --recv-keys ${keyid} &>/dev/null - gpg -a --export ${keyid} | ${GPG} --import &>/dev/null - ssh buildmaster "gpg -a --export ${keyid}" | ${GPG} --import &>/dev/null + gpg ${GPG_OPTIONS} -a --export ${keyid} | ${GPG} --import &>/dev/null + ssh buildmaster "gpg ${GPG_OPTIONS} -a --export ${keyid}" | ${GPG} --import &>/dev/null printf 'clean\nquit\ny\n' | \ ${GPG} --command-fd 0 --edit-key ${keyid} if ! ${GPG} --list-keys --with-colons ${keyid} 2>/dev/null | grep -q '^pub:f:'; then @@ -81,8 +82,8 @@ while read -ra data; do keyid="${data[0]}" username="${data[2]}" ${GPG} --recv-keys ${keyid} &>/dev/null - gpg -a --export ${keyid} | ${GPG} --import &>/dev/null - ssh buildmaster "gpg -a --export ${keyid}" | ${GPG} --import &>/dev/null + gpg ${GPG_OPTIONS} -a --export ${keyid} | ${GPG} --import &>/dev/null + ssh buildmaster "gpg ${GPG_OPTIONS} -a --export ${keyid}" | ${GPG} --import &>/dev/null printf 'clean\nquit\ny\n' | \ ${GPG} --command-fd 0 --edit-key ${keyid} if ! ${GPG} --list-keys --with-colons ${keyid} 2>/dev/null | grep -q '^pub:f:'; then -- cgit v1.2.3-70-g09d2