commit: ffd68477e5c1e1badf60c86ae221c90dad50390d
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 1 06:12:41 2018 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Feb 1 06:12:41 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=ffd68477
emerge-webrsync: uses gpg --status-fd
bin/emerge-webrsync | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index 9961ad815..560dd0236 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -175,13 +175,22 @@ check_file_signature() {
local signature="$1"
local file="$2"
local r=1
+ local gnupg_status line
if [ ${WEBSYNC_VERIFY_SIGNATURE} != 0 ]; then
__vecho "Checking signature ..."
if type -P gpg > /dev/null; then
- gpg --homedir "${PORTAGE_GPG_DIR}" --verify
"$signature" "$file" && r=0
+ if gnupg_status=$(gpg --homedir "${PORTAGE_GPG_DIR}"
--batch \
+ --status-fd 1 --verify "${signature}"
"${file}"); then
+ while read -r line; do
+ if [[ ${line} == "[GNUPG:] GOODSIG"*
]]; then
+ r=0
+ break
+ fi
+ done <<< "${gnupg_status}"
+ fi
else
eecho "cannot check signature: gpg binary not found"
exit 1