From 39dfd5bf7b0c26c05b568c4538fc85bb9fe3b116 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 16 Nov 2011 21:15:00 -0800 Subject: [PATCH] pkg_pretend: handle interruption more --- pym/_emerge/Scheduler.py | 6 ++++++ 1 file changed, 6 insertions(+) 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() -- 2.26.2