1 |
commit: b552912a54d0240325c1b3b8bef744ea04a513f8 |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Nov 17 03:43:00 2011 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Nov 17 03:43:00 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b552912a |
7 |
|
8 |
pkg_pretend: tweak final cleanup logic |
9 |
|
10 |
This ensures that the clean phase will not run if the user interrupts |
11 |
emerge before the build dir is locked. |
12 |
|
13 |
--- |
14 |
pym/_emerge/Scheduler.py | 20 +++++++++----------- |
15 |
1 files changed, 9 insertions(+), 11 deletions(-) |
16 |
|
17 |
diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py |
18 |
index fb8fdfb..261fa95 100644 |
19 |
--- a/pym/_emerge/Scheduler.py |
20 |
+++ b/pym/_emerge/Scheduler.py |
21 |
@@ -923,13 +923,12 @@ class Scheduler(PollScheduler): |
22 |
os.path.realpath(settings["PORTAGE_TMPDIR"]), |
23 |
"portage", x.category, x.pf) |
24 |
existing_buildir = os.path.isdir(build_dir_path) |
25 |
- build_dir = None |
26 |
+ settings["PORTAGE_BUILDDIR"] = build_dir_path |
27 |
+ build_dir = EbuildBuildDir(scheduler=sched_iface, |
28 |
+ settings=settings) |
29 |
+ build_dir.lock() |
30 |
|
31 |
try: |
32 |
- settings["PORTAGE_BUILDDIR"] = build_dir_path |
33 |
- build_dir = EbuildBuildDir(scheduler=sched_iface, |
34 |
- settings=settings) |
35 |
- build_dir.lock() |
36 |
|
37 |
# Clean up the existing build dir, in case pkg_pretend |
38 |
# checks for available space (bug #390711). |
39 |
@@ -1005,12 +1004,11 @@ class Scheduler(PollScheduler): |
40 |
failures += 1 |
41 |
portage.elog.elog_process(x.cpv, settings) |
42 |
finally: |
43 |
- if build_dir is not None: |
44 |
- clean_phase = EbuildPhase(background=False, |
45 |
- phase='clean', scheduler=sched_iface, settings=settings) |
46 |
- clean_phase.start() |
47 |
- clean_phase.wait() |
48 |
- build_dir.unlock() |
49 |
+ clean_phase = EbuildPhase(background=False, |
50 |
+ phase='clean', scheduler=sched_iface, settings=settings) |
51 |
+ clean_phase.start() |
52 |
+ clean_phase.wait() |
53 |
+ build_dir.unlock() |
54 |
|
55 |
if failures: |
56 |
return 1 |