@@ -16,7 +16,7 @@ BUILDDIRECTORY=/var/lib/repro
16
16
KEYRINGCACHE=" ${BUILDDIRECTORY} /keyring"
17
17
18
18
BOOTSTRAPMIRROR=" https://geo.mirror.pkgbuild.com/iso/latest"
19
- readonly bootstrap_img =archlinux-bootstrap-" $( uname -m) " .tar.gz
19
+ BOOTSTRAP_IMG =archlinux-bootstrap-" $( uname -m) " .tar
20
20
CONFIGDIR=' REPRO_CONFIG_DIR'
21
21
22
22
HOSTMIRROR=" https://geo.mirror.pkgbuild.com/\$ repo/os/\$ arch"
@@ -283,7 +283,21 @@ function init_chroot(){
283
283
# - with empty directory in the follow-up lock - if using test/mkdir/lock
284
284
lock 9 " $BUILDDIRECTORY " /root.lock
285
285
if [ ! -d " $BUILDDIRECTORY " /root ]; then
286
- get_bootstrap_img
286
+ init_gnupg
287
+
288
+ if ! compgen -G " $IMGDIRECTORY /$bootstrap_img " * > /dev/null; then
289
+ msg " Downloading bootstrap image..."
290
+
291
+ for ext in zst gz; do
292
+ bootstrap_img=" $BOOTSTRAP_IMG .$ext "
293
+ ( cd " $IMGDIRECTORY " && curl -f --remote-name-all " $BOOTSTRAPMIRROR /$bootstrap_img " {,.sig} )
294
+ if ! gpg --verify " $IMGDIRECTORY /$bootstrap_img .sig" " $IMGDIRECTORY /$bootstrap_img " ; then
295
+ error " Can't verify image"
296
+ exit 1
297
+ fi
298
+ break
299
+ done
300
+ fi
287
301
288
302
msg " Preparing chroot"
289
303
trap ' { cleanup_root_volume; exit 1; }' ERR
@@ -555,20 +569,6 @@ __END__
555
569
fi
556
570
}
557
571
558
- # Desc: Fetches a bootstrap image and verifies the signature
559
- function get_bootstrap_img() {
560
- init_gnupg
561
-
562
- if [ ! -e " $IMGDIRECTORY /$bootstrap_img " ]; then
563
- msg " Downloading bootstrap image..."
564
- ( cd " $IMGDIRECTORY " && curl -f --remote-name-all " $BOOTSTRAPMIRROR /$bootstrap_img " {,.sig} )
565
- if ! gpg --verify " $IMGDIRECTORY /$bootstrap_img .sig" " $IMGDIRECTORY /$bootstrap_img " ; then
566
- error " Can't verify image"
567
- exit 1
568
- fi
569
- fi
570
- }
571
-
572
572
# Desc: Prints the help section
573
573
function print_help() {
574
574
cat << __END__
0 commit comments