From: Zac Medico Date: Wed, 1 Sep 2010 06:00:53 +0000 (-0700) Subject: In dblink.mergeme(), handle EISDIR which can be raised from mkdir calls X-Git-Tag: v2.2_rc73~8 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4dbb985f80ca6c175975579e7e5073e500f350a8;p=portage.git In dblink.mergeme(), handle EISDIR which can be raised from mkdir calls on FreeBSD (see bug #187518). --- 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):