From: Michael Still <mikal@stillhq.com>
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org
Subject: [Resent 2.6 patch] Correct case sensitivity in make mandocs
Date: Tue, 7 Oct 2003 13:14:57 +1000 [thread overview]
Message-ID: <1065496497.3f822fb14994b@dubai.stillhq.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 593 bytes --]
The attached patch corrects case sensitivity in the mandocs make target. XML is
case insensitive, and a bunch of the kernel-doc assumes this. The makeman and
splitman scripts incorrectly cared about case. This patch also updates the
Docbook DTD version which the script generates.
Cheers,
Mikal
--
Michael Still (mikal@stillhq.com) | "All my life I've had one dream,
http://www.stillhq.com | to achieve my many goals"
UTC + 10 | -- Homer Simpson
-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/
[-- Attachment #2: mandocs_ignorecase-002-f004 --]
[-- Type: application/octet-stream, Size: 5862 bytes --]
diff -Nur linux-2.6.0-test6-cset-20031006_1906/scripts/makeman linux-2.6.0-test6-cset-20031006_1906-mandocs_ignorecase-002-f004/scripts/makeman
--- linux-2.6.0-test6-cset-20031006_1906/scripts/makeman 2003-10-07 06:54:20.000000000 +1000
+++ linux-2.6.0-test6-cset-20031006_1906-mandocs_ignorecase-002-f004/scripts/makeman 2003-10-07 06:56:55.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] <dir> <file>\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 \"<refentrytitle>\" $ARGV[2] |";
while(<LISTING>){
@@ -40,29 +47,38 @@
open INPUT, "< $ARGV[1]/$filename.sgml";
$front = "";
$mode = 0;
- while(<INPUT>){
- if(/.*ENDFRONTTAG.*/){
- $mode = 0;
- }
+ # The modes used here are:
+ # mode = 0
+ # <!-- BEGINFRONTTAG -->
+ # <!-- <bookinfo> mode = 1
+ # <!-- <legalnotice> mode = 2
+ # <!-- ...GPL or whatever...
+ # <!-- </legalnotice> mode = 4
+ # <!-- </bookinfo> mode = 3
+ # <!-- ENDFRONTTAG -->
+ #
+ # ...doco...
+
+ # I know that some of the if statements in this while loop are in a funny
+ # order, but that is deliberate...
+ while(<INPUT>){
if($mode > 0){
s/<!-- //;
s/ -->//;
- s/<bookinfo>//;
- s/<\/bookinfo>//;
- s/<docinfo>//;
- s<\/docinfo>//;
- s/^[ \t]*//;
+ s/<docinfo>//i;
+ s<\/docinfo>//i;
+ s/^[ \t]*//i;
}
if($mode == 2){
- if(/<para>/){
+ if(/<para>/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>(.*)<\/title>/){
+ if(/<title>(.*)<\/title>/i){
$front = "$front.\\\" This documentation was generated from the book titled \"$1\", which is part of the Linux kernel source.\n.\\\" \n";
}
- elsif(/<legalnotice>/){
+ elsif(/<legalnotice>/i){
$front = "$front.\\\" This documentation comes with the following legal notice:\n.\\\" \n";
$mode = 2;
}
- elsif(/<author>/){
+ elsif(/<author>/i){
$front = "$front.\\\" Documentation by: ";
}
- elsif(/<firstname>(.*)<\/firstname>/){
+ elsif(/<firstname>(.*)<\/firstname>/i){
$front = "$front$1 ";
}
- elsif(/<surname>(.*)<\/surname>/){
+ elsif(/<surname>(.*)<\/surname>/i){
$front = "$front$1 ";
}
- elsif(/<email>(.*)<\/email>/){
+ elsif(/<email>(.*)<\/email>/i){
$front = "$front($1)";
}
- elsif(/\/author>/){
+ elsif(/\/author>/i){
$front = "$front\n";
}
- elsif(/<copyright>/){
+ elsif(/<copyright>/i){
$front = "$front.\\\" Documentation copyright: ";
}
- elsif(/<holder>(.*)<\/holder>/){
+ elsif(/<holder>(.*)<\/holder>/i){
$front = "$front$1 ";
}
- elsif(/<year>(.*)<\/year>/){
+ elsif(/<year>(.*)<\/year>/i){
$front = "$front$1 ";
}
- elsif(/\/copyright>/){
+ elsif(/\/copyright>/i){
$front = "$front\n";
}
elsif(/^[ \t]*$/
- || /<affiliation>/
- || /<\/affiliation>/
- || /<address>/
- || /<\/address>/
- || /<authorgroup>/
- || /<\/authorgroup>/
- || /<\/legalnotice>/
- || /<date>/
- || /<\/date>/
- || /<edition>/
- || /<\/edition>/){
+ || /<affiliation>/i
+ || /<\/affiliation>/i
+ || /<address>/i
+ || /<\/address>/i
+ || /<authorgroup>/i
+ || /<\/authorgroup>/i
+ || /<\/legalnotice>/i
+ || /<date>/i
+ || /<\/date>/i
+ || /<edition>/i
+ || /<\/edition>/i
+ || /<pubdate>/i
+ || /<\/pubdate>/i){
}
else{
print "Unknown tag in manpage conversion: $_";
}
}
- if(/.*BEGINFRONTTAG.*/){
- $mode = 1;
+ if($mode == 0){
+ if(/<bookinfo>/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-test6-cset-20031006_1906/scripts/split-man linux-2.6.0-test6-cset-20031006_1906-mandocs_ignorecase-002-f004/scripts/split-man
--- linux-2.6.0-test6-cset-20031006_1906/scripts/split-man 2003-10-07 06:54:20.000000000 +1000
+++ linux-2.6.0-test6-cset-20031006_1906-mandocs_ignorecase-002-f004/scripts/split-man 2003-10-07 06:56:55.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 <<EOF;
-<!DOCTYPE refentry PUBLIC "-//Davenport//DTD DocBook V3.0//EN">
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
<!-- BEGINFRONTTAG: The following is front matter for the parent book -->
$front
next reply other threads:[~2003-10-07 3:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-10-07 3:14 Michael Still [this message]
2003-10-18 21:25 ` Florian Weimer
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=1065496497.3f822fb14994b@dubai.stillhq.com \
--to=mikal@stillhq.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®