[U-Boot] [PATCH] buildman: Create parent directories as necessary

Simon Glass sjg at chromium.org
Mon Aug 18 18:42:14 CEST 2014


Hi Thierry,

On 18 August 2014 00:54, Thierry Reding <thierry.reding at gmail.com> wrote:
>
> From: Thierry Reding <treding at nvidia.com>
>
> 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 at nvidia.com>
> ---
>  tools/buildman/builderthread.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py
> index 32297e20e8f0..ca309c46d963 100644
> --- a/tools/buildman/builderthread.py
> +++ b/tools/buildman/builderthread.py
> @@ -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


More information about the U-Boot mailing list