summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-07-02 12:04:53 +0000
committerZac Medico <zmedico@gentoo.org>2008-07-02 12:04:53 +0000
commita33c0b63f0d4bb5a376c22c7594d93c75e0ece68 (patch)
treee52a4b6d37e5988e399d152cc6f96671a80bd7bc
parentfea7540d59c1533c435d4e1a26881e4b3a6d4c8d (diff)
downloadportage-a33c0b63f0d4bb5a376c22c7594d93c75e0ece68.tar.gz
portage-a33c0b63f0d4bb5a376c22c7594d93c75e0ece68.tar.bz2
portage-a33c0b63f0d4bb5a376c22c7594d93c75e0ece68.zip
Fix EbuildBuildDir so that it works properly with binary packages.
svn path=/main/trunk/; revision=10895
-rw-r--r--pym/_emerge/__init__.py35
1 files changed, 21 insertions, 14 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index 2e177ed20..66d06b370 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -1594,7 +1594,7 @@ class EbuildFetcherAsync(SubProcess):
class EbuildBuildDir(SlotObject):
- __slots__ = ("pkg", "settings",
+ __slots__ = ("dir_path", "pkg", "settings",
"locked", "_catdir", "_lock_obj")
def __init__(self, **kwargs):
@@ -1611,17 +1611,21 @@ class EbuildBuildDir(SlotObject):
if self._lock_obj is not None:
raise self.AlreadyLocked((self._lock_obj,))
- root_config = self.pkg.root_config
- portdb = root_config.trees["porttree"].dbapi
- ebuild_path = portdb.findname(self.pkg.cpv)
- settings = self.settings
- debug = settings.get("PORTAGE_DEBUG") == "1"
- use_cache = 1 # always true
-
- portage.doebuild_environment(ebuild_path, "setup", root_config.root,
- self.settings, debug, use_cache, portdb)
- catdir = os.path.dirname(settings["PORTAGE_BUILDDIR"])
+ dir_path = self.dir_path
+ if dir_path is None:
+ root_config = self.pkg.root_config
+ portdb = root_config.trees["porttree"].dbapi
+ ebuild_path = portdb.findname(self.pkg.cpv)
+ settings = self.settings
+ debug = settings.get("PORTAGE_DEBUG") == "1"
+ use_cache = 1 # always true
+ portage.doebuild_environment(ebuild_path, "setup", root_config.root,
+ self.settings, debug, use_cache, portdb)
+ dir_path = self.settings["PORTAGE_BUILDDIR"]
+
+ catdir = os.path.dirname(dir_path)
self._catdir = catdir
+
portage.util.ensure_dirs(os.path.dirname(catdir),
uid=portage.portage_uid, gid=portage.portage_gid,
mode=070, mask=0)
@@ -1631,8 +1635,7 @@ class EbuildBuildDir(SlotObject):
portage.util.ensure_dirs(catdir,
gid=portage.portage_gid,
mode=070, mask=0)
- self._lock_obj = portage.locks.lockdir(
- self.settings["PORTAGE_BUILDDIR"])
+ self._lock_obj = portage.locks.lockdir(dir_path)
finally:
self.locked = self._lock_obj is not None
if catdir_lock is not None:
@@ -2125,7 +2128,11 @@ class Binpkg(SlotObject):
(pkg_count.curval, pkg_count.maxval, pkg.cpv)
logger.log(msg, short_msg=short_msg)
- build_dir = EbuildBuildDir(pkg=pkg, settings=settings)
+ dir_path = os.path.join(settings["PORTAGE_TMPDIR"],
+ "portage", pkg.category, pkg.pf)
+ build_dir = EbuildBuildDir(dir_path=dir_path,
+ pkg=pkg, settings=settings)
+
try:
build_dir.lock()
merge = BinpkgMerge(find_blockers=find_blockers,