@@ -28,6 +28,7 @@ usage() {
28
28
-o, --offload Use offloaded builds
29
29
-h, --help Show this help text
30
30
-d, --dry-run Show the offload-build and commitpkg being ran
31
+ --import-keys Import PGP keys for packages source verification into the user's keyring
31
32
--no-build Don't build PKGBUILD
32
33
--no-publish Don't run commitpkg after building
33
34
--no-bump Don't bump pkgrel before building (default bumps pkgrel)
@@ -63,6 +64,7 @@ STDIN=0
63
64
NO_BUMP=0
64
65
NO_BUILD=0
65
66
PACKAGES=0
67
+ IMPORT_KEYS=0
66
68
NO_PUBLISH=0
67
69
EDIT_PKGBUILD=0
68
70
CONTINUE=0
@@ -112,6 +114,9 @@ while ((${#})); do
112
114
-d|--dry-run)
113
115
DRY=1
114
116
;;
117
+ --import-keys)
118
+ IMPORT_KEYS=1
119
+ ;;
115
120
--testing|--staging)
116
121
REPO=" $key "
117
122
;;
@@ -219,6 +224,22 @@ read <&1
219
224
220
225
pkgctl repo clone " ${packages[@]} "
221
226
227
+ if (( IMPORT_KEYS)) ; then
228
+ echo " Importing PGP keys..."
229
+ # Only add paths that actually have key(s) to import and ignore paths that don't, don't exit on error
230
+ mapfile -d ' ' key_paths < <( find " ${packages[@]/%// keys/ pgp} " -type f -print0 2> /dev/null) || true
231
+
232
+ if (( ${# key_paths[@]} )) ; then
233
+ cat " ${key_paths[@]} " | if [[ -z " $OFFLOAD " ]]; then
234
+ gpg --import
235
+ else
236
+ ssh build.archlinux.org gpg --import
237
+ fi
238
+ else
239
+ echo " No PGP key to import"
240
+ fi
241
+ fi
242
+
222
243
for pkg in " ${packages[@]} " ; do
223
244
pushd " $pkg " & > /dev/null
224
245
0 commit comments