From: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
Date: Sun, 3 Apr 2022 14:06:03 +0000 (+0200)
Subject: env: do not fail on non-existing env.in file
X-Git-Tag: v2025.01-rc5-pxa1908~1480
X-Git-Url: http://git.dujemihanovic.xyz/img/static/html/%7B%7B%20%24.Site.BaseURL%20%7D%7Dposts/%7B%7B%20%28.OutputFormats.Get?a=commitdiff_plain;h=e75c5b9386c57cdd54149e82ca39e960819cf207;p=u-boot.git

env: do not fail on non-existing env.in file

If include/generated/env.in does not exist, which is a typical case for
clean build, quiet_cmd_gen_envp command tries to delete this file
unconditionally.

This produces following warning during the build:
  ENVP    include/generated/env.in
rm: cannot remove 'include/generated/env.in': No such file or directory

Add '-f' option to the `rm` command to not complain if file does not
exist.

Fixes: f432eb6d8a9d ("env: Avoid using a leftover text-environment file")
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
---

diff --git a/Makefile b/Makefile
index 4672147318..868445bf33 100644
--- a/Makefile
+++ b/Makefile
@@ -1846,7 +1846,7 @@ quiet_cmd_gen_envp = ENVP    $@
 			-I$(srctree)/arch/$(ARCH)/include \
 			$< -o $@; \
 	else \
-		rm $@; \
+		rm -f $@; \
 		touch $@ ; \
 	fi
 include/generated/env.in: include/generated/env.txt FORCE