From: Zac Medico Date: Wed, 25 May 2011 05:01:35 +0000 (-0700) Subject: dblink: use config._init_dirs() when necessary X-Git-Tag: v2.2.0_alpha36~4 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8f93d096a3838caf64f955bba6962b6ad0ff27fe;p=portage.git dblink: use config._init_dirs() when necessary --- 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