From 4dbb985f80ca6c175975579e7e5073e500f350a8 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 31 Aug 2010 23:00:53 -0700 Subject: [PATCH] In dblink.mergeme(), handle EISDIR which can be raised from mkdir calls on FreeBSD (see bug #187518). --- pym/portage/dbapi/vartree.py | 6 ++++-- pym/portage/util/__init__.py | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 4a95567b9..45ed955ed 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -3619,7 +3619,8 @@ class dblink(object): else: os.mkdir(mydest) except OSError as e: - if e.errno != errno.EEXIST: + if e.errno not in (errno.EEXIST, errno.EISDIR): + # Bug 187518 - sometimes mkdir raises EISDIR on FreeBSD raise del e @@ -3636,7 +3637,8 @@ class dblink(object): else: os.mkdir(mydest) except OSError as e: - if e.errno != errno.EEXIST: + if e.errno not in (errno.EEXIST, errno.EISDIR): + # Bug 187518 - sometimes mkdir raises EISDIR on FreeBSD raise del e os.chmod(mydest, mystat[0]) diff --git a/pym/portage/util/__init__.py b/pym/portage/util/__init__.py index 98ad7c205..2c22949a4 100644 --- a/pym/portage/util/__init__.py +++ b/pym/portage/util/__init__.py @@ -1055,6 +1055,7 @@ def ensure_dirs(dir_path, *args, **kwargs): except OSError as oe: func_call = "makedirs('%s')" % dir_path if oe.errno in (errno.EEXIST, errno.EISDIR): + # Bug 187518 - sometimes mkdir raises EISDIR on FreeBSD pass else: if os.path.isdir(dir_path): -- 2.26.2