q=projectB.query("SELECT b.package, b.version, a.arch_string FROM binaries b, bin_associations ba, architecture a WHERE ba.suite = %d AND ba.bin = b.id AND b.architecture = a.id"%(suite_id));
q=projectB.query("SELECT b.package, b.version, a.arch_string FROM binaries b, bin_associations ba, architecture a WHERE ba.suite = %s AND ba.bin = b.id AND b.architecture = a.id"%(suite_id));
ql=q.getresult();
foriinql:
print"%s %s %s"%(i[0],i[1],i[2]);
printstring.join(i);
# List source
q=projectB.query("SELECT s.source, s.version FROM source s, src_associations sa WHERE sa.suite = %d AND sa.source = s.id"%(suite_id));
q=projectB.query("SELECT s.source, s.version FROM source s, src_associations sa WHERE sa.suite = %s AND sa.source = s.id"%(suite_id));
global dsc, dsc_files, reject_message, reprocess, orig_tar_id;
global dsc, dsc_files, reject_message, reprocess, orig_tar_id, legacy_source_untouchable;
for file in files.keys():
if files[file]["type"] == "dsc":
...
...
@@ -470,23 +450,44 @@ def check_dsc ():
found = "%s in incoming" % (dsc_file)
# Check the file does not already exist in the archive
if not changes.has_key("stable upload"):
q = projectB.query("SELECT f.id FROM files f, location l WHERE f.filename ~ '/%s' AND l.id = f.location" % (utils.regex_safe(dsc_file)));
q = projectB.query("SELECT f.id FROM files f, location l WHERE (f.filename ~ '/%s$' OR f.filename = '%s') AND l.id = f.location" % (utils.regex_safe(dsc_file), dsc_file));
if q.getresult() != []:
reject_message = reject_message + "Rejected: can not overwrite existing copy of '%s' already in the archive.\n" % (dsc_file)
elif dsc_file[-12:] == ".orig.tar.gz":
# Check in the pool
q = projectB.query("SELECT l.path, f.filename, l.type, f.id FROM files f, location l WHERE f.filename ~ '/%s' AND l.id = f.location" % (utils.regex_safe(dsc_file)));
q = projectB.query("SELECT l.path, f.filename, l.type, f.id FROM files f, location l WHERE (f.filename ~ '/%s$' OR f.filename = '%s') AND l.id = f.location" % (utils.regex_safe(dsc_file), dsc_file));
ql = q.getresult();
if len(ql) > 0:
old_file = ql[0][0] + ql[0][1];
if ql != []:
# Unfortunately, we make get more than one match
# here if, for example, the package was in potato
# but had a -sa upload in woody. So we need to a)
# choose the right one and b) mark all wrong ones
# as excluded from the source poolification (to
# avoid file overwrites).
x = ql[0]; # default to something sane in case we don'tmatchanyorhaveonlyone
q = projectB.query("SELECT DISTINCT ON (f.id) l.path, f.filename, f.id as files_id, df.source, df.id as dsc_files_id, f.size, f.md5sum FROM files f, dsc_files df, location l WHERE df.source IN (SELECT source FROM dsc_files WHERE file = %s) AND f.id = df.file AND l.id = f.location AND (l.type = 'legacy' OR l.type = 'legacy-mixed')" % (orig_tar_id));
qd = q.dictresult();
for qid in qd:
# Is this an old upload superseded by a newer -sa upload? (See check_dsc() for details)
if legacy_source_untouchable.has_key(qid["files_id"]):