[Collab-qa-commits] r2329 - udd/udd
Andreas Tille
tille at alioth.debian.org
Wed May 16 05:58:34 UTC 2012
Author: tille
Date: 2012-05-16 05:58:33 +0000 (Wed, 16 May 2012)
New Revision: 2329
Modified:
udd/udd/blends_prospective_gatherer.py
Log:
Verify that available upstream files are just imported and issue warning if not; deeper inspection is needed to check for false positives because of invalid yaml
Modified: udd/udd/blends_prospective_gatherer.py
===================================================================
--- udd/udd/blends_prospective_gatherer.py 2012-05-16 03:00:38 UTC (rev 2328)
+++ udd/udd/blends_prospective_gatherer.py 2012-05-16 05:58:33 UTC (rev 2329)
@@ -8,6 +8,7 @@
from gatherer import gatherer
from sys import stderr, exit
from os import listdir
+from os.path import exists
from fnmatch import fnmatch
from psycopg2 import IntegrityError, InternalError, ProgrammingError
import re
@@ -82,6 +83,7 @@
cur.execute('TRUNCATE %s' % my_config['table'])
cur.execute("PREPARE check_source (text) AS SELECT COUNT(*) FROM sources WHERE source = $1")
+ cur.execute("PREPARE check_reference (text) AS SELECT COUNT(*) FROM bibref WHERE source = $1")
cur.execute("""PREPARE check_itp (int) AS
SELECT id, arrival, submitter, owner, title, last_modified, submitter_name, submitter_email, owner_name, owner_email
@@ -102,7 +104,16 @@
cur.execute("EXECUTE check_source (%s)", (source,))
if cur.fetchone()[0] > 0:
# print "Source %s is in DB. Ignore for prospective packages" % source
- continue
+ upstream=upath+'/'+source+'.upstream'
+ if not exists(upstream):
+ continue
+ cur.execute("EXECUTE check_reference (%s)", (source,))
+ if cur.fetchone()[0] > 0:
+ # UDD seems to contain the references specified in source.upstream file
+ print "DEBUG: I know about the references in", upstream
+ continue
+ self.log.warning("%s has upstream file but no references in UDD" % (source, ))
+ continue
# Read output of dpkg-parsechangelog
p = Popen("LC_ALL=C dpkg-parsechangelog -l"+upath+'/'+source+'.changelog', shell=True, bufsize=4096,
More information about the Collab-qa-commits
mailing list