[or-cvs] [https-everywhere/master] check syntax of rules with xmllint, if available

schoen at torproject.org schoen at torproject.org
Sun Oct 31 07:15:17 UTC 2010


Author: Seth Schoen <schoen at eff.org>
Date: Sun, 31 Oct 2010 00:15:02 -0700
Subject: check syntax of rules with xmllint, if available
Commit: 12ed06501b02be6451af1bbec631f99808ee6d2b

---
 pending-rules/trivial-validate |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/pending-rules/trivial-validate b/pending-rules/trivial-validate
index f8e7bac..7a10988 100755
--- a/pending-rules/trivial-validate
+++ b/pending-rules/trivial-validate
@@ -19,3 +19,16 @@ grep to= *xml | grep '[^/]>' || echo "(None.)"
 echo
 echo "-- Rules redirecting to http in to pattern:"
 grep 'to="' *xml | sed 's/^.*to="//' | sed 's/\".*$//' | grep '^http:' || echo "(None.)"
+echo
+if [ $(which xmllint) ]
+then
+  echo "-- Rules with syntatically invalid XML:"
+  none=true
+    for rule in *.xml
+    do
+      xmllint "$rule" >/dev/null 2>&1 || { echo $rule; none=false; }
+    done
+  $none && echo "(None.)"
+else
+  echo "-- Could not check XML validity because xmllint not found."
+fi
-- 
1.7.1



More information about the tor-commits mailing list