From d00a28ea0ed981d47634504c3eb67c5b8870bc62 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Tue, 29 Mar 2022 19:36:16 +1000 Subject: 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 Signed-off-by: Levente Polyak --- commitpkg.in | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'commitpkg.in') 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 -- cgit v1.2.3-54-g00ecf