diff -Nur linux-2.6.0-test4-bk5/scripts/makeman linux-2.6.0-test4-bk5-mandocs/scripts/makeman
--- linux-2.6.0-test4-bk5/scripts/makeman 2003-09-04 10:43:15.000000000 +1000
+++ linux-2.6.0-test4-bk5-mandocs/scripts/makeman 2003-09-05 10:07:14.000000000 +1000
@@ -12,7 +12,7 @@
## $3 -- the filename which contained the sgmldoc output
## (I need this so I know which manpages to convert)
-my($LISTING, $GENERATED, $INPUT, $OUTPUT, $front, $mode, $filename);
+my($LISTING, $GENERATED, $INPUT, $OUTPUT, $front, $mode, $filename, $tmpdir);
if($ARGV[0] eq ""){
die "Usage: makeman [convert | install]
\n";
@@ -22,6 +22,13 @@
die "Output directory \"$ARGV[1]\" does not exist\n";
}
+if($ENV{"TMPDIR"} ne ""){
+ $tmpdir = $ENV{"TMPDIR"};
+}
+else{
+ $tmpdir = "/tmp";
+}
+
if($ARGV[0] eq "convert"){
open LISTING, "grep \"\" $ARGV[2] |";
while(){
@@ -40,29 +47,38 @@
open INPUT, "< $ARGV[1]/$filename.sgml";
$front = "";
$mode = 0;
- while(){
- if(/.*ENDFRONTTAG.*/){
- $mode = 0;
- }
+ # The modes used here are:
+ # mode = 0
+ #
+ #
+ #
+ # ...doco...
+
+ # I know that some of the if statements in this while loop are in a funny
+ # order, but that is deliberate...
+ while(){
if($mode > 0){
s///;
- s///;
- s/<\/bookinfo>//;
- s///;
- s<\/docinfo>//;
- s/^[ \t]*//;
+ s///i;
+ s<\/docinfo>//i;
+ s/^[ \t]*//i;
}
if($mode == 2){
- if(//){
+ if(//i){
}
- elsif(/<\/para>/){
+ elsif(/<\/para>/i){
$front = "$front.\\\" \n";
}
- elsif(/<\/legalnotice>/){
- $mode = 1;
+ elsif(/<\/legalnotice>/i){
+ $mode = 4;
}
elsif(/^[ \t]*$/){
}
@@ -72,69 +88,79 @@
}
if($mode == 1){
- if(/(.*)<\/title>/){
+ if(/(.*)<\/title>/i){
$front = "$front.\\\" This documentation was generated from the book titled \"$1\", which is part of the Linux kernel source.\n.\\\" \n";
}
- elsif(//){
+ elsif(//i){
$front = "$front.\\\" This documentation comes with the following legal notice:\n.\\\" \n";
$mode = 2;
}
- elsif(//){
+ elsif(//i){
$front = "$front.\\\" Documentation by: ";
}
- elsif(/(.*)<\/firstname>/){
+ elsif(/(.*)<\/firstname>/i){
$front = "$front$1 ";
}
- elsif(/(.*)<\/surname>/){
+ elsif(/(.*)<\/surname>/i){
$front = "$front$1 ";
}
- elsif(/(.*)<\/email>/){
+ elsif(/(.*)<\/email>/i){
$front = "$front($1)";
}
- elsif(/\/author>/){
+ elsif(/\/author>/i){
$front = "$front\n";
}
- elsif(//){
+ elsif(//i){
$front = "$front.\\\" Documentation copyright: ";
}
- elsif(/(.*)<\/holder>/){
+ elsif(/(.*)<\/holder>/i){
$front = "$front$1 ";
}
- elsif(/(.*)<\/year>/){
+ elsif(/(.*)<\/year>/i){
$front = "$front$1 ";
}
- elsif(/\/copyright>/){
+ elsif(/\/copyright>/i){
$front = "$front\n";
}
elsif(/^[ \t]*$/
- || //
- || /<\/affiliation>/
- || //
- || /<\/address>/
- || //
- || /<\/authorgroup>/
- || /<\/legalnotice>/
- || //
- || /<\/date>/
- || //
- || /<\/edition>/){
+ || //i
+ || /<\/affiliation>/i
+ || //i
+ || /<\/address>/i
+ || //i
+ || /<\/authorgroup>/i
+ || /<\/legalnotice>/i
+ || //i
+ || /<\/date>/i
+ || //i
+ || /<\/edition>/i
+ || //i
+ || /<\/pubdate>/i){
}
else{
print "Unknown tag in manpage conversion: $_";
}
}
- if(/.*BEGINFRONTTAG.*/){
- $mode = 1;
+ if($mode == 0){
+ if(//i){
+ $mode = 1;
+ }
+ }
+
+ if($mode == 4){
+ if(/<\/bookinfo>/i){
+ $mode = 3;
+ }
}
}
close INPUT;
- system("cd $ARGV[1]; docbook2man $filename.sgml; mv $filename.9 /tmp/$$.9\n");
- open GENERATED, "< /tmp/$$.9";
+ system("cd $ARGV[1]; docbook2man $filename.sgml; mv $filename.9 $tmpdir/$$.9\n");
+ open GENERATED, "< $tmpdir/$$.9";
open OUTPUT, "> $ARGV[1]/$filename.9";
print OUTPUT "$front";
@@ -146,7 +172,7 @@
close GENERATED;
system("gzip -f $ARGV[1]/$filename.9\n");
- unlink("/tmp/$filename.9");
+ unlink("$tmpdir/$$.9");
}
}
elsif($ARGV[0] eq "install"){
diff -Nur linux-2.6.0-test4-bk5/scripts/split-man linux-2.6.0-test4-bk5-mandocs/scripts/split-man
--- linux-2.6.0-test4-bk5/scripts/split-man 2003-09-04 10:43:15.000000000 +1000
+++ linux-2.6.0-test4-bk5-mandocs/scripts/split-man 2003-09-05 15:18:13.000000000 +1000
@@ -52,7 +52,7 @@
open REF, "> $ARGV[1]/$filename.sgml" or
die "Couldn't open output file \"$ARGV[1]/$filename.sgml\": $!\n";
print REF <
+
$front