Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from Asciidoctor extensions to regular Asciidoctor #34

Merged
merged 1 commit into from
Jun 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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