Skip to content

Commit

Permalink
git-extra: really only add the aarch64 repository for git-sdk-arm64
Browse files Browse the repository at this point in the history
The latest `filesystem` package seems to always create `/clangarm64`
(and a bunch of subdirectories). This does not really reflect in
git-sdk-64 because no files are contained in those directories (and Git
does not track empty directories), but it _did_ fool `git-extra`'s
post-install script into adding Git for Windows' aarch64 Pacman
repository.

Let's make the test a bit more stringent than just looking for the
`/clangarm64` directory: require at least one file to be stored within
that directory tree.

Signed-off-by: Johannes Schindelin <[email protected]>
  • Loading branch information
dscho committed Feb 11, 2023
1 parent a67ff33 commit 257a670
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions git-extra/git-extra.install
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ GITATTRIBUTES
grep -q "$otherpacman" etc/pacman.conf ||
sed -i -e '/^\[mingw32\]/i['$otherpacman']\nServer = https://wingit.blob.core.windows.net/'$otherarch'\n' etc/pacman.conf

test ! -d /clangarm64 ||
grep -q "git-for-windows-aarch64" etc/pacman.conf ||
test -z "$(find /clangarm64 -type f -print -quit) || # if /clangarm64 exists and contains at least one file
grep -q "git-for-windows-aarch64" etc/pacman.conf || # then add Git for Windows' aarch64 repository (unless it's already added)
sed -i -e '/^\[clangarm64]/i[git-for-windows-aarch64]\nServer = https://wingit.blob.core.windows.net/aarch64\n' etc/pacman.conf

! grep -q 'https://dl.bintray.com/\$repo/pacman/\$arch' etc/pacman.conf ||
Expand Down
4 changes: 2 additions & 2 deletions git-extra/git-extra.install.in
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ GITATTRIBUTES
grep -q "$otherpacman" etc/pacman.conf ||
sed -i -e '/^\[mingw32\]/i['$otherpacman']\nServer = https://wingit.blob.core.windows.net/'$otherarch'\n' etc/pacman.conf

test ! -d /clangarm64 ||
grep -q "git-for-windows-aarch64" etc/pacman.conf ||
test -z "$(find /clangarm64 -type f -print -quit) || # if /clangarm64 exists and contains at least one file
grep -q "git-for-windows-aarch64" etc/pacman.conf || # then add Git for Windows' aarch64 repository (unless it's already added)
sed -i -e '/^\[clangarm64]/i[git-for-windows-aarch64]\nServer = https://wingit.blob.core.windows.net/aarch64\n' etc/pacman.conf

! grep -q 'https://dl.bintray.com/\$repo/pacman/\$arch' etc/pacman.conf ||
Expand Down

0 comments on commit 257a670

Please sign in to comment.