Gentoo Archives: gentoo-commits

From: Zac Medico <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: bin/
Date: Thu, 01 Feb 2018 06:18:26
Message-Id: 1517465561.ffd68477e5c1e1badf60c86ae221c90dad50390d.zmedico@gentoo
1 commit: ffd68477e5c1e1badf60c86ae221c90dad50390d
2 Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
3 AuthorDate: Thu Feb 1 06:12:41 2018 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Thu Feb 1 06:12:41 2018 +0000
6 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=ffd68477
7
8 emerge-webrsync: uses gpg --status-fd
9
10 bin/emerge-webrsync | 11 ++++++++++-
11 1 file changed, 10 insertions(+), 1 deletion(-)
12
13 diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
14 index 9961ad815..560dd0236 100755
15 --- a/bin/emerge-webrsync
16 +++ b/bin/emerge-webrsync
17 @@ -175,13 +175,22 @@ check_file_signature() {
18 local signature="$1"
19 local file="$2"
20 local r=1
21 + local gnupg_status line
22
23 if [ ${WEBSYNC_VERIFY_SIGNATURE} != 0 ]; then
24
25 __vecho "Checking signature ..."
26
27 if type -P gpg > /dev/null; then
28 - gpg --homedir "${PORTAGE_GPG_DIR}" --verify "$signature" "$file" && r=0
29 + if gnupg_status=$(gpg --homedir "${PORTAGE_GPG_DIR}" --batch \
30 + --status-fd 1 --verify "${signature}" "${file}"); then
31 + while read -r line; do
32 + if [[ ${line} == "[GNUPG:] GOODSIG"* ]]; then
33 + r=0
34 + break
35 + fi
36 + done <<< "${gnupg_status}"
37 + fi
38 else
39 eecho "cannot check signature: gpg binary not found"
40 exit 1