X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fprocess_upload.py;h=13474071c34600cb82d3eae1d7a1e37df857ef21;hb=066d01be84db56933591117e616ac35203dffd18;hp=33fff0dc8059af7834b94619b8c402cccc2e31e2;hpb=92aa9900e274b4c0ca24d1ae3a7cbabca0d21c5f;p=dak.git diff --git a/dak/process_upload.py b/dak/process_upload.py index 33fff0dc..13474071 100755 --- a/dak/process_upload.py +++ b/dak/process_upload.py @@ -176,6 +176,7 @@ from daklib.urgencylog import UrgencyLog from daklib.summarystats import SummaryStats from daklib.holding import Holding from daklib.config import Config +from daklib.regexes import re_match_expired ############################################################################### @@ -196,6 +197,15 @@ def usage (exit_code=0): ############################################################################### +def byebye(): + if not Options["No-Action"]: + # Clean out the queue files + session = DBConn().session() + session.execute("DELETE FROM changes_pending_files WHERE id NOT IN (SELECT file_id FROM changes_pending_files_map )") + session.commit() + + + def action(u, session): cnf = Config() holding = Holding() @@ -249,7 +259,7 @@ def action(u, session): for s in u.pkg.changes["distribution"].keys(): suite = get_suite(s, session) if suite.policy_queue: - if not chg or chg.approved_for_id != su.policy_queue.policy_queue_id: + if not chg or chg.approved_for_id != suite.policy_queue.policy_queue_id: # This routine will check whether the upload is a binary # upload when the source is already in the target suite. If # so, we skip the policy queue, otherwise we go there. @@ -284,6 +294,7 @@ def action(u, session): elif answer == 'A': if not chg: chg = u.pkg.add_known_changes(holding.holding_dir, session=session) + session.commit() u.accept(summary, short_summary, session) u.check_override() chg.clean_from_queue() @@ -302,6 +313,7 @@ def action(u, session): session.commit() u.remove() elif answer == 'Q': + byebye() sys.exit(0) session.commit() @@ -367,6 +379,12 @@ def process_it(changes_file, session): if u.pkg.changes["fingerprint"]: valid_changes_p = u.load_changes(changespath) else: + for reason in rejects: + if re_match_expired.match(reason): + # Hrm, key expired. Lets see if we can still parse the .changes before + # we reject. Then we would be able to mail the maintainer, instead of + # just silently dropping the upload. + u.load_changes(changespath) valid_changes_p = False u.rejects.extend(rejects) @@ -376,8 +394,9 @@ def process_it(changes_file, session): valid_dsc_p = u.check_dsc(not Options["No-Action"]) if valid_dsc_p and not Options["No-Action"]: u.check_source() - u.check_lintian() u.check_hashes() + if valid_dsc_p and not Options["No-Action"] and not len(u.rejects): + u.check_lintian() u.check_urgency() u.check_timestamps() u.check_signed_by_key() @@ -482,14 +501,12 @@ def main(): utils.size_type(int(summarystats.accept_bytes))) Logger.log(["total", summarystats.accept_count, summarystats.accept_bytes]) - if not Options["No-Action"]: - # Clean out the queue files - session = DBConn().session() - session.execute("DELETE FROM changes_pending_files WHERE id NOT IN (SELECT file_id FROM changes_pending_files_map )") - session.commit() + byebye() + if not Options["No-Action"]: if log_urgency: UrgencyLog().close() + Logger.close() ###############################################################################