Rename FEATURES=no-ebuild-locks to ebuild-locks.
authorZac Medico <zmedico@gentoo.org>
Sun, 8 May 2011 04:34:25 +0000 (21:34 -0700)
committerZac Medico <zmedico@gentoo.org>
Sun, 8 May 2011 04:34:25 +0000 (21:34 -0700)
cnf/make.globals
man/make.conf.5
pym/_emerge/EbuildPhase.py
pym/portage/const.py

index bcad5deb679b48a747ba9a5e42dbf2a410dd56a1..2258fd2f26625d6568916cc2bf7ad96eebe4147b 100644 (file)
@@ -51,7 +51,7 @@ RESUMECOMMAND_SSH=${FETCHCOMMAND_SSH}
 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}\""
 
 # Default user options
-FEATURES="assume-digests binpkg-logs distlocks fixpackages
+FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixpackages
           fixlafiles news parallel-fetch protect-owned
           sandbox sfperms strict unknown-features-warn unmerge-logs
           unmerge-orphans userfetch"
index 1692969700cb3767185878b1f1d37a0d036851f4..389bab1db17bde010afd24a6b73b12a06b23eb3c 100644 (file)
@@ -265,6 +265,10 @@ strangely configured Samba server (oplocks off, NFS re\-export). A tool
 /usr/lib/portage/bin/clean_locks exists to help handle lock issues
 when a problem arises (normally due to a crash or disconnect).
 .TP
+.B ebuild\-locks
+Use locks to ensure that unsandboxed ebuild phases never execute
+concurrently.
+.TP
 .B fakeroot
 Enable fakeroot for the install and package phases when a non-root user runs
 the \fBebuild\fR(1) command.
index 77b3a4d88beb9e59b698ba1a4ffdea5b2ff8d206..e75673c7c841d86f31796d2e8c59b3ece5708051 100644 (file)
@@ -30,7 +30,8 @@ from portage import _unicode_encode
 
 class EbuildPhase(CompositeTask):
 
-       __slots__ = ("actionmap", "ebuild_lock", "phase", "settings")
+       __slots__ = ("actionmap", "phase", "settings") + \
+               ("_ebuild_lock",)
 
        # FEATURES displayed prior to setup phase
        _features_display = ("ccache", "distcc", "fakeroot",
@@ -144,16 +145,18 @@ class EbuildPhase(CompositeTask):
                        settings=self.settings)
 
                if (self.phase in self._locked_phases and
-                       "no-ebuild-locks" not in self.settings.features):
+                       "ebuild-locks" in self.settings.features):
                        root = self.settings["ROOT"]
                        lock_path = os.path.join(root, portage.VDB_PATH + "-ebuild")
-                       self.ebuild_lock = lockdir(lock_path)
+                       if os.access(os.path.dirname(lock_path), os.W_OK):
+                               self._ebuild_lock = lockdir(lock_path)
                self._start_task(ebuild_process, self._ebuild_exit)
 
        def _ebuild_exit(self, ebuild_process):
 
-               if self.ebuild_lock:
-                       unlockdir(self.ebuild_lock)
+               if self._ebuild_lock is not None:
+                       unlockdir(self._ebuild_lock)
+                       self._ebuild_lock = None
 
                fail = False
                if self._default_exit(ebuild_process) != os.EX_OK:
index dbbaa3e862ee6dfc35d2f240c8bd0e1b772bdb14..0bd56b20f3493ab5be4051214617029f5dd913d3 100644 (file)
@@ -88,11 +88,11 @@ EBUILD_PHASES            = ("pretend", "setup", "unpack", "prepare", "configure"
 SUPPORTED_FEATURES       = frozenset([
                            "assume-digests", "binpkg-logs", "buildpkg", "buildsyspkg", "candy",
                            "ccache", "chflags", "collision-protect", "compress-build-logs",
-                           "digest", "distcc", "distlocks", "fakeroot",
+                           "digest", "distcc", "distlocks", "ebuild-locks", "fakeroot",
                            "fail-clean", "fixpackages", "force-mirror", "getbinpkg",
                            "installsources", "keeptemp", "keepwork", "fixlafiles", "lmirror",
                            "metadata-transfer", "mirror", "multilib-strict", "news",
-                           "no-ebuild-locks", "noauto", "noclean", "nodoc", "noinfo", "noman",
+                           "noauto", "noclean", "nodoc", "noinfo", "noman",
                            "nostrip", "notitles", "parallel-fetch", "parse-eapi-ebuild-head",
                            "prelink-checksums", "preserve-libs",
                            "protect-owned", "python-trace", "sandbox",