Skip to content

Commit d8e8886

Browse files
committed
update-via-pacman: install asciidoctor if not present
In a recent change, GfW switched from the homegrown `-asciidoctor-extensions` package to the MSYS2-provided `-asciidoctor` one, as there's no need for the former nowadays. This commit allows `update-via-pacman.ps1` to install the latter package. Ref: git-for-windows/MINGW-packages@907ead4 Signed-off-by: Dennis Ameling <[email protected]>
1 parent b223331 commit d8e8886

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

update-via-pacman.ps1

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,21 @@ if (Test-Path var/lib/pacman/local/mingw-w64-*-asciidoctor-extensions-[0-9]* -Pa
9999
# Uninstall mingw-w64-asciidoctor-extensions
100100
test ! -d /var/lib/pacman/local/mingw-w64-$carch-asciidoctor-extensions-[0-9]* || {
101101
pacman -R --noconfirm mingw-w64-$carch-asciidoctor-extensions &&
102-
# Uninstall the `asciidoctor` gem and install `mingw-w64-asciidoctor` instead
102+
# Uninstall the `asciidoctor` gem
103103
gem uninstall asciidoctor
104104
} || exit 1
105-
106-
pacman -S --noconfirm mingw-w64-$carch-asciidoctor || exit 1
107105
done
108106
'@
109-
if (!$?) { die "Could not re-install asciidoctor" }
107+
if (!$?) { die "Could not remove asciidoctor-extensions" }
108+
}
109+
110+
# asciidoctor is needed to build mingw-w64-git. Let's install it if it's not present.
111+
if (!(Test-Path var/lib/pacman/local/mingw-w64-*-asciidoctor-[0-9]* -PathType Container)) {
112+
bash -lc @'
113+
set -x
114+
pacman -S --noconfirm mingw-w64-clang-aarch64-asciidoctor || exit 1
115+
'@
116+
if (!$?) { die "Could not install asciidoctor" }
110117
}
111118

112119
# Pacman sometimes writes `.pacnew` files; We want to rename them and let

0 commit comments

Comments
 (0)