[PATCH v5 21/23] binman: Overwrite symlink if it already exists

Simon Glass sjg at chromium.org
Fri Jul 7 19:35:44 CEST 2023


Hi Neha,

On Fri, 7 Jul 2023 at 13:37, Neha Malcom Francis <n-francis at ti.com> wrote:
>
> From: Andrew Davis <afd at ti.com>
>
> Without this re-building will fail with an error when trying to create
> the symlink for the second time with an already exists error.
>
> Signed-off-by: Andrew Davis <afd at ti.com>
> Signed-off-by: Neha Malcom Francis <n-francis at ti.com>
> ---
>  tools/binman/image.py | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/tools/binman/image.py b/tools/binman/image.py
> index 8ebf71d61a..e77b5d0d97 100644
> --- a/tools/binman/image.py
> +++ b/tools/binman/image.py
> @@ -182,6 +182,8 @@ class Image(section.Entry_section):
>          # Create symlink to file if symlink given
>          if self._symlink is not None:
>              sname = tools.get_output_filename(self._symlink)
> +            if os.path.islink(sname):
> +                os.remove(sname)
>              os.symlink(fname, sname)
>
>      def WriteMap(self):
> --
> 2.34.1
>

This breaks test coverage. Please add a test to ftest.py. You can
probably run _DoTestFile() on an output directory with a in it?

Regards,
Simon


More information about the U-Boot mailing list