Skip to content

Commit

Permalink
update-via-pacman: replace asciidoctor-extensions with asciidoctor
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
dscho committed Jun 12, 2024
1 parent f4c4e36 commit 385936c
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions update-via-pacman.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,30 @@ if ($type -Match "full system upgrade") {
if (!$?) { die "Could not re-populate git-for-windows-keyring" }
}

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

0 comments on commit 385936c

Please sign in to comment.