trivial-validate.py doesn't work with Python 3.x or Python 2.x with -tt
option.

Add --help option and option checking to makexpi.sh.
From d0409ffeb48ed2ed533e39f7963e49c6a14c1ded Mon Sep 17 00:00:00 2001
From: Alex Xu <[email protected]>
Date: Wed, 28 Aug 2013 12:05:05 -0400
Subject: [PATCH 1/2] Fix whitespace in trivial-validate.py

---
 utils/trivial-validate.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/utils/trivial-validate.py b/utils/trivial-validate.py
index d0f03de..64ec44d 100755
--- a/utils/trivial-validate.py
+++ b/utils/trivial-validate.py
@@ -42,7 +42,7 @@ def test_missing_to(tree):
     # rule end or intended to be different elements.
     """Rule is missing a 'to' value."""
     for rule in tree.xpath("/ruleset/rule"):
-	if not rule.get("to"):
+        if not rule.get("to"):
             sys.stdout.write("warning: 'to' attribute missing in %s. " %fi)
             sys.stdout.write("Misplaced end or misnamed element?\n")
             return False
-- 
1.8.1.5

From eca9477a7000a5b300e8a5db866377f5a2d318d6 Mon Sep 17 00:00:00 2001
From: Alex Xu <[email protected]>
Date: Wed, 28 Aug 2013 12:06:13 -0400
Subject: [PATCH 2/2] Add --help option and option checking to makexpi.sh

---
 makexpi.sh | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/makexpi.sh b/makexpi.sh
index f2ebbb3..3449214 100755
--- a/makexpi.sh
+++ b/makexpi.sh
@@ -14,6 +14,26 @@ APP_NAME=https-everywhere
 #
 #  ./makexpi.sh 0.2.3.development.2
 
+usage() {
+  cat >&2 << USAGE
+$0 [--fast] [--no-recurse] [tag]
+
+--fast: Skip validation of rulesets
+--no-recurse: Internal switch, do not use.
+tag: Automatically check out a git tag and build an XPI from that version.
+USAGE
+}
+
+for arg in "$@"; do
+  if [[ ${arg:0:1} == - ]]; then
+    case $arg in
+      --help) usage; exit 0;;
+      --fast|--no-recurse) continue;;
+      *) echo "Invalid argument $arg"; usage; exit 1;;
+    esac
+  fi
+done
+
 cd "`dirname $0`"
 
 [ -d pkg ] || mkdir pkg
-- 
1.8.1.5

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
HTTPS-everywhere mailing list
[email protected]
http://lists.eff.org/cgi-bin/mailman/listinfo/https-everywhere

Reply via email to