From 7a180f8482f5453c99865563f574a3106f7f283d Mon Sep 17 00:00:00 2001 From: lovelywcm Date: Fri, 17 Dec 2010 05:42:25 +0000 Subject: [PATCH] Y2hlY2tSdWxlcy5weTogc2ltcGxpZnkgdGhlIG91dHB1dAo= --- checkRules.py | 8 +++----- sendGFWList.sh | 4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/checkRules.py b/checkRules.py index d3e2159..77011a1 100755 --- a/checkRules.py +++ b/checkRules.py @@ -61,7 +61,6 @@ def main(): startfrom = 0 for rule in fin: line += 1 - print line, ':\t', rule, rule = rule.strip() if line < startfrom: continue if not rule: continue @@ -70,14 +69,13 @@ def main(): if rule.startswith('@@'): continue if rule.startswith('/') and rule.endswith('/'): continue (test, t) = getUrl(rule) - print '=>', test, curl = subprocess.call(['/usr/bin/curl', '-4', '-I', '-m', '5', test], stdout=subprocess.PIPE, stderr=subprocess.PIPE) if (t==IP and curl==28) or (t==TLS and curl==35) or (t==URL and curl==56): - print '=>', curl + pass elif t==IP and curl==56: - print '=>', '\033[31mexpecting %d, got %d\033[0m' % (expect[t], curl) + print line, '\t', test, '=>', '\033[31mexpecting %d, got %d\033[0m' % (expect[t], curl) else: - print '=>', '\033[1;31mexpecting %d, got %d\033[0m' % (expect[t], curl) + print line, '\t', test, '=>', '\033[1;31mexpecting %d, got %d\033[0m' % (expect[t], curl) ferr.write(str(line) + ': "' + rule + '", expecting %d, got %d' % (expect[t], curl) + '\n') diff --git a/sendGFWList.sh b/sendGFWList.sh index b491676..55271cd 100755 --- a/sendGFWList.sh +++ b/sendGFWList.sh @@ -80,7 +80,7 @@ if [ "$convertedLog" != "" ]; then echo "But wait...!" echo "This would overwrite all commits till your last update!!!"; echo -e "\nIf you are confused, wait somebody else to fix it."; - echo "Please always report this to our maintainers group!"; + echo "Please always report this to our maintainers' group!"; echo -e "\n*********************************************************\n\n\n"; exit 1; fi @@ -91,7 +91,7 @@ if [ "$convertedLog" != "" ]; then rm temp.patch; if [ -s temp.patch ]; then - echo "Error: git apply failed, your work saved at temp.patch"; + echo -e "\n\033[31mError:\033[0m git apply failed, your work saved at temp.patch\n"; exit 1; elif [ -a temp.patch ]; then # empty, remove it