annotate make/findrfc.sh @ 80:fa8bf02e7cfa

Script to search Linux kernel for mentions of ietf RFC documents and make a page linking to the files and the appropriate RFC.
author Rob Landley <rob@landley.net>
date Tue, 23 Oct 2007 04:33:46 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
80
fa8bf02e7cfa Script to search Linux kernel for mentions of ietf RFC documents and make a
Rob Landley <rob@landley.net>
parents:
diff changeset
1 #!/bin/bash
fa8bf02e7cfa Script to search Linux kernel for mentions of ietf RFC documents and make a
Rob Landley <rob@landley.net>
parents:
diff changeset
2
fa8bf02e7cfa Script to search Linux kernel for mentions of ietf RFC documents and make a
Rob Landley <rob@landley.net>
parents:
diff changeset
3 export LINUXDIR=~/linux/hg/
fa8bf02e7cfa Script to search Linux kernel for mentions of ietf RFC documents and make a
Rob Landley <rob@landley.net>
parents:
diff changeset
4
fa8bf02e7cfa Script to search Linux kernel for mentions of ietf RFC documents and make a
Rob Landley <rob@landley.net>
parents:
diff changeset
5 #> temp-linuxrfc.txt
fa8bf02e7cfa Script to search Linux kernel for mentions of ietf RFC documents and make a
Rob Landley <rob@landley.net>
parents:
diff changeset
6
fa8bf02e7cfa Script to search Linux kernel for mentions of ietf RFC documents and make a
Rob Landley <rob@landley.net>
parents:
diff changeset
7 function findrfc()
fa8bf02e7cfa Script to search Linux kernel for mentions of ietf RFC documents and make a
Rob Landley <rob@landley.net>
parents:
diff changeset
8 {
fa8bf02e7cfa Script to search Linux kernel for mentions of ietf RFC documents and make a
Rob Landley <rob@landley.net>
parents:
diff changeset
9 x=0
fa8bf02e7cfa Script to search Linux kernel for mentions of ietf RFC documents and make a
Rob Landley <rob@landley.net>
parents:
diff changeset
10 for i in `find "$LINUXDIR" -name "*.[hc]"`
fa8bf02e7cfa Script to search Linux kernel for mentions of ietf RFC documents and make a
Rob Landley <rob@landley.net>
parents:
diff changeset
11 do
fa8bf02e7cfa Script to search Linux kernel for mentions of ietf RFC documents and make a
Rob Landley <rob@landley.net>
parents:
diff changeset
12 x=$[$x+1]
fa8bf02e7cfa Script to search Linux kernel for mentions of ietf RFC documents and make a
Rob Landley <rob@landley.net>
parents:
diff changeset
13 if [ $x -gt 250 ]
fa8bf02e7cfa Script to search Linux kernel for mentions of ietf RFC documents and make a
Rob Landley <rob@landley.net>
parents:
diff changeset
14 then
fa8bf02e7cfa Script to search Linux kernel for mentions of ietf RFC documents and make a
Rob Landley <rob@landley.net>
parents:
diff changeset
15 echo -n . >&2
fa8bf02e7cfa Script to search Linux kernel for mentions of ietf RFC documents and make a
Rob Landley <rob@landley.net>
parents:
diff changeset
16 x=0
fa8bf02e7cfa Script to search Linux kernel for mentions of ietf RFC documents and make a
Rob Landley <rob@landley.net>
parents:
diff changeset
17 fi
fa8bf02e7cfa Script to search Linux kernel for mentions of ietf RFC documents and make a
Rob Landley <rob@landley.net>
parents:
diff changeset
18 for j in `grep -io "rfc *[1-9][0-9]*" $i | grep -v " " | sed -r 's/[Rr][Ff][Cc] *([0-9]*)/rfc\1/g'`
fa8bf02e7cfa Script to search Linux kernel for mentions of ietf RFC documents and make a
Rob Landley <rob@landley.net>
parents:
diff changeset
19 do
fa8bf02e7cfa Script to search Linux kernel for mentions of ietf RFC documents and make a
Rob Landley <rob@landley.net>
parents:
diff changeset
20 echo $i:$j
fa8bf02e7cfa Script to search Linux kernel for mentions of ietf RFC documents and make a
Rob Landley <rob@landley.net>
parents:
diff changeset
21 done
fa8bf02e7cfa Script to search Linux kernel for mentions of ietf RFC documents and make a
Rob Landley <rob@landley.net>
parents:
diff changeset
22 done
fa8bf02e7cfa Script to search Linux kernel for mentions of ietf RFC documents and make a
Rob Landley <rob@landley.net>
parents:
diff changeset
23 }
fa8bf02e7cfa Script to search Linux kernel for mentions of ietf RFC documents and make a
Rob Landley <rob@landley.net>
parents:
diff changeset
24
fa8bf02e7cfa Script to search Linux kernel for mentions of ietf RFC documents and make a
Rob Landley <rob@landley.net>
parents:
diff changeset
25 echo -n Finding RFC comments >&2
fa8bf02e7cfa Script to search Linux kernel for mentions of ietf RFC documents and make a
Rob Landley <rob@landley.net>
parents:
diff changeset
26 #findrfc > temp-linuxrfc.txt
fa8bf02e7cfa Script to search Linux kernel for mentions of ietf RFC documents and make a
Rob Landley <rob@landley.net>
parents:
diff changeset
27
fa8bf02e7cfa Script to search Linux kernel for mentions of ietf RFC documents and make a
Rob Landley <rob@landley.net>
parents:
diff changeset
28 echo "<html><head><title>RFCs used by the Linux kernel</title></head>"
fa8bf02e7cfa Script to search Linux kernel for mentions of ietf RFC documents and make a
Rob Landley <rob@landley.net>
parents:
diff changeset
29 echo "<ul>"
fa8bf02e7cfa Script to search Linux kernel for mentions of ietf RFC documents and make a
Rob Landley <rob@landley.net>
parents:
diff changeset
30 for i in $(sed 's/.*://' temp-linuxrfc.txt | sort -u | sort -t c -k 2,2 -n)
fa8bf02e7cfa Script to search Linux kernel for mentions of ietf RFC documents and make a
Rob Landley <rob@landley.net>
parents:
diff changeset
31 do
fa8bf02e7cfa Script to search Linux kernel for mentions of ietf RFC documents and make a
Rob Landley <rob@landley.net>
parents:
diff changeset
32 echo '<li><h2><a href="http://tools.ietf.org/html/'$i'">'$i'</a></h2><p>'
fa8bf02e7cfa Script to search Linux kernel for mentions of ietf RFC documents and make a
Rob Landley <rob@landley.net>
parents:
diff changeset
33 for j in $(sed -rn 's@\'"$LINUXDIR"'(.*):'$i'$@\1@p' temp-linuxrfc.txt)
fa8bf02e7cfa Script to search Linux kernel for mentions of ietf RFC documents and make a
Rob Landley <rob@landley.net>
parents:
diff changeset
34 do
fa8bf02e7cfa Script to search Linux kernel for mentions of ietf RFC documents and make a
Rob Landley <rob@landley.net>
parents:
diff changeset
35 echo '<a href="http://kernel.org/hg/linux-2.6/file/tip/'$j'">'$j'</a>'
fa8bf02e7cfa Script to search Linux kernel for mentions of ietf RFC documents and make a
Rob Landley <rob@landley.net>
parents:
diff changeset
36 done
fa8bf02e7cfa Script to search Linux kernel for mentions of ietf RFC documents and make a
Rob Landley <rob@landley.net>
parents:
diff changeset
37 echo "</p></li>"
fa8bf02e7cfa Script to search Linux kernel for mentions of ietf RFC documents and make a
Rob Landley <rob@landley.net>
parents:
diff changeset
38 done
fa8bf02e7cfa Script to search Linux kernel for mentions of ietf RFC documents and make a
Rob Landley <rob@landley.net>
parents:
diff changeset
39 echo "</ul></html>"
fa8bf02e7cfa Script to search Linux kernel for mentions of ietf RFC documents and make a
Rob Landley <rob@landley.net>
parents:
diff changeset
40
fa8bf02e7cfa Script to search Linux kernel for mentions of ietf RFC documents and make a
Rob Landley <rob@landley.net>
parents:
diff changeset
41 #rm temp-linuxrfc.txt