# Write the rejection email out as the <foo>.reason file
os.write(fd,reject_mail_message);
...
...
@@ -684,7 +711,7 @@ class Katie:
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.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));
q=self.projectB.query("SELECT f.size, f.md5sum 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));
# "It has not broken them. It has fixed a
# brokenness. Your crappy hack exploited a bug in
...
...
@@ -695,8 +722,19 @@ class Katie:
# the same name and version.)"
# -- ajk@ on d-devel@l.d.o
ifq.getresult()!=[]:
self.reject("can not overwrite existing copy of '%s' already in the archive."%(dsc_file));
ql=q.getresult();
ifql:
match=0;
ifdsc_file[-12:]==".orig.tar.gz":
foriinql:
ifint(files[dsc_file]["size"])==int(i[0])and \
files[dsc_file]["md5sum"]==i[1]:
self.reject("ignoring %s, since it's already in the archive."%(dsc_file),"Warning: ");
delfiles[dsc_file];
match=1;
ifnotmatch:
self.reject("can not overwrite existing copy of '%s' already in the archive."%(dsc_file));
elifdsc_file[-12:]==".orig.tar.gz":
# Check in the pool
q=self.projectB.query("SELECT l.path, f.filename, l.type, f.id, l.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));