diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-11-02 09:05:31 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-11-02 09:05:31 +0000 |
commit | 17a7e0f55959964e3c35de8a12743070dd9b08cf (patch) | |
tree | 1df370074a5c951ba5a7cf175b12760bf81c4155 | |
parent | 73637d530d97987646ab6610c0f4744f18c5b2f6 (diff) | |
download | portage-17a7e0f55959964e3c35de8a12743070dd9b08cf.tar.gz portage-17a7e0f55959964e3c35de8a12743070dd9b08cf.tar.bz2 portage-17a7e0f55959964e3c35de8a12743070dd9b08cf.zip |
Bug #245231 - Make EbuildFetchPretend use a private temp directory in order
to avoid locking the main one.
svn path=/main/trunk/; revision=11796
-rw-r--r-- | pym/_emerge/__init__.py | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 52686e517..5c5eecbe6 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -1590,7 +1590,23 @@ class EbuildFetchPretend(SlotObject): def execute(self): # To spawn pkg_nofetch requires PORTAGE_BUILDDIR for # ensuring sane $PWD (bug #239560) and storing elog - # messages. + # messages. Use a private temp directory, in order + # to avoid locking the main one. + settings = self.settings + global_tmpdir = settings["PORTAGE_TMPDIR"] + from tempfile import mkdtemp + private_tmpdir = mkdtemp("", "._portage_fetch_.", global_tmpdir) + settings["PORTAGE_TMPDIR"] = private_tmpdir + settings.backup_changes("PORTAGE_TMPDIR") + try: + retval = self._execute() + finally: + settings["PORTAGE_TMPDIR"] = global_tmpdir + settings.backup_changes("PORTAGE_TMPDIR") + shutil.rmtree(private_tmpdir) + return retval + + def _execute(self): build_dir = EbuildBuildDir(pkg=self.pkg, settings=self.settings) build_dir.lock() build_dir.clean() @@ -2367,7 +2383,7 @@ class EbuildBuildDir(SlotObject): self._catdir = catdir portage.util.ensure_dirs(os.path.dirname(catdir), - uid=portage.portage_uid, gid=portage.portage_gid, + gid=portage.portage_gid, mode=070, mask=0) catdir_lock = None try: |