X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Fqueue.py;h=8acfb4e7f198803d3f914c97c1e22df8a3f48b2f;hb=e2e147e37599884d1a323d39b07e6a174bf79e41;hp=ce6ecdf6b2f5cf655d44b84da93c7cd1f8cb0a44;hpb=f8f0c97694e006b9ecf819bc0a6b6c112c617089;p=dak.git diff --git a/daklib/queue.py b/daklib/queue.py index ce6ecdf6..8acfb4e7 100755 --- a/daklib/queue.py +++ b/daklib/queue.py @@ -386,8 +386,9 @@ def edit_note(note, upload, session, trainee=False): ############################################################################### +# FIXME: Should move into the database # suite names DMs can upload to -dm_suites = ['unstable', 'experimental'] +dm_suites = ['unstable', 'experimental', 'squeeze-backports'] def get_newest_source(source, session): 'returns the newest DBSource object in dm_suites' @@ -1657,6 +1658,9 @@ class Upload(object): self.rejects.append("%s: deb contents timestamp check failed [%s: %s]" % (filename, sys.exc_info()[0], sys.exc_info()[1])) def check_if_upload_is_sponsored(self, uid_email, uid_name): + for key in "maintaineremail", "changedbyemail", "maintainername", "changedbyname": + if not self.pkg.changes.has_key(key): + return False uid_email = '@'.join(uid_email.split('@')[:2]) if uid_email in [self.pkg.changes["maintaineremail"], self.pkg.changes["changedbyemail"]]: sponsored = False @@ -1804,7 +1808,7 @@ class Upload(object): r = get_newest_source(self.pkg.changes["source"], session) if r is None: - rej = "Could not find existing source package %s in unstable or experimental and this is a DM upload" % self.pkg.changes["source"] + rej = "Could not find existing source package %s in the DM allowed suites and this is a DM upload" % self.pkg.changes["source"] self.rejects.append(rej) return @@ -1930,8 +1934,7 @@ transition is done.""" # This is for direport's benefit... f = re_fdnic.sub("\n .\n", self.pkg.changes.get("changes", "")) - if byhand or new: - summary += "Changes: " + f + summary += "\n\nChanges:\n" + f summary += "\n\nOverride entries for your package:\n" + override_summary + "\n" @@ -2422,11 +2425,15 @@ distribution.""" reason_filename = self.pkg.changes_file[:-8] + ".reason" reason_filename = os.path.join(cnf["Dir::Reject"], reason_filename) + changesfile = os.path.join(cnf["Dir::Reject"], self.pkg.changes_file) # Move all the files into the reject directory reject_files = self.pkg.files.keys() + [self.pkg.changes_file] self.force_reject(reject_files) + # Change permissions of the .changes file to be world readable + os.chmod(changesfile, os.stat(changesfile).st_mode | stat.S_IROTH) + # If we fail here someone is probably trying to exploit the race # so let's just raise an exception ... if os.path.exists(reason_filename):