X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Fqueue.py;h=c9a653288e8a2b49d29f6ea28cb6e423c9ddc9fb;hb=c89c97e5d1c9aa97eaa3f3e4f54c02eda2725674;hp=a91bcdfae302d5ab5d13a9cfd8f89ea51af13f8e;hpb=fbcd49ef6c53529a01f0c890ff0132996b386e5c;p=dak.git diff --git a/daklib/queue.py b/daklib/queue.py index a91bcdfa..c9a65328 100755 --- a/daklib/queue.py +++ b/daklib/queue.py @@ -115,8 +115,8 @@ def determine_new(changes, files, warn=1): # Build up a list of potentially new things for name, f in files.items(): # Skip byhand elements - if f["type"] == "byhand": - continue +# if f["type"] == "byhand": +# continue pkg = f["package"] priority = f["priority"] section = f["section"] @@ -218,7 +218,7 @@ def check_valid(new): def check_status(files): new = byhand = 0 for f in files.keys(): - if files[f]["type"] == "byhand": + if files[f].has_key("byhand"): byhand = 1 elif files[f].has_key("new"): new = 1 @@ -427,7 +427,7 @@ class Upload(object): self.pkg.changes["changedbyemail"] = "" self.rejects.append("%s: Changed-By field ('%s') failed to parse: %s" \ - % (filename, changes["changed-by"], msg)) + % (filename, self.pkg.changes["changed-by"], msg)) # Ensure all the values in Closes: are numbers if self.pkg.changes.has_key("closes"): @@ -661,7 +661,7 @@ class Upload(object): entry["new"] = 1 else: dsc_file_exists = False - for myq in ["Accepted", "Embargoed", "Unembargoed", "ProposedUpdates", "OldProposedUpdates"]: + for myq in ["Embargoed", "Unembargoed", "ProposedUpdates", "OldProposedUpdates"]: if cnf.has_key("Dir::Queue::%s" % (myq)): if os.path.exists(os.path.join(cnf["Dir::Queue::" + myq], dsc_filename)): dsc_file_exists = True @@ -820,7 +820,7 @@ class Upload(object): # if in the pool or in a queue other than unchecked, reject if (dbc.in_queue is None) \ or (dbc.in_queue is not None - and dbc.in_queue.queue_name != 'unchecked'): + and dbc.in_queue.queue_name not in ["unchecked", "newstage"]): self.rejects.append("%s file already known to dak" % base_filename) except NoResultFound, e: # not known, good @@ -1225,7 +1225,7 @@ class Upload(object): continue # Look in some other queues for the file - queues = ('Accepted', 'New', 'Byhand', 'ProposedUpdates', + queues = ('New', 'Byhand', 'ProposedUpdates', 'OldProposedUpdates', 'Embargoed', 'Unembargoed') for queue in queues: @@ -1445,16 +1445,15 @@ class Upload(object): self.check_dm_upload(fpr, session) else: # Check source-based permissions for other types - if self.pkg.changes["architecture"].has_key("source"): - if fpr.source_acl.access_level is None: - rej = 'Fingerprint %s may not upload source' % fpr.fingerprint - rej += '\nPlease contact ftpmaster if you think this is incorrect' - self.rejects.append(rej) - return - else: - # If not a DM, we allow full upload rights - uid_email = "%s@debian.org" % (fpr.uid.uid) - self.check_if_upload_is_sponsored(uid_email, fpr.uid.name) + if self.pkg.changes["architecture"].has_key("source") and \ + fpr.source_acl.access_level is None: + rej = 'Fingerprint %s may not upload source' % fpr.fingerprint + rej += '\nPlease contact ftpmaster if you think this is incorrect' + self.rejects.append(rej) + return + # If not a DM, we allow full upload rights + uid_email = "%s@debian.org" % (fpr.uid.uid) + self.check_if_upload_is_sponsored(uid_email, fpr.uid.name) # Check binary upload permissions @@ -2139,6 +2138,7 @@ distribution.""" user_email_address = utils.whoami() + " <%s>" % (cnf["Dinstall::MyAdminAddress"]) self.Subst["__REJECTOR_ADDRESS__"] = user_email_address self.Subst["__MANUAL_REJECT_MESSAGE__"] = reject_message + self.Subst["__REJECT_MESSAGE__"] = "" self.Subst["__CC__"] = "Cc: " + cnf["Dinstall::MyEmailAddress"] reject_mail_message = utils.TemplateSubst(self.Subst, rej_template) # Write the rejection email out as the .reason file @@ -2307,7 +2307,7 @@ distribution.""" cansave = 1 if not cansave: - self.reject.append("%s: old version (%s) in %s <= new version (%s) targeted at %s." % (filename, existent_version, suite, new_version, target_suite)) + self.rejects.append("%s: old version (%s) in %s <= new version (%s) targeted at %s." % (filename, existent_version, suite, new_version, target_suite)) ################################################################################ def check_binary_against_db(self, filename, session): @@ -2453,7 +2453,7 @@ distribution.""" else: # TODO: Record the queues and info in the DB so we don't hardcode all this crap # Not there? Check the queue directories... - for directory in [ "Accepted", "New", "Byhand", "ProposedUpdates", "OldProposedUpdates", "Embargoed", "Unembargoed" ]: + for directory in [ "New", "Byhand", "ProposedUpdates", "OldProposedUpdates", "Embargoed", "Unembargoed" ]: if not Cnf.has_key("Dir::Queue::%s" % (directory)): continue in_otherdir = os.path.join(Cnf["Dir::Queue::%s" % (directory)], dsc_name) @@ -2502,7 +2502,7 @@ distribution.""" source_epochless_version = re_no_epoch.sub('', source_version) dsc_filename = "%s_%s.dsc" % (source_package, source_epochless_version) found = False - for q in ["Accepted", "Embargoed", "Unembargoed", "Newstage"]: + for q in ["Embargoed", "Unembargoed", "Newstage"]: if cnf.has_key("Dir::Queue::%s" % (q)): if os.path.exists(cnf["Dir::Queue::%s" % (q)] + '/' + dsc_filename): found = True