Skip to content

Commit a8ece7a

Browse files
committed
pacman-helper quick_add: do handle symbolic links
When `MSYS` is set to `winsymlinks:nativestrict`, the MSYS2 runtime will generate real Win32 symbolic links. This is something the `quick_add` command did not expect, thinking that the `ln -s` command would generate copies (which is the default of the MSYS2 runtime, believe it or not) that can be overwritten. But it simply does not work because a symbolic link cannot be overwritten with its target, not without removing the link first. This causes a problem since a recent `setup-git-for-windows-sdk` version updated to a newer `@actions/toolkit` version that blatantly configures the MSYS2 runtime to the `nativestrict` mode _for the entire remainder of the workflow job_. For the full sadness of the details, see actions/toolkit@2867e318d4d0de (yes, it indeed has no adequate commit message). Let's work around this issue by removing symbolic links, if any, before copying the databases or their signatures to the suffix-less version. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 29b182b commit a8ece7a

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

pacman-helper.sh

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -677,13 +677,23 @@ quick_add () { # <file>...
677677
done
678678
(cd "$dir/$arch" &&
679679
repo_add $sign_option git-for-windows.db.tar.xz $msys $mingw &&
680-
cp git-for-windows.db.tar.xz git-for-windows.db &&
681-
{ test -z "$sign_option" || cp git-for-windows.db.tar.xz.sig git-for-windows.db.sig; } &&
680+
{ test ! -h git-for-windows.db || rm git-for-windows.db; } &&
681+
cp git-for-windows.db.tar.xz git-for-windows.db && {
682+
test -z "$sign_option" || {
683+
{ test ! -h git-for-windows.db.sig || rm git-for-windows.db.sig; } &&
684+
cp git-for-windows.db.tar.xz.sig git-for-windows.db.sig
685+
}
686+
} &&
682687
if test -n "$db2"
683688
then
684689
repo_add $sign_option git-for-windows-$db2.db.tar.xz $mingw &&
685-
cp git-for-windows-$db2.db.tar.xz git-for-windows-$db2.db &&
686-
{ test -z "$sign_option" || cp git-for-windows-$db2.db.tar.xz.sig git-for-windows-$db2.db.sig; }
690+
{ test ! -h git-for-windows-$db2.db || rm git-for-windows-$db2.db; } &&
691+
cp git-for-windows-$db2.db.tar.xz git-for-windows-$db2.db && {
692+
test -z "$sign_option" || {
693+
{ test ! -h git-for-windows-$db2.db.sig || rm git-for-windows-$db2.db.sig; } &&
694+
cp git-for-windows-$db2.db.tar.xz.sig git-for-windows-$db2.db.sig
695+
}
696+
}
687697
fi) ||
688698
die "Could not add $msys $mingw to db in $arch"
689699
done

0 commit comments

Comments
 (0)