buildman: Create parent directories as necessary
PATCH 1/1 buildman: Create parent directories as necessary
From: Thierry Reding <[email protected]>
When creating build directories also create parents as necessary. This fixes a failure when building a hierarchical branch (i.e. foo/bar).
--- tools/buildman/builderthread.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/buildman/builderthread.py +1 -1
@@ -19,7 +19,7 @@ def Mkdir(dirname): dirname: Directory to create """ try: - os.mkdir(dirname) + os.makedirs(dirname) except OSError as err: if err.errno == errno.EEXIST: pass
Signature · 1 line
2.0.4
PATCH 1/1 buildman: Create parent directories as necessary
Hi Thierry,
Quoted 16 lines · Thierry Reding
From: Thierry Reding <[email protected]>
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 <[email protected]>--- tools/buildman/builderthread.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/buildman/builderthread.py +0
-0
tools/buildman/builderthread.py def Mkdir(dirname): · line 25
Quoted 8 lines
tools/buildman/builderthread.py +1
-1@@ -19,7 +19,7 @@ def Mkdir(dirname): dirname: Directory to create """ try: - os.mkdir(dirname) + os.makedirs(dirname) except OSError as err: if err.errno == errno.EEXIST: pass
Thanks for the patch, this problem does need fixing.
But this solution seems quite heavy-handed, as the problem only exits with the top-level directory. Instead, perhaps we could use os.makedirs() in Builder.__init__(). This would avoid sloppy directory creation later.
Regards,
Simon