1 |
commit: e414b8571fed1e0da1a03e0a9719b580e21f7558 |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun May 8 04:34:25 2011 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun May 8 04:34:25 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e414b857 |
7 |
|
8 |
Rename FEATURES=no-ebuild-locks to ebuild-locks. |
9 |
|
10 |
--- |
11 |
cnf/make.globals | 2 +- |
12 |
man/make.conf.5 | 4 ++++ |
13 |
pym/_emerge/EbuildPhase.py | 13 ++++++++----- |
14 |
pym/portage/const.py | 4 ++-- |
15 |
4 files changed, 15 insertions(+), 8 deletions(-) |
16 |
|
17 |
diff --git a/cnf/make.globals b/cnf/make.globals |
18 |
index bcad5de..2258fd2 100644 |
19 |
--- a/cnf/make.globals |
20 |
+++ b/cnf/make.globals |
21 |
@@ -51,7 +51,7 @@ RESUMECOMMAND_SSH=${FETCHCOMMAND_SSH} |
22 |
FETCHCOMMAND_SFTP="bash -c \"x=\\\${2#sftp://} ; host=\\\${x%%/*} ; port=\\\${host##*:} ; host=\\\${host%:*} ; [[ \\\${host} = \\\${port} ]] && port=22 ; exec sftp -P \\\${port} \\\"\\\${host}:/\\\${x#*/}\\\" \\\"\\\$1\\\"\" sftp \"\${DISTDIR}/\${FILE}\" \"\${URI}\"" |
23 |
|
24 |
# Default user options |
25 |
-FEATURES="assume-digests binpkg-logs distlocks fixpackages |
26 |
+FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixpackages |
27 |
fixlafiles news parallel-fetch protect-owned |
28 |
sandbox sfperms strict unknown-features-warn unmerge-logs |
29 |
unmerge-orphans userfetch" |
30 |
|
31 |
diff --git a/man/make.conf.5 b/man/make.conf.5 |
32 |
index 1692969..389bab1 100644 |
33 |
--- a/man/make.conf.5 |
34 |
+++ b/man/make.conf.5 |
35 |
@@ -265,6 +265,10 @@ strangely configured Samba server (oplocks off, NFS re\-export). A tool |
36 |
/usr/lib/portage/bin/clean_locks exists to help handle lock issues |
37 |
when a problem arises (normally due to a crash or disconnect). |
38 |
.TP |
39 |
+.B ebuild\-locks |
40 |
+Use locks to ensure that unsandboxed ebuild phases never execute |
41 |
+concurrently. |
42 |
+.TP |
43 |
.B fakeroot |
44 |
Enable fakeroot for the install and package phases when a non-root user runs |
45 |
the \fBebuild\fR(1) command. |
46 |
|
47 |
diff --git a/pym/_emerge/EbuildPhase.py b/pym/_emerge/EbuildPhase.py |
48 |
index 77b3a4d..e75673c 100644 |
49 |
--- a/pym/_emerge/EbuildPhase.py |
50 |
+++ b/pym/_emerge/EbuildPhase.py |
51 |
@@ -30,7 +30,8 @@ from portage import _unicode_encode |
52 |
|
53 |
class EbuildPhase(CompositeTask): |
54 |
|
55 |
- __slots__ = ("actionmap", "ebuild_lock", "phase", "settings") |
56 |
+ __slots__ = ("actionmap", "phase", "settings") + \ |
57 |
+ ("_ebuild_lock",) |
58 |
|
59 |
# FEATURES displayed prior to setup phase |
60 |
_features_display = ("ccache", "distcc", "fakeroot", |
61 |
@@ -144,16 +145,18 @@ class EbuildPhase(CompositeTask): |
62 |
settings=self.settings) |
63 |
|
64 |
if (self.phase in self._locked_phases and |
65 |
- "no-ebuild-locks" not in self.settings.features): |
66 |
+ "ebuild-locks" in self.settings.features): |
67 |
root = self.settings["ROOT"] |
68 |
lock_path = os.path.join(root, portage.VDB_PATH + "-ebuild") |
69 |
- self.ebuild_lock = lockdir(lock_path) |
70 |
+ if os.access(os.path.dirname(lock_path), os.W_OK): |
71 |
+ self._ebuild_lock = lockdir(lock_path) |
72 |
self._start_task(ebuild_process, self._ebuild_exit) |
73 |
|
74 |
def _ebuild_exit(self, ebuild_process): |
75 |
|
76 |
- if self.ebuild_lock: |
77 |
- unlockdir(self.ebuild_lock) |
78 |
+ if self._ebuild_lock is not None: |
79 |
+ unlockdir(self._ebuild_lock) |
80 |
+ self._ebuild_lock = None |
81 |
|
82 |
fail = False |
83 |
if self._default_exit(ebuild_process) != os.EX_OK: |
84 |
|
85 |
diff --git a/pym/portage/const.py b/pym/portage/const.py |
86 |
index dbbaa3e..0bd56b2 100644 |
87 |
--- a/pym/portage/const.py |
88 |
+++ b/pym/portage/const.py |
89 |
@@ -88,11 +88,11 @@ EBUILD_PHASES = ("pretend", "setup", "unpack", "prepare", "configure" |
90 |
SUPPORTED_FEATURES = frozenset([ |
91 |
"assume-digests", "binpkg-logs", "buildpkg", "buildsyspkg", "candy", |
92 |
"ccache", "chflags", "collision-protect", "compress-build-logs", |
93 |
- "digest", "distcc", "distlocks", "fakeroot", |
94 |
+ "digest", "distcc", "distlocks", "ebuild-locks", "fakeroot", |
95 |
"fail-clean", "fixpackages", "force-mirror", "getbinpkg", |
96 |
"installsources", "keeptemp", "keepwork", "fixlafiles", "lmirror", |
97 |
"metadata-transfer", "mirror", "multilib-strict", "news", |
98 |
- "no-ebuild-locks", "noauto", "noclean", "nodoc", "noinfo", "noman", |
99 |
+ "noauto", "noclean", "nodoc", "noinfo", "noman", |
100 |
"nostrip", "notitles", "parallel-fetch", "parse-eapi-ebuild-head", |
101 |
"prelink-checksums", "preserve-libs", |
102 |
"protect-owned", "python-trace", "sandbox", |