Documentation: stop depending on Perl to massage user manual

The "fix-texi.perl" script is used to fix up the output of `docbook2x-texi`: - It changes the filename to be "git.info". - It changes the directory category and entry. The script is written in Perl, but it can be rather trivially converted to a shell script. Do so to remove the dependency on Perl for building the user manual. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Patrick Steinhardt committed Apr 16, 2025 at 14:16 UTC 521c98840b6ce5503f771600493f522be3677232
3 files changed +23 -17
Documentation/Makefile
+2 -2
@@ -398,9 +398,9 @@ user-manual.html: user-manual.xml $(XSLT)
398 git.info: user-manual.texi
399 $(QUIET_MAKEINFO)$(MAKEINFO) --no-split -o $@ user-manual.texi
400
401 -user-manual.texi: user-manual.xml
401 +user-manual.texi: user-manual.xml fix-texi.sh
402 $(QUIET_DB2TEXI)$(DOCBOOK2X_TEXI) user-manual.xml --encoding=UTF-8 --to-stdout >$@+ && \
403 - $(PERL_PATH) fix-texi.perl <$@+ >$@ && \
403 + $(SHELL_PATH) fix-texi.sh <$@+ >$@ && \
404 $(RM) $@+
405
406 user-manual.pdf: user-manual.xml
Documentation/fix-texi.perl deleted
-15
@@ -1,15 +0,0 @@
1 -#!/usr/bin/perl -w
2 -
3 -while (<>) {
4 - if (/^\@setfilename/) {
5 - $_ = "\@setfilename git.info\n";
6 - } elsif (/^\@direntry/) {
7 - print '@dircategory Development
8 -@direntry
9 -* Git: (git). A fast distributed revision control system
10 -@end direntry
11 -'; }
12 - unless (/^\@direntry/../^\@end direntry/) {
13 - print;
14 - }
15 -}
Documentation/fix-texi.sh new
+21
@@ -0,0 +1,21 @@
1 +#!/bin/sh
2 +
3 +awk '
4 + /^@setfilename/{
5 + print "@setfilename git.info"
6 + next
7 + }
8 + /^@direntry/{
9 + direntry=1
10 + print "@dircategory Development"
11 + print "@direntry"
12 + print "* Git: (git). A fast distributed revision control system"
13 + print "@end direntry"
14 + next
15 + }
16 + /^@end direntry/{
17 + direntry=0
18 + next
19 + }
20 + !direntry
21 +'