This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[contrib] let texi2pod.pl handle @include
- To: gcc-patches at gcc dot gnu dot org
- Subject: [contrib] let texi2pod.pl handle @include
- From: "Brian R. Gaeke" <brg at sartre dot dgate dot ORG>
- Date: Sat, 21 Jul 2001 23:20:22 -0700
Hi,
I happen to be using texi2pod to generate manpages from texinfo for
one of my own projects, and I wanted to use @include, so I hacked
it in (among other things). This is the patch. I do not claim that it
is the most robust way to do it, but it was quick to do.
I tested it by trying to do a "make generated-manpages" in the gcc
subdirectory on i686-pc-linux-gnu. While the manpages look correct to me,
and make didn't give an error, I am not able to check whether they are
the same, because it looks to me like I have different podlators than
the versions of *.1 in the CVS repository. At any rate, any differences
shouldn't be that big a deal because the texinfo sources passed to
texi2pod don't use @include.
I have neither a copyright assignment nor write access, so this is basically
up for grabs. I can make simple changes if it would help, but I don't want to
spend a lot more time messing with this.
2001-07-21 Brian R. Gaeke <brg@dgate.org>
* texi2pod.pl: Handle @include.
-Brian
--
Brian R. Gaeke, brg@sartre.dgate.ORG -- PGP/GPG gleefully accepted
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/contrib/ChangeLog,v
retrieving revision 1.114
diff -u -r1.114 ChangeLog
--- ChangeLog 2001/07/03 00:45:59 1.114
+++ ChangeLog 2001/07/22 06:08:47
@@ -1,3 +1,7 @@
+2001-07-21 Brian R. Gaeke <brg@dgate.org>
+
+ * texi2pod.pl: Handle @include.
+
2001-07-03 Joseph S. Myers <jsm28@cam.ac.uk>
* texi2pod.pl: Handle @r inside @item.
Index: texi2pod.pl
===================================================================
RCS file: /cvs/gcc/gcc/contrib/texi2pod.pl,v
retrieving revision 1.13
diff -u -r1.13 texi2pod.pl
--- texi2pod.pl 2001/07/03 00:45:59 1.13
+++ texi2pod.pl 2001/07/22 06:08:47
@@ -62,7 +62,15 @@
open(STDOUT, ">$out") or die "opening \"$out\": $!\n";
}
-while(<STDIN>)
+sub getnextline {
+ if ($#lines != -1) {
+ return shift(@lines);
+ } else {
+ return <STDIN>;
+ }
+}
+
+while($_ = getnextline())
{
# Certain commands are discarded without further processing.
/^\@(?:
@@ -78,6 +86,12 @@
# Look for filename and title markers.
/^\@setfilename\s+([^.]+)/ and $fn = $1, next;
/^\@settitle\s+([^.]+)/ and $tl = $1, next;
+
+ /^\@include (.+)/ and do {
+ open(FILE, "$1") or die "can't open \@include file\n";
+ @lines = <FILE>;
+ close FILE;
+ };
# Look for blocks surrounded by @c man begin SECTION ... @c man end.
# This really oughta be @ifman ... @end ifman and the like, but such