summaryrefslogtreecommitdiffstats
path: root/bin/check-syntax
diff options
context:
space:
mode:
authorFlorian Weimer <fw@deneb.enyo.de>2005-09-12 17:12:08 +0000
committerFlorian Weimer <fw@deneb.enyo.de>2005-09-12 17:12:08 +0000
commit011fb6c34b8ef7e5df972aea2ed0f2f261b9b9c1 (patch)
tree0562916546939b9d8ce01fa085c741ec11bc59fe /bin/check-syntax
parent688cdb551c81127529ae2a606d14c2793e639ea6 (diff)
lib/python/debian_support.py (ParseError):
Add class. lib/python/debian_support.py (PackageFile.raiseSyntaxError):o Raise ParseError instead of SyntaxError. bin/check-syntax, bin/update-bug-list-db: Handle the ParseError exception gracefully. lib/python/bugs.py (CVEFile.matchHeader): Check parentheses/brackets. data/CAN/list: Fix uncovered syntax errors. git-svn-id: svn+ssh://svn.debian.org/svn/secure-testing@1937 e39458fd-73e7-0310-bf30-c45bca0a0e42
Diffstat (limited to 'bin/check-syntax')
-rwxr-xr-xbin/check-syntax31
1 files changed, 18 insertions, 13 deletions
diff --git a/bin/check-syntax b/bin/check-syntax
index c6005d22be..d996ae3664 100755
--- a/bin/check-syntax
+++ b/bin/check-syntax
@@ -19,23 +19,28 @@ def setup_paths():
root_path = setup_paths()
import bugs
+import debian_support
def do_parse(f):
names = {}
errors = False
- for r in f:
- n = r.name
- if n[0:4] in ('CAN', 'CVE'):
- n = n[4:]
- if names.has_key(n):
- if names[n] <> r.name:
- sys.stderr.write("error: duplicate CVE entry: %s and %s\n"
- % (names[n], r.name))
- else:
- sys.stderr.write("error: duplicate CVE entry: %s\n"
- % r.name)
- errors = True
- names[n] = r.name
+ try:
+ for r in f:
+ n = r.name
+ if n[0:4] in ('CAN', 'CVE'):
+ n = n[4:]
+ if names.has_key(n):
+ if names[n] <> r.name:
+ sys.stderr.write("error: duplicate CVE entry: %s and %s\n"
+ % (names[n], r.name))
+ else:
+ sys.stderr.write("error: duplicate CVE entry: %s\n"
+ % r.name)
+ errors = True
+ names[n] = r.name
+ except debian_support.ParseError, e:
+ e.printOut(sys.stderr)
+ errors = True
if errors:
sys.exit(1)

© 2014-2024 Faster IT GmbH | imprint | privacy policy