summaryrefslogtreecommitdiffstats
path: root/bin/check-syntax
diff options
context:
space:
mode:
authorFlorian Weimer <fw@deneb.enyo.de>2007-08-30 15:24:04 +0000
committerFlorian Weimer <fw@deneb.enyo.de>2007-08-30 15:24:04 +0000
commit46618e397d369ecdabb20ce9b7d929c14df65d7d (patch)
tree2017da9c0bac627462472a469f7eb4dc2ed62da5 /bin/check-syntax
parent4b298e402653e6a475831f8699958d825314a035 (diff)
* bin/check-sytax:
Support reading from standard input git-svn-id: svn+ssh://svn.debian.org/svn/secure-testing@6444 e39458fd-73e7-0310-bf30-c45bca0a0e42
Diffstat (limited to 'bin/check-syntax')
-rwxr-xr-xbin/check-syntax14
1 files changed, 11 insertions, 3 deletions
diff --git a/bin/check-syntax b/bin/check-syntax
index 2e66841ea2..688ea39503 100755
--- a/bin/check-syntax
+++ b/bin/check-syntax
@@ -43,19 +43,27 @@ def do_parse(f):
errors = True
if errors:
sys.exit(1)
+
+def construct(c, name):
+ if name == '-':
+ f = sys.stdin
+ name = '<stdin>'
+ else:
+ f = file(name)
+ return c(name, f)
def parse_CVE(name):
- f = bugs.CVEFile(name)
+ f = construct(bugs.CVEFile, name)
# Relax syntax checking a bit.
f.no_version_needs_note = False
do_parse(f)
def parse_DSA(name):
- do_parse(bugs.DSAFile(name))
+ do_parse(construct(bugs.DSAFile, name))
def parse_DTSA(name):
- do_parse(bugs.DTSAFile(name))
+ do_parse(construct(bugs.DTSAFile, name))
file_types = {'CVE' : parse_CVE,
'DSA' : parse_DSA,

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