# HG changeset patch # User Rob Landley # Date 1193182549 18000 # Node ID 6adf16f10d54f22d5077593a35af759c3663cda2 # Parent fa8bf02e7cfab635a83c3d0b2d48e4a81cffb41a Split up make.sh so it's easier to call subsets of its functionality. diff -r fa8bf02e7cfa -r 6adf16f10d54 make/do-gethg.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/make/do-gethg.sh Tue Oct 23 18:35:49 2007 -0500 @@ -0,0 +1,26 @@ +#!/bin/sh + +# Clone or update mercurial Linux kernel repository from kernel.org + +if [ -z "$LNXDIR" ] +then + echo set LNXDIR + exit 1 +fi + +if [ ! -d "$LNXDIR" ] +then + echo "Clone Linux kernel repository from kernel.org" + + mkdir -p "$LNXDIR"/hg && + cd "$LNXDIR"/hg && + hg clone http://kernel.org/hg/linux-2.6 hg +else + # Update kernel mercurial repository. + cd "$LNXDIR"/hg && + echo "Update Linux kernel from kernel.org" + + hg pull -u +fi + +[ $? -ne 0 ] && exit 1 diff -r fa8bf02e7cfa -r 6adf16f10d54 make/do-master.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/make/do-master.sh Tue Oct 23 18:35:49 2007 -0500 @@ -0,0 +1,11 @@ +#!/bin/bash + +# Update master index + +if [ -z "$WEBDIR" ] +then + echo set WEBDIR + exit 1 +fi + +$WEBDIR/make/indexsections.py $WEBDIR/master.idx > $WEBDIR/index.html || exit 1 diff -r fa8bf02e7cfa -r 6adf16f10d54 make/do-menuconfig.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/make/do-menuconfig.sh Tue Oct 23 18:35:49 2007 -0500 @@ -0,0 +1,19 @@ +#!/bin/bash + +if [ -z "$WEBDIR" ] || [ -z "$LNXTAG" ] || [ -z "LNXDIR" ] +then + echo set WEBDIR, LNXTAG, and LNXDIR +fi + +rm -rf "$WEBDIR"/menuconfig/ +mkdir -p "$WEBDIR"/menuconfig +echo "Menuconfig docs for Linux $LNXTAG" >> "$WEBDIR"/menuconfig/index.html diff -r fa8bf02e7cfa -r 6adf16f10d54 make/do-mirror.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/make/do-mirror.sh Tue Oct 23 18:35:49 2007 -0500 @@ -0,0 +1,32 @@ +#!/bin/bash + +# Mirror various documentation resources from out on the internet + +if [ -z "$WEBDIR" ] +then + echo set WEBDIR + exit 1 +fi + +cd "$WEBDIR" +make/mirror.py +cat mirror/ols2002.pdf.gz | gunzip > mirror/ols2002.pdf +if [ -z "$(find mirror/ols2001 -name "*.pdf")" ] +then + mkdir -p mirror/ols2001 && + cd mirror/ols2001 && + wget -r -l 1 -nd http://lwn.net/2001/features/OLS/pdf/pdf/ && + cd ../.. + + [ $? -ne 0 ] && exit 1 +fi + +if [ -z "$(find ols/2007 -name "*.pdf")" ] +then + echo "Split ols files" + mkdir -p ols/{1999,2000,2001,2002,2003,2004,2005,2006,2007} && + cp mirror/ols2001/*.pdf ols/2001 && + make/splitols.py mirror ols + [ $? -ne 0 ] && exit 1 +fi + diff -r fa8bf02e7cfa -r 6adf16f10d54 make/do-readme.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/make/do-readme.sh Tue Oct 23 18:35:49 2007 -0500 @@ -0,0 +1,17 @@ +#!/bin/bash + +if [ -z "$WEBDIR" ] || [ -z "$LNXDIR" ] +then + echo set WEBDIR and LNXDIR + exit 1 +fi + +cd "$LNXDIR"/hg +rm -rf "$WEBDIR"/readme +mkdir "$WEBDIR"/readme +for i in $(find . -name "*[Rr][Ee][Aa][Dd][Mm][Ee]*" | grep -v "Documentation/") +do + OUT=$(echo $i | sed -e 's@\./@@' -e 's@/@-@g') + cp $i "$WEBDIR"/readme/$OUT +done +make help > "$WEBDIR"/makehelp.txt diff -r fa8bf02e7cfa -r 6adf16f10d54 make/do-rfc.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/make/do-rfc.sh Tue Oct 23 18:35:49 2007 -0500 @@ -0,0 +1,56 @@ +#!/bin/bash + +if [ -z "$LNXDIR" ] +then + echo set LNXDIR + exit 1 +fi + +# Blank our temp file +> temp-linuxrfc.txt + +function findrfc() +{ + x=0 + # Iterate through *.c and *.h in the Linux source code. + for i in `find "$LNXDIR"/hg -name "*.[hc]"` + do + # Progress indicator + x=$[$x+1] + if [ $x -gt 250 ] + then + echo -n . >&2 + x=0 + fi + # Find each mention of an RFC, filtering out the more obvious false + # positives. + for j in `grep -io "rfc *[1-9][0-9]*" $i | grep -v " " | grep -v "@rfc822\.org" | sed -r 's/[Rr][Ff][Cc] *([0-9]*)/rfc\1/g'` + do + echo $i:$j + done + done +} + +# Find the RFC comments, with progress indicator. + +echo -n Finding RFC comments >&2 +findrfc > temp-linuxrfc.txt + +# Process the temporary directory into an html file. + +echo Converting to html... >&2 +echo "RFCs used by the Linux kernel" +echo "" + +# Remove the temporary file +rm temp-linuxrfc.txt diff -r fa8bf02e7cfa -r 6adf16f10d54 make/make.sh --- a/make/make.sh Tue Oct 23 04:33:46 2007 -0500 +++ b/make/make.sh Tue Oct 23 18:35:49 2007 -0500 @@ -1,87 +1,31 @@ #!/bin/bash -[ -z "$WEBDIR" ] && WEBDIR=~/www/kdocs -[ -z "$LNXDIR" ] && LNXDIR=~/linux - -echo $WEBDIR - -echo "Update master index." +# Set environment variables and call do-*.sh in sequence -$WEBDIR/make/indexsections.py $WEBDIR/master.idx > $WEBDIR/index.html || exit 1 - -echo "Mirror resources" +[ -z "$WEBDIR" ] && export WEBDIR=~/www/kdocs +[ -z "$LNXDIR" ] && export LNXDIR=~/linux -cd "$WEBDIR" -make/mirror.py -cat mirror/ols2002.pdf.gz | gunzip > mirror/ols2002.pdf -if [ -z "$(find mirror/ols2001 -name "*.pdf")" ] +# Update mercurial repository +if [ "$1" != "--nonet" ] then - mkdir -p mirror/ols2001 && - cd mirror/ols2001 && - wget -r -l 1 -nd http://lwn.net/2001/features/OLS/pdf/pdf/ && - cd ../.. - - [ $? -ne 0 ] && exit 1 -fi - -if [ -z "$(find ols/2007 -name "*.pdf")" ] -then - echo "Split ols files" - mkdir -p ols/{1999,2000,2001,2002,2003,2004,2005,2006,2007} && - cp mirror/ols2001/*.pdf ols/2001 && - make/splitols.py mirror ols - [ $? -ne 0 ] && exit 1 + "$WEBDIR"/make/do-gethg.sh || exit 1 fi -echo "Update Linux kernel from kernel.org" +echo -n "Grab version number..." +export LNXTAG="$(hg tags | head -n 2 | tail -n 1 | awk '{print $1}')" +echo $LNXTAG -if [ ! -d "$LNXDIR" ] -then - # Clone repository if we haven't got one yet. - mkdir -p "$LNXDIR"/hg && - cd "$LNXDIR"/hg && - hg clone http://kernel.org/hg/linux-2.6 hg -else - # Update kernel mercurial repository. - cd "$LNXDIR"/hg && - if [ "$1" != "--short" ] - then - hg pull -u - fi -fi +echo "Update master index." +"$WEBDIR"/make/do-master.sh || exit 1 -[ $? -ne 0 ] && exit 1 - -echo -n "Grab version number..." - -LNXTAG="$(hg tags | head -n 2 | tail -n 1 | awk '{print $1}')" -echo $LNXTAG +echo "Mirror resources" +"$WEBDIR"/make/do-mirror.sh || exit 1 echo Copy readme files from Linux kernel - -rm -rf $WEBDIR/readme -mkdir $WEBDIR/readme -for i in $(find . -name "*[Rr][Ee][Aa][Dd][Mm][Ee]*" | grep -v "Documentation/") -do - OUT=$(echo $i | sed -e 's@\./@@' -e 's@/@-@g') - cp $i $WEBDIR/readme/$OUT -done -make help > $WEBDIR/makehelp.txt +"$WEBDIR"/make/do-readme.sh || exit 1 echo Convert kconfig to html for all architectures - -echo $WEBDIR/menuconfig/ -rm -rf $WEBDIR/menuconfig/ -mkdir -p $WEBDIR/menuconfig -echo "Menuconfig docs for Linux $LNXTAG" >> $WEBDIR/menuconfig/index.html +"$WEBDIR"/make/do-menuconfig.sh || exit 1 echo Install updated Documentation @@ -112,7 +56,7 @@ # while a script produces nochunks versions in the foreground. cd $LNXDIR/temp make -j 2 xmldocs -make -j 2 htmldocs & +[ "$1" != "--skimp" ] && make -j 2 htmldocs & cd Documentation/DocBook for i in *.xml do @@ -120,7 +64,7 @@ xmlto xhtml-nochunks $i -o xhtml-nochunks done # Wait for background task to finish before retrieving result -while [ $(jobs | wc -l) -ne 0 ] +[ "$1" != "--skimp" ] && while [ $(jobs | wc -l) -ne 0 ] do sleep 1 # Without this next line, bash never notices a change in the number of jobs. @@ -148,4 +92,8 @@ done echo "" >> index2.html mv index2.html index.html + +# Search for references to RFC documents +"$WEBDIR"/make/findrfc.sh > "$WEBDIR"/rfc-linux.html || exit 1 + echo "Done with kdocs"