From 257a670d3762817c5e9553edcbfaf41b89d8d47f Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Sat, 11 Feb 2023 21:02:13 +0100 Subject: [PATCH] git-extra: really only add the aarch64 repository for git-sdk-arm64 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 --- git-extra/git-extra.install | 4 ++-- git-extra/git-extra.install.in | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/git-extra/git-extra.install b/git-extra/git-extra.install index 91dd6a285e..ffb4c7ee19 100644 --- a/git-extra/git-extra.install +++ b/git-extra/git-extra.install @@ -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 || diff --git a/git-extra/git-extra.install.in b/git-extra/git-extra.install.in index f5bd90daff..0dc36d0e61 100644 --- a/git-extra/git-extra.install.in +++ b/git-extra/git-extra.install.in @@ -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 ||