[Secure-testing-commits] r6444 - bin

fw at alioth.debian.org fw at alioth.debian.org
Thu Aug 30 15:24:04 UTC 2007


Author: fw
Date: 2007-08-30 15:24:04 +0000 (Thu, 30 Aug 2007)
New Revision: 6444

Modified:
   bin/check-syntax
Log:
* bin/check-sytax:
  Support reading from standard input


Modified: bin/check-syntax
===================================================================
--- bin/check-syntax	2007-08-30 15:23:02 UTC (rev 6443)
+++ bin/check-syntax	2007-08-30 15:24:04 UTC (rev 6444)
@@ -43,19 +43,27 @@
         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,




More information about the Secure-testing-commits mailing list