summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-09-01 09:00:48 -0700
committerZac Medico <zmedico@gentoo.org>2010-09-01 09:00:48 -0700
commit338dc567385c5dd247c80f60b663bb6c6894adae (patch)
tree1b1ba80de9196beaf5c52e8a72317b002953da1c
parent3fbba9970820512b6be02d73a90a2e579376e296 (diff)
downloadportage-338dc567385c5dd247c80f60b663bb6c6894adae.tar.gz
portage-338dc567385c5dd247c80f60b663bb6c6894adae.tar.bz2
portage-338dc567385c5dd247c80f60b663bb6c6894adae.zip
Make atomic directory creation code in dblink.mergeme() use equivalent
error handling to portage.util.ensure_dirs().
-rw-r--r--pym/portage/dbapi/vartree.py20
1 files changed, 16 insertions, 4 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index 45ed955ed..25956f198 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -3619,8 +3619,14 @@ class dblink(object):
else:
os.mkdir(mydest)
except OSError as e:
- if e.errno not in (errno.EEXIST, errno.EISDIR):
- # Bug 187518 - sometimes mkdir raises EISDIR on FreeBSD
+ # Error handling should be equivalent to
+ # portage.util.ensure_dirs() for cases
+ # like bug #187518.
+ if e.errno in (errno.EEXIST,):
+ pass
+ elif os.path.isdir(mydest):
+ pass
+ else:
raise
del e
@@ -3637,8 +3643,14 @@ class dblink(object):
else:
os.mkdir(mydest)
except OSError as e:
- if e.errno not in (errno.EEXIST, errno.EISDIR):
- # Bug 187518 - sometimes mkdir raises EISDIR on FreeBSD
+ # Error handling should be equivalent to
+ # portage.util.ensure_dirs() for cases
+ # like bug #187518.
+ if e.errno in (errno.EEXIST,):
+ pass
+ elif os.path.isdir(mydest):
+ pass
+ else:
raise
del e
os.chmod(mydest, mystat[0])