summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/emerge10
-rw-r--r--pym/portage.py2
2 files changed, 12 insertions, 0 deletions
diff --git a/bin/emerge b/bin/emerge
index 93ec0706b..326c6c57c 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -715,6 +715,11 @@ class FakeVartree(portage.vartree):
self.settings = real_vartree.settings
self.dbapi = portage.fakedbapi(settings=real_vartree.settings)
vdb_path = os.path.join(self.root, portage.VDB_PATH)
+ 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 os.access(vdb_path, os.W_OK):
@@ -2759,6 +2764,11 @@ def unmerge(settings, myopts, vartree, unmerge_action, unmerge_files,
xterm_titles = "notitles" not in settings.features
vdb_path = os.path.join(settings["ROOT"], portage.VDB_PATH)
+ 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 os.access(vdb_path, os.W_OK):
diff --git a/pym/portage.py b/pym/portage.py
index 96a1ca466..2dc16e016 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -6201,6 +6201,8 @@ class dblink:
def lockdb(self):
if self._lock_vdb:
raise AssertionError("Lock already held.")
+ # At least the parent needs to exist for the lock file.
+ portage_util.ensure_dirs(self.dbroot)
self._lock_vdb = portage_locks.lockdir(self.dbroot)
def unlockdb(self):