]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
binman: Handle tool paths containing '~' correctly
authorSimon Glass <sjg@chromium.org>
Mon, 9 Nov 2020 14:45:02 +0000 (07:45 -0700)
committerSimon Glass <sjg@chromium.org>
Mon, 30 Nov 2020 20:14:43 +0000 (13:14 -0700)
At present if CROSS_COMPILE contains a tilde, such as
~/.buildman-toolchains/gcc-7.3.0-nolibc/i386-linux/bin/i386-linux-gcc
then binman gives a confusing error:

   binman: Error 255 running '~/..buildman-toolchains/gcc-7.3.0- ...

Fix this by expanding it out before running the tool.

Signed-off-by: Simon Glass <sjg@chromium.org>
tools/patman/tools.py

index bbb157da873e68eb8ab839a6e9bbd51a8f5d759a..05b1a1d4b08541c83b9d9e43835692beaa09a9a9 100644 (file)
@@ -333,6 +333,7 @@ def Run(name, *args, **kwargs):
         elif for_host:
             name, extra_args = GetHostCompileTool(name)
             args = tuple(extra_args) + args
+        name = os.path.expanduser(name)  # Expand paths containing ~
         all_args = (name,) + args
         result = command.RunPipe([all_args], capture=True, capture_stderr=True,
                                  env=env, raise_on_error=False, binary=binary)