summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/portage/dbapi/vartree.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index 0079e4f3e..159871bc3 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -3723,9 +3723,13 @@ class dblink(object):
# write out our collection of md5sums
if cfgfiledict != cfgfiledict_orig:
cfgfiledict.pop("IGNORE", None)
- ensure_dirs(os.path.dirname(self.vartree.dbapi._conf_mem_file),
- gid=portage_gid, mode=0o2750, mask=0o2)
- writedict(cfgfiledict, self.vartree.dbapi._conf_mem_file)
+ try:
+ writedict(cfgfiledict, self.vartree.dbapi._conf_mem_file)
+ except IOError as e:
+ if e.errno != errno.ENOENT:
+ raise
+ self.settings._init_dirs()
+ writedict(cfgfiledict, self.vartree.dbapi._conf_mem_file)
return os.EX_OK