changeset 110:01b77829d010

Lots of stuff bit-rotted in scripts to extract documentation from current kernel sources. De-bit-rot it.
author Rob Landley <rob@landley.net>
date Sat, 19 Feb 2011 21:32:24 -0600
parents cfaf44286c4a
children 09c09067584c
files make/README make/functions.sh make/make.sh make/menuconfig2html.py
diffstat 4 files changed, 30 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/README	Sat Feb 19 21:32:24 2011 -0600
@@ -0,0 +1,15 @@
+Run make/mirror.py to download resources we mirror from elsewhere into
+the "mirror" directory.
+
+Run make/splitols.py to break up the OLS proceedings into individual
+papers.  (Run mirror.py and install pdftk first.)
+
+Run make/make.sh to rebuild documentation extracted from the kernel
+source tarball.  You may want to set $WEBDIR and $LNXDIR to values appropriate
+for your system, and install mercurial and xmlto first.  This calls most
+of the other scripts in this directory.
+
+Run make/doclinkcheck.py to check the Documentation/index.html files for
+404 errors or files not mentioned from the index.  (These are generated
+from 00-INDEX files in each subdirectory, so the errors it reports should
+be fixed upstream in the Linux kernel source.)
--- a/make/functions.sh	Sat Feb 19 21:31:09 2011 -0600
+++ b/make/functions.sh	Sat Feb 19 21:32:24 2011 -0600
@@ -55,7 +55,7 @@
   # Make the chdir local
   (
     cd "$LNXDIR" &&
-    make -j 2 htmldocs
+    make -j 4 htmldocs
   )
 }
 
@@ -65,12 +65,12 @@
   (
     cd "$LNXDIR" &&
     # Probably redundant, but just in case...
-    make -j 2 xmldocs &&
+    make -j 4 xmldocs &&
     cd Documentation/DocBook &&
     for i in *.xml
     do
       echo "Converting $i"
-      xmlto xhtml-nochunks $i -o xhtml-nochunks
+      xmlto --skip-validation xhtml-nochunks $i -o xhtml-nochunks
     done
   )
 }
@@ -128,10 +128,10 @@
     do
       echo Converting "$i" &&
       ARCH=$(echo $i | sed -r 's@.*/(.*)/.*@\1@') &&
-      echo "<li><a href=${ARCH}.html>${ARCH}</a></li>" >> \
+      echo "<li><a href=$ARCH.html>$ARCH</a></li>" >> \
         "$WEBDIR"/menuconfig/index.html &&
-      "$WEBDIR"/make/menuconfig2html.py $i "$WEBDIR"/menuconfig "$LNXTAG" > \
-        "$WEBDIR"/menuconfig/$ARCH.html
+      "$WEBDIR"/make/menuconfig2html.py $i "$WEBDIR/menuconfig" \
+        "$LNXTAG" > "$WEBDIR/menuconfig/$ARCH.html"
 
       [ $? -eq 0 ] || exit 1
     done
@@ -220,9 +220,9 @@
     for i in $(sed 's/.*://' temp-linuxrfc.txt | sort -u | sort -t c -k 2,2 -n)
     do
       echo '<li><h2><a href="http://tools.ietf.org/html/'$i'">'$i'</a></h2><p>'
-      for j in $(sed -rn 's@\'"$LNXDIR"'(.*):'$i'$@\1@p' temp-linuxrfc.txt)
+      for j in $(sed -rn 's@\'"$LNXDIR"/'(.*):'$i'$@\1@p' temp-linuxrfc.txt)
       do
-        echo '<a href="http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=tree;f='"$j"';h=master">'$j'</a>'
+        echo '<a href="http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob_plain;f='"$j"';hb=HEAD">'$j'</a>'
       done
       echo "</p></li>"
     done
@@ -258,7 +258,7 @@
 
     # Do setup we'll need later.
     make allnoconfig > /dev/null &&
-    make -j 2 xmldocs
+    make -j 4 xmldocs
   )
 }
 
--- a/make/make.sh	Sat Feb 19 21:31:09 2011 -0600
+++ b/make/make.sh	Sat Feb 19 21:32:24 2011 -0600
@@ -31,7 +31,7 @@
 update_documentation_dir || exit 1
 
 echo "Update master index."
-update_master || exit 1
+#update_master || exit 1
 
 echo "Mirror resources"
 mirror_files || exit 1
--- a/make/menuconfig2html.py	Sat Feb 19 21:31:09 2011 -0600
+++ b/make/menuconfig2html.py	Sat Feb 19 21:32:24 2011 -0600
@@ -17,9 +17,9 @@
 def htmlescape(str):
   return str.strip().replace("&","&amp;").replace("<","&lt;").replace(">","&gt;")
 
-def starthtml(out):
+def starthtml(out, myfn):
 
-  out.write("<html><title>%s %s</title><body><h1>%s %s</h1>\n" % (sys.argv[1],sys.argv[3],sys.argv[1],sys.argv[3]))
+  out.write("<html><title>%s %s</title><body><h1>%s %s</h1>\n" % (myfn,sys.argv[3],myfn,sys.argv[3]))
 
 def readfile(filename):
   global helplen
@@ -33,7 +33,7 @@
   except IOError:
     sys.stderr.write("File %s missing\n" % filename)
     return
-  starthtml(out)
+  starthtml(out,filename)
   config = None
   description = None
   for i in lines:
@@ -75,13 +75,13 @@
     elif words[0] == "source":
       fn=zapquotes(words[1])
       readfile(fn)
-      out.write('<h2><a href="%(link)s">%(link)s</a></h2>\n' % {"link": "%s/%s.html" % (sys.argv[2], "-".join(fn.split("/")))})
+      out.write('<h2><a href="%s">%s</a></h2>\n' % ("%s.html" % "-".join(fn.split("/")), fn))
     elif words[0] in ("default","depends", "select", "if", "endif", "#"): pass
     #else: sys.stderr.write("unknown: %s\n" % i)
   if helplen: out.write("</pre></blockquote>\n")
   out.write("</html>\n")
 
-starthtml(sys.stdout)
+starthtml(sys.stdout,sys.argv[1])
 sys.stdout.write("<ul>\n")
 readfile(sys.argv[1])
 sys.stdout.write("</ul>\n</html>\n")