Browse Source

bin/build-packages: download /some/ key from github

Erich Eckner 4 months ago
parent
commit
f103d6fd98
1 changed files with 13 additions and 1 deletions
  1. 13
    1
      bin/build-packages

+ 13
- 1
bin/build-packages View File

@@ -863,7 +863,19 @@ while [ "${count}" -ne 0 ] && \
863 863
           ' {} \; | \
864 864
           xargs -rn1 gpg --recv-keys || \
865 865
           true
866
-          # TODO: maybe, we want to auto-receive keys from github here, too?
866
+        if grep -q ' FAILED (unknown public key \([0-9A-F]\{16\}\))'; then
867
+          # download the repository key from github
868
+          # TODO: get the name of the key file from its finger print or
869
+          # some other information inside the repository
870
+          makepkg --printsrcinfo | \
871
+            sed -n '
872
+              s,^\ssource = git+\(https://github\.com/[^/[:space:]]\+\)/[^/]*$,\1.gpg,
873
+              T
874
+              p
875
+            ' | \
876
+            xargs -rn1 curl -s | \
877
+            gpg --import || true
878
+        fi
867 879
       done
868 880
 
869 881
       if ! ${success}; then