]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Documentation: stop depending on Perl to massage user manual
authorPatrick Steinhardt <ps@pks.im>
Wed, 16 Apr 2025 12:16:09 +0000 (14:16 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 16 Apr 2025 14:30:29 +0000 (07:30 -0700)
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>
Documentation/Makefile
Documentation/fix-texi.perl [deleted file]
Documentation/fix-texi.sh [new file with mode: 0755]

index 0d3a2c6bfe68e74325cba14b71d820ba93de4edd..6485d40f6206938a91fa15b71ee26b2ee0393290 100644 (file)
@@ -398,9 +398,9 @@ user-manual.html: user-manual.xml $(XSLT)
 git.info: 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 >$@+ && \
-       $(PERL_PATH) fix-texi.perl <$@+ >$@ && \
+       $(SHELL_PATH) fix-texi.sh <$@+ >$@ && \
        $(RM) $@+
 
 user-manual.pdf: user-manual.xml
diff --git a/Documentation/fix-texi.perl b/Documentation/fix-texi.perl
deleted file mode 100755 (executable)
index ff7d78f..0000000
+++ /dev/null
@@ -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;
-       }
-}
diff --git a/Documentation/fix-texi.sh b/Documentation/fix-texi.sh
new file mode 100755 (executable)
index 0000000..bc300f7
--- /dev/null
@@ -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
+'