Mercurial > hg > kdocs
comparison 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 |
comparison
equal
deleted
inserted
replaced
79:4b9263d24970 | 80:fa8bf02e7cfa |
---|---|
1 #!/bin/bash | |
2 | |
3 export LINUXDIR=~/linux/hg/ | |
4 | |
5 #> temp-linuxrfc.txt | |
6 | |
7 function findrfc() | |
8 { | |
9 x=0 | |
10 for i in `find "$LINUXDIR" -name "*.[hc]"` | |
11 do | |
12 x=$[$x+1] | |
13 if [ $x -gt 250 ] | |
14 then | |
15 echo -n . >&2 | |
16 x=0 | |
17 fi | |
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'` | |
19 do | |
20 echo $i:$j | |
21 done | |
22 done | |
23 } | |
24 | |
25 echo -n Finding RFC comments >&2 | |
26 #findrfc > temp-linuxrfc.txt | |
27 | |
28 echo "<html><head><title>RFCs used by the Linux kernel</title></head>" | |
29 echo "<ul>" | |
30 for i in $(sed 's/.*://' temp-linuxrfc.txt | sort -u | sort -t c -k 2,2 -n) | |
31 do | |
32 echo '<li><h2><a href="http://tools.ietf.org/html/'$i'">'$i'</a></h2><p>' | |
33 for j in $(sed -rn 's@\'"$LINUXDIR"'(.*):'$i'$@\1@p' temp-linuxrfc.txt) | |
34 do | |
35 echo '<a href="http://kernel.org/hg/linux-2.6/file/tip/'$j'">'$j'</a>' | |
36 done | |
37 echo "</p></li>" | |
38 done | |
39 echo "</ul></html>" | |
40 | |
41 #rm temp-linuxrfc.txt |