Gentoo Archives: gentoo-commits

From: "Robin H. Johnson" <robbat2@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/qa-scripts:master commit in: /
Date: Tue, 09 Apr 2019 05:22:50
Message-Id: 1554787351.ba4f3b35b91889df2508a203d70d204151f1bd6f.robbat2@gentoo
1 commit: ba4f3b35b91889df2508a203d70d204151f1bd6f
2 Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
3 AuthorDate: Tue Apr 9 05:22:31 2019 +0000
4 Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
5 CommitDate: Tue Apr 9 05:22:31 2019 +0000
6 URL: https://gitweb.gentoo.org/proj/qa-scripts.git/commit/?id=ba4f3b35
7
8 create-dev-keyrings.bash: push keys back to keys.gentoo.org
9
10 Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
11
12 create-dev-keyrings.bash | 23 ++++++++++++++++++-----
13 1 file changed, 18 insertions(+), 5 deletions(-)
14
15 diff --git a/create-dev-keyrings.bash b/create-dev-keyrings.bash
16 index 8e581b4..704e409 100755
17 --- a/create-dev-keyrings.bash
18 +++ b/create-dev-keyrings.bash
19 @@ -9,6 +9,10 @@ COMMIT_RULE='(&(gentooAccess=git.gentoo.org/repo/gentoo.git)(gentooStatus=active
20 NONCOMMIT_RULE='(&(!(gentooAccess=git.gentoo.org/repo/gentoo.git))(gentooStatus=active))'
21 RETIRED_RULE='(!(gentooStatus=active))'
22
23 +# this needs to move to HKPS as well, but that part is not yet deployed.
24 +KS_GENTOO=hkp://keys.gentoo.org/
25 +KS_SKS=hkps://hkps.pool.sks-keyservers.net/
26 +
27 GPG_TMPDIR=$(mktemp -d)
28 clean_tmp() {
29 rm -rf "$GPG_TMPDIR"
30 @@ -28,12 +32,9 @@ grab_keys() {
31 local missing=()
32 local remaining=( "${@}" )
33
34 - # this needs to move to HKPS as well, but that part is not yet deployed.
35 - KS1=hkp://keys.gentoo.org/
36 - KS2=hkps://hkps.pool.sks-keyservers.net/
37 while :; do
38 - timeout 5m gpg --keyserver $KS1 -q --recv-keys "${remaining[@]}" || :
39 - timeout 20m gpg --keyserver $KS2 -q --recv-keys "${remaining[@]}" || :
40 + timeout 5m gpg --keyserver $KS_GENTOO -q --recv-keys "${remaining[@]}" || :
41 + timeout 20m gpg --keyserver $KS_SKS -q --recv-keys "${remaining[@]}" || :
42 missing=()
43 for key in "${remaining[@]}"; do
44 gpg --list-public "${key}" &>/dev/null || missing+=( "${key}" )
45 @@ -55,6 +56,12 @@ grab_keys() {
46 done
47 }
48
49 +# push_keys <fingerprint>...
50 +push_keys() {
51 + timeout 5m gpg --keyserver $KS_GENTOO -q --send-keys "${remaining[@]}" || :
52 + #timeout 5m gpg --keyserver $KS_SKS -q --send-keys "${remaining[@]}" || :
53 +}
54 +
55 export_keys() {
56 DST="$1"
57 TMP="${GPG_TMPDIR}"/$(basename "${DST}")
58 @@ -105,3 +112,9 @@ export_keys "${OUTPUT_DIR}"/all-devs.gpg \
59 "${COMMITTING_DEVS[@]}" \
60 "${NONCOMMITTING_DEVS[@]}" \
61 "${RETIRED_DEVS[@]}"
62 +
63 +# Populate keys.gentoo.org with the keys we have, since they might have come from SKS
64 +push_keys "${SYSTEM_KEYS[@]}"
65 +push_keys "${COMMITTING_DEVS[@]}"
66 +push_keys "${NONCOMMITTING_DEVS[@]}"
67 +push_keys "${RETIRED_DEVS[@]}"