[Collab-qa-commits] r1028 - udd/src/udd
he at alioth.debian.org
he at alioth.debian.org
Sat Aug 9 01:49:48 UTC 2008
Author: he
Date: 2008-08-09 01:49:48 +0000 (Sat, 09 Aug 2008)
New Revision: 1028
Modified:
udd/src/udd/lintian_gatherer.py
Log:
Make the lintian importer actual do work
Modified: udd/src/udd/lintian_gatherer.py
===================================================================
--- udd/src/udd/lintian_gatherer.py 2008-08-09 01:45:31 UTC (rev 1027)
+++ udd/src/udd/lintian_gatherer.py 2008-08-09 01:49:48 UTC (rev 1028)
@@ -10,13 +10,13 @@
import re
def get_gatherer(connection, config):
- return carnivore_gatherer(connection, config)
+ return lintian_gatherer(connection, config)
class lintian_gatherer(gatherer):
#RE to parse lintian output, pushing the tag code to $1, package name
#to $2, pkg type to $3, tag name to $4 and extra info to $5
# (stolen from Russ Allbery, thanks dude)
- output_re = re.compile("([EWIXO]): (\S+)(?: (\S+))?: (\S+)(?:\s+(.*))?/");
+ output_re = re.compile("([EWIXO]): (\S+)(?: (\S+))?: (\S+)(?:\s+(.*))?");
code_to_tag_type_map = {
"E": "error",
@@ -62,9 +62,14 @@
match = lintian_gatherer.output_re.match(line)
if match:
(code, pkg, pkg_type, tag, extra) = match.groups();
+ #this one is optional:
+ if pkg_type:
+ pkg_type = quote(pkg_type)
+ else:
+ pkg_type = 'NULL'
- cur.execute("EXECUTE lintian_insert (%s, %s, %s, %s)" % \
- (pkg, pkg_type, tag, lintian_gatherer.code_to_tag_type_map[code]));
+ cur.execute("EXECUTE lintian_insert (%s, %s, %s, %s)"\
+ % (quote(pkg), pkg_type, quote(tag), quote(lintian_gatherer.code_to_tag_type_map[code])));
else:
print "Can't parse line %d: %s" % (line_number, line)
More information about the Collab-qa-commits
mailing list