diff options
author | Allan McRae <allan@archlinux.org> | 2022-03-29 19:36:16 +1000 |
---|---|---|
committer | Levente Polyak <anthraxx@archlinux.org> | 2022-06-09 20:41:18 +0200 |
commit | d00a28ea0ed981d47634504c3eb67c5b8870bc62 (patch) | |
tree | 9109795ee372700d48450a2c49ba3e1501511f77 /commitpkg.in | |
parent | 5e98478344fbdecd5f07eb92ef92ee43bc66e1a9 (diff) | |
download | devtools-d00a28ea0ed981d47634504c3eb67c5b8870bc62.tar.xz |
Export source PGPs from PKGBUILD on commit
Provide a tool to export keys listed in the PKGBUILDs validpgpkeys to
keys/pgp/$fingerprint.asc.
The presense of the "keys" directory alongside the PKGBUILD in trunk/
is tested during commitpkg. If the directory is abscent, keys are
exported and added to the commit. If the directory is present, a
check is made to ensure all valid PGP keys are provided.
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
Diffstat (limited to 'commitpkg.in')
-rw-r--r-- | commitpkg.in | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/commitpkg.in b/commitpkg.in index 928e638..e0da32d 100644 --- a/commitpkg.in +++ b/commitpkg.in @@ -48,6 +48,21 @@ case "$cmd" in ;; esac + +if (( ${#validpgpkeys[@]} != 0 )); then + if [[ -d keys ]]; then + for key in "${validpgpkeys[@]}"; do + if [[ ! -f keys/pgp/$key.asc ]]; then + export-pkgbuild-keys || die 'Failed to export valid PGP keys for source files' + fi + done + else + export-pkgbuild-keys || die 'Failed to export valid PGP keys for source files' + fi + + svn add --parents --force keys/pgp/* +fi + # find files which should be under source control needsversioning=() for s in "${source[@]}"; do @@ -60,6 +75,9 @@ for i in 'changelog' 'install'; do needsversioning+=("$file") done < <(sed -n "s/^[[:space:]]*$i=//p" PKGBUILD) done +for key in "${validpgpkeys[@]}"; do + needsversioning+=("keys/pgp/$key.asc") +done # assert that they really are controlled by SVN if (( ${#needsversioning[*]} )); then |