From 364e031f5eec5fe33e470a85a9caedfc1252ea48 Mon Sep 17 00:00:00 2001 From: James Troup Date: Tue, 13 Feb 2007 13:40:40 +0000 Subject: [PATCH] [rmurray] handle multiple orig.tar.gz's in check_dsc_against_db --- ChangeLog | 3 +++ daklib/queue.py | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 62c97be1..ffce70ec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19,6 +19,9 @@ 2007-02-08 Ryan Murray + * daklib/queue.py (Upload.check_dsc_against_db): handle multiple + orig.tar.gz's by picking the first one by file id. + * dak/override.py (main): limit to binary overrides only for now. (usage): update to match. diff --git a/daklib/queue.py b/daklib/queue.py index 46343a28..e1b50b2f 100644 --- a/daklib/queue.py +++ b/daklib/queue.py @@ -919,6 +919,8 @@ SELECT s.version, su.suite_name FROM source s, src_associations sa, suite su # Try and find all files mentioned in the .dsc. This has # to work harder to cope with the multiple possible # locations of an .orig.tar.gz. + # The ordering on the select is needed to pick the newest orig + # when it exists in multiple places. for dsc_file in dsc_files.keys(): found = None if files.has_key(dsc_file): @@ -926,7 +928,7 @@ SELECT s.version, su.suite_name FROM source s, src_associations sa, suite su actual_size = int(files[dsc_file]["size"]) found = "%s in incoming" % (dsc_file) # Check the file does not already exist in the archive - q = self.projectB.query("SELECT f.size, f.md5sum, l.path, f.filename FROM files f, location l WHERE f.filename LIKE '%%%s%%' AND l.id = f.location" % (dsc_file)) + q = self.projectB.query("SELECT f.size, f.md5sum, l.path, f.filename FROM files f, location l WHERE f.filename LIKE '%%%s%%' AND l.id = f.location ORDER BY f.id DESC" % (dsc_file)) ql = q.getresult() # Strip out anything that isn't '%s' or '/%s$' for i in ql: -- 2.39.5