git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 3/4] Documentation: stop depending on Perl to massage user manual

From
Patrick Steinhardt <ps@pks.im>
Date
Apr 15, 2025, 09:57 UTC
Message-ID
<20250415-b4-pks-drop-perl-v1-3-c6addf175858@pks.im>
In-Reply-To
<20250415-b4-pks-drop-perl-v1-0-c6addf175858@pks.im>

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>
---
 Documentation/Makefile      |  4 ++--
 Documentation/fix-texi.perl | 15 ---------------
 Documentation/fix-texi.sh   | 21 +++++++++++++++++++++
 3 files changed, 23 insertions(+), 17 deletions(-)
diff --git a/Documentation/Makefile b/Documentation/Makefile
index 0d3a2c6bfe6..6485d40f620 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -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
index ff7d78f620a..00000000000
--- a/Documentation/fix-texi.perl
+++ /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
index 00000000000..bc300f7b0f1
--- /dev/null
+++ b/Documentation/fix-texi.sh
@@ -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
+'
-- 
2.49.0.805.g082f7c87e0.dirty
Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 7 of 14 in “Drop Perl dependency in a couple of subsystems”
  1. 0/4 Drop Perl dependency in a couple of subsystemsPatrick Steinhardt, Apr 15, 2025
  2. 1/4 filter-branch: stop depending on PerlPatrick Steinhardt, Apr 15, 2025
  3. Junio C HamanoApr 15, 2025
  4. 2/4 request-pull: stop depending on PerlPatrick Steinhardt, Apr 15, 2025
  5. Junio C HamanoApr 15, 2025
  6. Patrick SteinhardtApr 16, 2025
  7. 3/4 Documentation: stop depending on Perl to massage user manualPatrick Steinhardt, Apr 15, 2025
  8. 4/4 Documentation: stop depending on Perl to generate command listPatrick Steinhardt, Apr 15, 2025
  9. Junio C HamanoApr 15, 2025
  10. 0/4 Drop Perl dependency in a couple of subsystemsPatrick Steinhardt, Apr 16, 2025
  11. 1/4 filter-branch: stop depending on PerlPatrick Steinhardt, Apr 16, 2025
  12. 2/4 request-pull: stop depending on PerlPatrick Steinhardt, Apr 16, 2025
  13. 4/4 Documentation: stop depending on Perl to generate command listPatrick Steinhardt, Apr 16, 2025
  14. 3/4 Documentation: stop depending on Perl to massage user manualPatrick Steinhardt, Apr 16, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.