diff mbox series

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

Message ID 20220403140603.26029-1-andrey.zhizhikin@leica-geosystems.com
State Accepted
Delegated to: Tom Rini
Headers show
Series env: do not fail on non-existing env.in file | expand

Commit Message

ZHIZHIKIN Andrey April 3, 2022, 2:06 p.m. UTC
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")
Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tom Rini April 4, 2022, 2:32 p.m. UTC | #1
On Sun, Apr 03, 2022 at 04:06:03PM +0200, Andrey Zhizhikin wrote:

> 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")
> Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
> Reviewed-by: Sean Anderson <seanga2@gmail.com>

Applied to u-boot/master, thanks!
diff mbox series

Patch

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