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>
This commit is contained in:
Patrick Steinhardt
2025-04-16 14:16:09 +02:00
committed by Junio C Hamano
parent 76042228f2
commit 521c98840b
3 changed files with 23 additions and 17 deletions

View File

@@ -398,9 +398,9 @@ user-manual.html: user-manual.xml $(XSLT)
git.info: user-manual.texi git.info: user-manual.texi
$(QUIET_MAKEINFO)$(MAKEINFO) --no-split -o $@ user-manual.texi $(QUIET_MAKEINFO)$(MAKEINFO) --no-split -o $@ user-manual.texi
user-manual.texi: user-manual.xml user-manual.texi: user-manual.xml fix-texi.sh
$(QUIET_DB2TEXI)$(DOCBOOK2X_TEXI) user-manual.xml --encoding=UTF-8 --to-stdout >$@+ && \ $(QUIET_DB2TEXI)$(DOCBOOK2X_TEXI) user-manual.xml --encoding=UTF-8 --to-stdout >$@+ && \
$(PERL_PATH) fix-texi.perl <$@+ >$@ && \ $(SHELL_PATH) fix-texi.sh <$@+ >$@ && \
$(RM) $@+ $(RM) $@+
user-manual.pdf: user-manual.xml user-manual.pdf: user-manual.xml

View File

@@ -1,15 +0,0 @@
#!/usr/bin/perl -w
while (<>) {
if (/^\@setfilename/) {
$_ = "\@setfilename git.info\n";
} elsif (/^\@direntry/) {
print '@dircategory Development
@direntry
* Git: (git). A fast distributed revision control system
@end direntry
'; }
unless (/^\@direntry/../^\@end direntry/) {
print;
}
}

21
Documentation/fix-texi.sh Executable file
View File

@@ -0,0 +1,21 @@
#!/bin/sh
awk '
/^@setfilename/{
print "@setfilename git.info"
next
}
/^@direntry/{
direntry=1
print "@dircategory Development"
print "@direntry"
print "* Git: (git). A fast distributed revision control system"
print "@end direntry"
next
}
/^@end direntry/{
direntry=0
next
}
!direntry
'