[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] [https-everywhere/master 05/12] shell script to find the most common problems in rule expressions



Author: Seth Schoen <schoen@xxxxxxx>
Date: Sat, 30 Oct 2010 23:14:47 -0700
Subject: shell script to find the most common problems in rule expressions
Commit: 6fbac3022e8d56a82fb5616d29c04bf68347ce39

---
 pending-rules/trivial-validate |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
 create mode 100755 pending-rules/trivial-validate

diff --git a/pending-rules/trivial-validate b/pending-rules/trivial-validate
new file mode 100755
index 0000000..f540d71
--- /dev/null
+++ b/pending-rules/trivial-validate
@@ -0,0 +1,15 @@
+#!/bin/sh
+# THIS IS NOT A RULE, but a shell script that looks for common problems
+# and typos in rules.
+
+echo "-- Rules not anchored to beginning of a line:"
+grep from= *.xml | cut -d\" -f2 | grep '^[^^]' || echo "(None.)"
+echo
+echo "-- Rules with unescaped dots:"
+grep from= *.xml | cut -d\" -f2 | grep '[^\]\.[^*]' || echo "(None.)"
+echo
+echo "-- Rules not containing trailing slash:"
+grep from= *.xml | cut -d\" -f2 | grep -v '//.*/' || echo "(None.)"
+echo
+echo "-- Rules with missing closing slash in rule XML tag:"
+grep to= *xml | grep '[^/]>' || echo "(None.)"
-- 
1.7.1