X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=dak%2Fprocess_upload.py;h=9bb04a33e8b76c6c70bc89909b035f96b5bbd4c8;hb=29586333f60d53b4a1d4e8c3580ae5c3256c8bd9;hp=e3a19ac31609a3b866e09694e3d44660a6b05b7d;hpb=b2cd3d45ab3962eb4a2ccbefd3882654217a184c;p=dak.git diff --git a/dak/process_upload.py b/dak/process_upload.py index e3a19ac3..9bb04a33 100755 --- a/dak/process_upload.py +++ b/dak/process_upload.py @@ -166,6 +166,7 @@ def usage (exit_code=0): def action(u): cnf = Config() + holding = Holding() # changes["distribution"] may not exist in corner cases # (e.g. unreadable changes files) @@ -220,12 +221,12 @@ def action(u): os.chdir(u.pkg.directory) u.do_reject(0, pi) elif answer == 'A': - u.pkg.add_known_changes( "Accepted" ) + u.pkg.add_known_changes(holding.holding_dir) u.accept(summary, short_summary) u.check_override() u.remove() elif answer == queuekey: - u.pkg.add_known_changes( qu ) + u.pkg.add_known_changes(holding.holding_dir) QueueInfo[qu]["process"](u, summary, short_summary) u.remove() elif answer == 'Q': @@ -233,6 +234,11 @@ def action(u): ############################################################################### +def cleanup(): + h = Holding() + if not Options["No-Action"]: + h.clean() + def process_it(changes_file): global Logger @@ -302,12 +308,14 @@ def process_it(changes_file): action(u) except (SystemExit, KeyboardInterrupt): + cleanup() raise except: print "ERROR" traceback.print_exc(file=sys.stderr) + cleanup() # Restore previous WD os.chdir(u.prevdir)