Browse Source

utils: Let mkdirhier fail if existing path is not a folder

Let mkdirhier fail if existing path is not a folder instead of assuming a
directory hierarchy already exists.

Signed-off-by: Andre Rosa <andre.rosa@lge.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Andre Rosa 5 years ago
parent
commit
a8d9b82ccf
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lib/bb/utils.py

+ 1 - 1
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):