patch-2.4.19 linux-2.4.19/scripts/split-man
Next file: linux-2.4.19/scripts/tkgen.c
Previous file: linux-2.4.19/scripts/split-include.c
Back to the patch index
Back to the overall index
- Lines: 34
- Date:
Fri Aug 2 17:39:46 2002
- Orig file:
linux-2.4.18/scripts/split-man
- Orig date:
Wed Dec 31 16:00:00 1969
diff -urN linux-2.4.18/scripts/split-man linux-2.4.19/scripts/split-man
@@ -0,0 +1,33 @@
+#!/usr/bin/perl
+#
+# split-man: create man pages from kernel-doc -man output
+#
+# Author: Tim Waugh <twaugh@redhat.com>
+# Modified by: Christoph Hellwig <hch@infradead.org>
+#
+
+use strict;
+
+die "$0: where do I put the results?\n" unless ($#ARGV >= 0);
+die "$0: can't create $ARGV[0]: $!\n" unless mkdir $ARGV[0], 0777;
+
+my $state = 0;
+
+while (<STDIN>) {
+ s/&(\w+)/\\fB\1\\fP/g; # fix smgl uglinesses
+ if (/^\.TH \"[^\"]*\" 9 \"([^\"]*)\"/) {
+ close OUT unless ($state++ == 0);
+ my $fn = "$ARGV[0]/$1.9";
+ if (open OUT, ">$fn") {
+ print STDERR "creating $fn\n";
+ } else {
+ die "can't open $fn: $!\n";
+ }
+
+ print OUT $_;
+ } elsif ($state != 0) {
+ print OUT $_;
+ }
+}
+
+close OUT;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)