[bitbake-devel] [PATCH] utils: Let makedirhier fail if existing path is not a folder

andre.rosa andre.rosa at lge.com
Thu Apr 11 20:20:54 UTC 2019


From: Andre Rosa <andre.rosa at lge.com>

... instead of assuming a directory hierarchy is there or was created.

Signed-off-by: Andre Rosa <andre.rosa at lge.com>
---
 lib/bb/utils.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/bb/utils.py b/lib/bb/utils.py index d186b1fa..a3f75fbe 100644
--- a/lib/bb/utils.py
+++ b/lib/bb/utils.py
@@ -734,7 +734,7 @@ def mkdirhier(directory):
     try:
         os.makedirs(directory)
     except OSError as e:
-        if e.errno != errno.EEXIST:
+        if e.errno != errno.EEXIST or not os.path.isdir(directory):
             raise e
 
 def movefile(src, dest, newmtime = None, sstat = None):
--
2.20.1.519.g8feddda32c



More information about the bitbake-devel mailing list