summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid James <davidjames@chromium.org>2011-05-07 23:08:01 -0700
committerZac Medico <zmedico@gentoo.org>2011-05-08 11:54:30 -0700
commit1c8ec672ea685d346e355b7e44416b2258bc66bd (patch)
tree80c2e74fd49056d1e55fece97c0dd2e2b601ee67
parent87077a5c26fb164e7db172b380111694855bc4a0 (diff)
downloadportage-1c8ec672ea685d346e355b7e44416b2258bc66bd.tar.gz
portage-1c8ec672ea685d346e355b7e44416b2258bc66bd.tar.bz2
portage-1c8ec672ea685d346e355b7e44416b2258bc66bd.zip
Use new vardbapi lock function in FakeVartree.
BUG=none TEST=Merged some packages with new code. Ran test suite. Change-Id: Ibb9380122631bf6c79e39691233cfd641931b75a
-rw-r--r--pym/_emerge/FakeVartree.py17
1 files changed, 6 insertions, 11 deletions
diff --git a/pym/_emerge/FakeVartree.py b/pym/_emerge/FakeVartree.py
index 919770baf..db31535a6 100644
--- a/pym/_emerge/FakeVartree.py
+++ b/pym/_emerge/FakeVartree.py
@@ -116,20 +116,15 @@ class FakeVartree(vartree):
after one or more packages may have been installed or
uninstalled.
"""
- vdb_path = os.path.join(self.settings['EROOT'], portage.VDB_PATH)
+ locked = False
try:
- # At least the parent needs to exist for the lock file.
- portage.util.ensure_dirs(vdb_path)
- except portage.exception.PortageException:
- pass
- vdb_lock = None
- try:
- if acquire_lock and os.access(vdb_path, os.W_OK):
- vdb_lock = portage.locks.lockdir(vdb_path)
+ if acquire_lock and os.access(self._real_vardb._dbroot, os.W_OK):
+ self._real_vardb.lock()
+ locked = True
self._sync()
finally:
- if vdb_lock:
- portage.locks.unlockdir(vdb_lock)
+ if locked:
+ self._real_vardb.unlock()
# Populate the old-style virtuals using the cached values.
# Skip the aux_get wrapper here, to avoid unwanted