buildman: Create parent directories as necessary
When creating build directories also create parents as necessary. This fixes a failure when building a hierarchical branch (i.e. foo/bar). Signed-off-by: Thierry Reding <treding@nvidia.com> Acked-by: Simon Glass <sjg@chromium.org> Tested-by: Tom Rini <trini@ti.com>
This commit is contained in:

committed by
Simon Glass

parent
1f7278851e
commit
f3d015cb4a
@@ -12,14 +12,17 @@ import threading
|
||||
import command
|
||||
import gitutil
|
||||
|
||||
def Mkdir(dirname):
|
||||
def Mkdir(dirname, parents = False):
|
||||
"""Make a directory if it doesn't already exist.
|
||||
|
||||
Args:
|
||||
dirname: Directory to create
|
||||
"""
|
||||
try:
|
||||
os.mkdir(dirname)
|
||||
if parents:
|
||||
os.makedirs(dirname)
|
||||
else:
|
||||
os.mkdir(dirname)
|
||||
except OSError as err:
|
||||
if err.errno == errno.EEXIST:
|
||||
pass
|
||||
|
Reference in New Issue
Block a user