From: Zac Medico Date: Thu, 17 Nov 2011 05:15:00 +0000 (-0800) Subject: pkg_pretend: handle interruption more X-Git-Tag: v2.2.0_alpha75 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=39dfd5bf7b0c26c05b568c4538fc85bb9fe3b116;p=portage.git pkg_pretend: handle interruption more --- diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py index 261fa9569..3b53a3723 100644 --- a/pym/_emerge/Scheduler.py +++ b/pym/_emerge/Scheduler.py @@ -927,6 +927,7 @@ class Scheduler(PollScheduler): build_dir = EbuildBuildDir(scheduler=sched_iface, settings=settings) build_dir.lock() + current_task = None try: @@ -935,6 +936,7 @@ class Scheduler(PollScheduler): if existing_buildir: clean_phase = EbuildPhase(background=False, phase='clean', scheduler=sched_iface, settings=settings) + current_task = clean_phase clean_phase.start() clean_phase.wait() @@ -956,6 +958,7 @@ class Scheduler(PollScheduler): verifier = BinpkgVerifier(pkg=x, scheduler=sched_iface) + current_task = verifier verifier.start() if verifier.wait() != os.EX_OK: failures += 1 @@ -998,12 +1001,15 @@ class Scheduler(PollScheduler): phase="pretend", scheduler=sched_iface, settings=settings) + current_task = pretend_phase pretend_phase.start() ret = pretend_phase.wait() if ret != os.EX_OK: failures += 1 portage.elog.elog_process(x.cpv, settings) finally: + if current_task is not None and current_task.isAlive(): + current_task.cancel() clean_phase = EbuildPhase(background=False, phase='clean', scheduler=sched_iface, settings=settings) clean_phase.start()