summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-05-24 22:01:35 -0700
committerZac Medico <zmedico@gentoo.org>2011-05-25 23:12:38 -0700
commit268f176c75d6a8b4f92efbfa7e8367f1d63d8889 (patch)
treed251d327bda15171e1e5c63222e5aecb7832c51d
parent689fd034c812c7a64be64f34b50026472d766579 (diff)
downloadportage-268f176c75d6a8b4f92efbfa7e8367f1d63d8889.tar.gz
portage-268f176c75d6a8b4f92efbfa7e8367f1d63d8889.tar.bz2
portage-268f176c75d6a8b4f92efbfa7e8367f1d63d8889.zip
dblink: use config._init_dirs() when necessary
-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 aa57ab74f..1c0890683 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -3637,9 +3637,13 @@ class dblink(object):
# write out our collection of md5sums
if cfgfiledict != cfgfiledict_orig:
cfgfiledict.pop("IGNORE", None)
- ensure_dirs(os.path.dirname(conf_mem_file),
- gid=portage_gid, mode=0o2750, mask=0o2)
- writedict(cfgfiledict, conf_mem_file)
+ try:
+ writedict(cfgfiledict, conf_mem_file)
+ except IOError as e:
+ if e.errno != errno.ENOENT:
+ raise
+ self.settings._init_dirs()
+ writedict(cfgfiledict, conf_mem_file)
return os.EX_OK