From 2327fc58e7025f3a2255ff959bbf3a8bcf85eae9 Mon Sep 17 00:00:00 2001 From: Bill Kendrick Date: Mon, 1 May 2023 13:56:43 -0700 Subject: [PATCH] "rm -f" after failed starter/template thumbnail If `convert` fails, and didn't generate a file at all, `make` would abort due to `rm` being unable to delete the non-existent broken thumbnail. Using `rm -f` now, so it doesn't abort if the thumbnail file didn't get created AT ALL. h/t Luc --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index d0f5c9785..0fcd7784f 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ # Various contributors (see AUTHORS.txt) # https://tuxpaint.org/ -# June 14, 2002 - April 30, 2023 +# June 14, 2002 - May 1, 2023 # The version number, for release: @@ -858,7 +858,7 @@ $(THUMB_STARTERS): convert $(CONVERT_OPTS) obj/tmp_$(notdir $(STARTER_NAME)).png $@ 2> /dev/null ; \ rm obj/tmp_$(notdir $(STARTER_NAME)).png ; \ else \ - convert $(CONVERT_OPTS) $(STARTER_NAME) $@ 2> /dev/null || ( echo "($@ failed)" ; rm $@ ) ; \ + convert $(CONVERT_OPTS) $(STARTER_NAME) $@ 2> /dev/null || ( echo "($@ failed)" ; rm -f $@ ) ; \ fi $(INSTALLED_THUMB_STARTERS): $(DATA_PREFIX)/%: % install-example-starters-dirs @@ -913,7 +913,7 @@ TEMPLATE_NAME=$(or $(wildcard $(subst templates/.thumbs,templates,$(@:-t.png=.sv $(THUMB_TEMPLATES): @printf "." @mkdir -p templates/.thumbs - @convert $(CONVERT_OPTS) $(TEMPLATE_NAME) $@ 2> /dev/null || ( echo "($@ failed)" ; rm $@ ) ; \ + @convert $(CONVERT_OPTS) $(TEMPLATE_NAME) $@ 2> /dev/null || ( echo "($@ failed)" ; rm -f $@ ) ; \ $(INSTALLED_THUMB_TEMPLATES): $(DATA_PREFIX)/%: % @install -D -m 644 $< $@ || ( echo "NO THUMB $<" )