changeset 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 4b9263d24970
children 6adf16f10d54
files make/findrfc.sh
diffstat 1 files changed, 41 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/findrfc.sh	Tue Oct 23 04:33:46 2007 -0500
@@ -0,0 +1,41 @@
+#!/bin/bash
+
+export LINUXDIR=~/linux/hg/
+
+#> temp-linuxrfc.txt
+
+function findrfc()
+{
+  x=0
+  for i in `find "$LINUXDIR" -name "*.[hc]"`
+  do
+    x=$[$x+1]
+    if [ $x -gt 250 ]
+    then
+      echo -n . >&2
+      x=0
+    fi
+    for j in `grep -io "rfc *[1-9][0-9]*" $i | grep -v "  " | sed -r 's/[Rr][Ff][Cc] *([0-9]*)/rfc\1/g'`
+    do
+      echo $i:$j
+    done
+  done
+}
+
+echo -n Finding RFC comments >&2
+#findrfc > temp-linuxrfc.txt
+
+echo "<html><head><title>RFCs used by the Linux kernel</title></head>"
+echo "<ul>"
+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@\'"$LINUXDIR"'(.*):'$i'$@\1@p' temp-linuxrfc.txt)
+  do
+    echo '<a href="http://kernel.org/hg/linux-2.6/file/tip/'$j'">'$j'</a>'
+  done
+  echo "</p></li>"
+done
+echo "</ul></html>"
+
+#rm temp-linuxrfc.txt