@@ -61,7 +61,7 @@ this_script_dir="$(cygpath -am "${0%/*}")"
61
61
base_url=https://wingit.blob.core.windows.net
62
62
mirror=/var/local/pacman-mirror
63
63
64
- architectures=" i686 x86_64"
64
+ architectures=" i686 x86_64 aarch64 "
65
65
66
66
arch_dir () { # <architecture>
67
67
echo " $mirror /$1 "
@@ -71,6 +71,7 @@ map_arch () { # <architecture>
71
71
# Azure Blobs does not allow underlines, but dashes in container names
72
72
case " $1 " in
73
73
x86_64) echo " x86-64" ;;
74
+ clang-aarch64) echo " aarch64" ;;
74
75
* ) echo " $1 " ;;
75
76
esac
76
77
}
@@ -80,12 +81,11 @@ arch_url () { # <architecture>
80
81
}
81
82
82
83
arch_to_mingw () { # <arch>
83
- if test i686 = " $arch "
84
- then
85
- echo mingw32
86
- else
87
- echo mingw64
88
- fi
84
+ case " $arch " in
85
+ i686) echo mingw32;;
86
+ aarch64) echo aarch64;;
87
+ * ) echo mingw64;;
88
+ esac
89
89
}
90
90
91
91
fetch () {
@@ -436,24 +436,20 @@ push () {
436
436
for arch in $architectures sources
437
437
do
438
438
case "$name ,$arch " in
439
- mingw-w64 -i686 ,x86 _64 |mingw-w64 -x86 _64 ,i686 )
440
- # wrong architecture
441
- continue
442
- ;;
443
- mingw-w64 -i686 -*,sources)
444
- # sources are "included" in x86 _64
445
- continue
446
- ;;
447
439
mingw-w64 -x86 _64 -*,sources)
448
440
# sources are "included" in x86 _64
449
441
filename=mingw-w64 ${name#* _64} .src.tar.gz
450
442
;;
451
443
*,sources)
452
444
filename=$name .src.tar.gz
453
445
;;
454
- mingw-w64 -* )
446
+ mingw-w64 -$arch , $arch )
455
447
filename=$name -any.pkg.tar.xz
456
448
;;
449
+ mingw-w64 -*)
450
+ # wrong architecture
451
+ continue
452
+ ;;
457
453
*)
458
454
filename=$name -$arch .pkg.tar.xz
459
455
;;
@@ -544,11 +540,13 @@ quick_add () { # <file>...
544
540
545
541
# Create a temporary directory to work with
546
542
dir=" $( mktemp -d) " &&
547
- mkdir " $dir /x86_64" " $dir /i686" " $dir /sources" ||
543
+ mkdir " $dir /x86_64" " $dir /aarch64 " " $dir / i686" " $dir /sources" ||
548
544
die " Could not create temporary directory"
549
545
550
546
i686_mingw=
551
547
i686_msys=
548
+ aarch64_mingw=
549
+ aarch64_msys=
552
550
x86_64_mingw=
553
551
x86_64_msys=
554
552
all_files=
@@ -559,7 +557,7 @@ quick_add () { # <file>...
559
557
file=" ${path##*/ } "
560
558
mingw=
561
559
case " ${path##*/ } " in
562
- mingw-w64-*.pkg.tar.xz) arch=${file## mingw-w64-} ; arch=${arch%% -* } ; key=${arch} _mingw;;
560
+ mingw-w64-*.pkg.tar.xz) arch=${file## mingw-w64-} ; arch=${arch# clang-} ; arch= ${arch %% -* } ; key=${arch} _mingw;;
563
561
git-extra-*.pkg.tar.xz) arch=${file% .pkg.tar.xz} ; arch=${arch##* -} ; key=${arch} _mingw;;
564
562
*-*.pkg.tar.xz) arch=${file% .pkg.tar.xz} ; arch=${arch##* -} ; test any != " $arch " || arch=" $FALLBACK_ARCHITECTURE " ; key=${arch} _msys;;
565
563
*.src.tar.gz) arch=sources; key= ;;
@@ -606,26 +604,47 @@ quick_add () { # <file>...
606
604
eval " mingw=\$ ${arch} _mingw"
607
605
test -n " $msys$mingw " || continue
608
606
609
- case " $arch ,$mingw " in *,) db2=;; i686,*) db2=mingw32;; *) db2=mingw64;; esac
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
+
612
+ case " $arch ,$mingw " in
613
+ *,) db2=;;
614
+ i686,*) db2=mingw32;;
615
+ *aarch64*) db2=aarch64;;
616
+ *) db2=mingw64;;
617
+ esac
610
618
for db in git-for-windows ${db2: +git-for-windows-$db2 }
611
619
do
612
620
for infix in db files
613
621
do
614
622
file=$db .$infix .tar.xz
615
- echo " Downloading current $arch /$file ..." >&2
616
- 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
617
630
dbs=" $dbs $arch /$file $arch /${file% .tar.xz} "
618
631
if test -n " $sign_option "
619
632
then
620
- curl -sfo " $dir /$arch /$file .sig" " $( arch_url $arch ) /$file .sig" ||
621
- return 1
622
- gpg --verify " $dir /$arch /$file .sig" ||
623
- 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
624
640
dbs=" $dbs $arch /$file .sig $arch /${file% .tar.xz} .sig"
625
641
fi
626
- sanitize_db " $dir /$arch /$file " || return 1
627
- test ! -f " $dir /$arch /${file% .tar.xz} " ||
628
- 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
629
648
done
630
649
done
631
650
(cd " $dir /$arch " &&
@@ -741,14 +760,6 @@ push_missing_signatures () {
741
760
for arch in $architectures sources
742
761
do
743
762
case "$name ,$arch " in
744
- mingw-w64 -i686 -*,x86 _64 |mingw-w64 -x86 _64 -*,i686 )
745
- # wrong architecture
746
- continue
747
- ;;
748
- mingw-w64 -i686 -*,sources)
749
- # sources are "included" in x86 _64
750
- continue
751
- ;;
752
763
libcurl*,sources|mingw-w64 -*-git-doc*,sources|msys2 -runtime-devel*,sources)
753
764
# extra package's source included elsewhere
754
765
continue
@@ -760,9 +771,13 @@ push_missing_signatures () {
760
771
*,sources)
761
772
filename=$name .src.tar.gz
762
773
;;
763
- mingw-w64 -* )
774
+ mingw-w64 -$arch , $arch )
764
775
filename=$name -any.pkg.tar.xz
765
776
;;
777
+ mingw-w64 -*)
778
+ # wrong architecture
779
+ continue
780
+ ;;
766
781
*)
767
782
filename=$name -$arch .pkg.tar.xz
768
783
;;
@@ -810,11 +825,7 @@ push_missing_signatures () {
810
825
811
826
for name in $list
812
827
do
813
- case " $name ,$arch " in
814
- mingw-w64-i686* ,x86_64|mingw-w64-x86_64* ,i686)
815
- # wrong architecture; skip
816
- continue
817
- ;;
828
+ case " $name " in
818
829
mingw-w64-$arch -* )
819
830
filename=$name -any.pkg.tar.xz
820
831
s=$( arch_to_mingw $arch )
@@ -828,6 +839,10 @@ push_missing_signatures () {
828
839
die " Could not add $name in $arch /mingw"
829
840
}
830
841
;;
842
+ mingw-w64-* )
843
+ # wrong architecture; skip
844
+ continue
845
+ ;;
831
846
* )
832
847
filename=$name -$arch .pkg.tar.xz
833
848
;;
0 commit comments