[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] [https-everywhere/master] check syntax of rules with xmllint, if available
Author: Seth Schoen <schoen@xxxxxxx>
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