Skip to content

Commit a416808

Browse files
committed
update-via-pacman: replace asciidoctor-extensions with asciidoctor
In git-for-windows/MINGW-packages#119, Git for Windows switched away from the custom-built Asciidoctor extensions, now instead using the regular Asciidoctor. This patch is a companion of that PR to ensure that Git for Windows' SDK is aligned with that change. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 802be5b commit a416808

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

update-via-pacman.ps1

+17-6
Original file line numberDiff line numberDiff line change
@@ -80,19 +80,30 @@ if ($type -Match "full system upgrade") {
8080
if (!$?) { die "Could not re-populate git-for-windows-keyring" }
8181
}
8282

83-
# A ruby upgrade (or something else) may require a re-install of the
84-
# `asciidoctor` gem. We only do this for the 64-bit SDK, though, as we require
85-
# asciidoctor only when building Git, whose 32-bit packages are cross-compiled
86-
# in from 64-bit.
83+
# Git for Windows switched to using the regular `asciidoctor` _without_ any
84+
# of the extensions. So let's ensure that the custom-built package
85+
# `mingw-w64-asciidoctor-extensions` is no longer installed.
8786
if (Test-Path var/lib/pacman/local/mingw-w64-*-asciidoctor-extensions-[0-9]* -PathType Container) {
8887
bash -lc @'
8988
set -x
9089
for d in clangarm64 mingw64 mingw32
9190
do
9291
test -x /$d/bin/ruby.exe || continue
9392
export PATH=/$d/bin:$PATH
94-
test -n \"$(gem list --local | grep \"^asciidoctor \")\" ||
95-
gem install asciidoctor || exit
93+
case $d in
94+
clangarm64) carch=clang-aarch64;;
95+
mingw64) carch=x86_64;;
96+
mingw32) carch=i686;;
97+
esac
98+
99+
# Uninstall mingw-w64-asciidoctor-extensions
100+
test ! -d /var/lib/pacman/local/mingw-w64-$carch-asciidoctor-extensions-[0-9]* || {
101+
pacman -R --noconfirm mingw-w64-$carch-asciidoctor-extensions &&
102+
# Uninstall the `asciidoctor` gem and install `mingw-w64-asciidoctor` instead
103+
gem uninstall asciidoctor
104+
} || exit 1
105+
106+
pacman -S --noconfirm mingw-w64-$carch-asciidoctor || exit 1
96107
done
97108
'@
98109
if (!$?) { die "Could not re-install asciidoctor" }

0 commit comments

Comments
 (0)