1 |
commit: cc7f820749411a2d8f2e3efff945837231bfd0eb |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu May 26 02:32:42 2011 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu May 26 02:32:42 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=cc7f8207 |
7 |
|
8 |
dblink.unmerge: always initialize myebuildpath |
9 |
|
10 |
This is required for the doebuild_environment() call. Also, set |
11 |
builddir_locked = True when appropriate. |
12 |
|
13 |
--- |
14 |
pym/portage/dbapi/vartree.py | 15 +++++---------- |
15 |
1 files changed, 5 insertions(+), 10 deletions(-) |
16 |
|
17 |
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py |
18 |
index 47952e7..976d8e3 100644 |
19 |
--- a/pym/portage/dbapi/vartree.py |
20 |
+++ b/pym/portage/dbapi/vartree.py |
21 |
@@ -1655,13 +1655,12 @@ class dblink(object): |
22 |
contents = self.getcontents() |
23 |
# Now, don't assume that the name of the ebuild is the same as the |
24 |
# name of the dir; the package may have been moved. |
25 |
- myebuildpath = None |
26 |
+ myebuildpath = os.path.join(self.dbdir, self.pkg + ".ebuild") |
27 |
failures = 0 |
28 |
ebuild_phase = "prerm" |
29 |
mystuff = os.listdir(self.dbdir) |
30 |
for x in mystuff: |
31 |
if x.endswith(".ebuild"): |
32 |
- myebuildpath = os.path.join(self.dbdir, self.pkg + ".ebuild") |
33 |
if x[:-7] != self.pkg: |
34 |
# Clean up after vardbapi.move_ent() breakage in |
35 |
# portage versions before 2.1.2 |
36 |
@@ -1697,6 +1696,7 @@ class dblink(object): |
37 |
scheduler=scheduler, |
38 |
settings=self.settings) |
39 |
builddir_lock.lock() |
40 |
+ builddir_locked = True |
41 |
prepare_build_dirs(settings=self.settings, cleanup=True) |
42 |
log_path = self.settings.get("PORTAGE_LOG_FILE") |
43 |
|
44 |
@@ -1710,7 +1710,7 @@ class dblink(object): |
45 |
level=logging.ERROR, noiselevel=-1) |
46 |
showMessage(_unicode_decode("%s\n") % (eapi_unsupported,), |
47 |
level=logging.ERROR, noiselevel=-1) |
48 |
- elif myebuildpath: |
49 |
+ elif os.path.isfile(myebuildpath): |
50 |
phase = EbuildPhase(background=background, |
51 |
phase=ebuild_phase, scheduler=scheduler, |
52 |
settings=self.settings) |
53 |
@@ -1730,7 +1730,7 @@ class dblink(object): |
54 |
self.vartree.dbapi._fs_unlock() |
55 |
self._clear_contents_cache() |
56 |
|
57 |
- if myebuildpath and not eapi_unsupported: |
58 |
+ if not eapi_unsupported and os.path.isfile(myebuildpath): |
59 |
ebuild_phase = "postrm" |
60 |
phase = EbuildPhase(background=background, |
61 |
phase=ebuild_phase, scheduler=scheduler, |
62 |
@@ -1748,7 +1748,7 @@ class dblink(object): |
63 |
self.vartree.dbapi._bump_mtime(self.mycpv) |
64 |
if builddir_locked: |
65 |
try: |
66 |
- if myebuildpath and not eapi_unsupported: |
67 |
+ if not eapi_unsupported and os.path.isfile(myebuildpath): |
68 |
if retval != os.EX_OK: |
69 |
msg_lines = [] |
70 |
msg = _("The '%(ebuild_phase)s' " |
71 |
@@ -1790,11 +1790,6 @@ class dblink(object): |
72 |
self._elog_process(phasefilter=("prerm", "postrm")) |
73 |
|
74 |
if retval == os.EX_OK and builddir_locked: |
75 |
- # myebuildpath might be None, so ensure |
76 |
- # it has a sane value for the clean phase, |
77 |
- # even though it won't really be sourced. |
78 |
- myebuildpath = os.path.join(self.dbdir, |
79 |
- self.pkg + ".ebuild") |
80 |
try: |
81 |
doebuild_environment(myebuildpath, "cleanrm", |
82 |
settings=self.settings, db=self.vartree.dbapi) |