Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: David Kastrup <dak@gnu.org>
Cc: git@vger.kernel.org
Subject: Re: [install info (using perl) 1/2] Add support for an info version of the user manual
Date: Wed, 08 Aug 2007 16:18:48 -0700	[thread overview]
Message-ID: <7v1wed1up3.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <7v643p1vbr.fsf@assigned-by-dhcp.cox.net> (Junio C. Hamano's message of "Wed, 08 Aug 2007 16:05:12 -0700")

Junio C Hamano <gitster@pobox.com> writes:

>> This part worries me.
>
> Aside from possible portability issue of multi-line script,
> there is another slight problem I am not sure if it is worth
> fixing.  If you do not have docbook2x-texi installed, nobody
> notices that resulting $*.texi was a garbage and an almost empty
> git.info is generated.

How about doing something like this instead?

---

 Documentation/Makefile      |   13 ++++---------
 Documentation/fix-texi.perl |   15 +++++++++++++++
 2 files changed, 19 insertions(+), 9 deletions(-)
 create mode 100755 Documentation/fix-texi.perl

diff --git a/Documentation/Makefile b/Documentation/Makefile
index 56d12aa..8c33729 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -154,16 +154,11 @@ user-manual.html: user-manual.xml
 	xsltproc $(XSLTOPTS) -o $@ $(XSLT) $<
 
 git.info: user-manual.xml
-	$(RM) $@ $*.texi
-	$(DOCBOOK2X_TEXI) user-manual.xml --to-stdout | \
-	perl -ne 'if (/^\@setfilename/) {$$_="\@setfilename git.info\
-"} elsif (/^\@direntry/) {print "\@dircategory Development\
-\@direntry\
-* Git: (git).           A fast distributed revision control system\
-\@end direntry\
-"} print unless (/^\@direntry/ .. /^\@end direntry/)' > $*.texi
+	$(RM) $@ $*.texi $*.texi+
+	$(DOCBOOK2X_TEXI) user-manual.xml --to-stdout >$*.texi+
+	perl fix-texi.perl <$*.texi+ >$*.texi
 	$(MAKEINFO) --no-split $*.texi
-	$(RM) $*.texi
+	$(RM) $*.texi $*.texi+
 
 howto-index.txt: howto-index.sh $(wildcard howto/*.txt)
 	$(RM) $@+ $@
diff --git a/Documentation/fix-texi.perl b/Documentation/fix-texi.perl
new file mode 100755
index 0000000..ff7d78f
--- /dev/null
+++ b/Documentation/fix-texi.perl
@@ -0,0 +1,15 @@
+#!/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;
+	}
+}

  reply	other threads:[~2007-08-08 23:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-06 10:22 [install info (using perl) 1/2] Add support for an info version of the user manual David Kastrup
2007-08-07 10:02 ` [install info (using perl) 2/2] INSTALL: explain info installation and dependencies David Kastrup
2007-08-08 22:59 ` [install info (using perl) 1/2] Add support for an info version of the user manual Junio C Hamano
2007-08-08 23:05   ` Junio C Hamano
2007-08-08 23:18     ` Junio C Hamano [this message]
2007-08-08 23:46       ` David Kastrup
2007-08-08 23:27     ` David Kastrup
2007-08-08 23:25   ` David Kastrup
  -- strict thread matches above, loose matches on Subject: below --
2007-08-06 10:22 David Kastrup
2007-08-07 10:49 ` David Kastrup

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7v1wed1up3.fsf@assigned-by-dhcp.cox.net \
    --to=gitster@pobox.com \
    --cc=dak@gnu.org \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox