Skip to content

Commit 8e9b157

Browse files
committed
pacman-helper: be prepared to initialize the aarch64 Pacman repository
We do not have any official packages in Git for Windows targeting Windows/ARM64 yet. But this is about to change. This commit is best viewed with `-w`. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent f020553 commit 8e9b157

File tree

1 file changed

+25
-9
lines changed

1 file changed

+25
-9
lines changed

pacman-helper.sh

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,11 @@ quick_add () { # <file>...
604604
eval "mingw=\$${arch}_mingw"
605605
test -n "$msys$mingw" || continue
606606
607+
case "$(test aarch64 = $arch && curl -sI "$(arch_url $arch)/git-for-windows.db")" in
608+
*404*) initialize_fresh_pacman_repository=t;; # this one is new
609+
*) initialize_fresh_pacman_repository=;;
610+
esac
611+
607612
case "$arch,$mingw" in
608613
*,) db2=;;
609614
i686,*) db2=mingw32;;
@@ -615,20 +620,31 @@ quick_add () { # <file>...
615620
for infix in db files
616621
do
617622
file=$db.$infix.tar.xz
618-
echo "Downloading current $arch/$file..." >&2
619-
curl -sfo "$dir/$arch/$file" "$(arch_url $arch)/$file" || return 1
623+
if test -n "$initialize_fresh_pacman_repository"
624+
then
625+
echo "Will initialize new $arch/$file..." >&2
626+
else
627+
echo "Downloading current $arch/$file..." >&2
628+
curl -sfo "$dir/$arch/$file" "$(arch_url $arch)/$file" || return 1
629+
fi
620630
dbs="$dbs $arch/$file $arch/${file%.tar.xz}"
621631
if test -n "$sign_option"
622632
then
623-
curl -sfo "$dir/$arch/$file.sig" "$(arch_url $arch)/$file.sig" ||
624-
return 1
625-
gpg --verify "$dir/$arch/$file.sig" ||
626-
die "Could not verify GPG signature: $dir/$arch/$file"
633+
if test -z "$initialize_fresh_pacman_repository"
634+
then
635+
curl -sfo "$dir/$arch/$file.sig" "$(arch_url $arch)/$file.sig" ||
636+
return 1
637+
gpg --verify "$dir/$arch/$file.sig" ||
638+
die "Could not verify GPG signature: $dir/$arch/$file"
639+
fi
627640
dbs="$dbs $arch/$file.sig $arch/${file%.tar.xz}.sig"
628641
fi
629-
sanitize_db "$dir/$arch/$file" || return 1
630-
test ! -f "$dir/$arch/${file%.tar.xz}" ||
631-
sanitize_db "$dir/$arch/${file%.tar.xz}" || return 1
642+
if test -z "$initialize_fresh_pacman_repository"
643+
then
644+
sanitize_db "$dir/$arch/$file" || return 1
645+
test ! -f "$dir/$arch/${file%.tar.xz}" ||
646+
sanitize_db "$dir/$arch/${file%.tar.xz}" || return 1
647+
fi
632648
done
633649
done
634650
(cd "$dir/$arch" &&

0 commit comments

Comments
 (0)