From 5bc6cc856bf54fc20f627927bbcaf0bebdf0c64d Mon Sep 17 00:00:00 2001 From: "Brett T. Warden" Date: Tue, 7 Aug 2018 09:03:54 -0700 Subject: [PATCH] Error on specfile and upstreams only when missing Previously, we always emitted an error and failed when the specfile or upstream target was requested, breaking the -B switch. Now, we only fail if the file doesn't actually exist, not just that it was requested via make. --- Makefile.common | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Makefile.common b/Makefile.common index 5a18c21..cf338c7 100644 --- a/Makefile.common +++ b/Makefile.common @@ -28,16 +28,18 @@ __missingsources := $(filter-out $(wildcard ${__allsources}), ${__allsources}) endif $(SPECFILE): - @echo Error: $(SPECFILE) is missing. Please run \`make autospec\` to try and auto - @echo Error: generate one for you. - @exit 1 + @[[ -f "$@" ]] || (\ + echo Error: $@ is missing. Please run \`make autospec\` to try and auto;\ + echo Error: generate one for you.;\ + exit 1 ) upstream: - @echo Error: The \"upstream\" file is missing. Try running \`make autospec\` to - @echo Error: auto generate one for you. If you are not using autospec to - @echo Error: generate a spec file, specify the proper "Source*" entries in the - @echo Error: spec header, and try running \`make generateupstream\`. - @exit 1 + @[[ -f "$@" ]] || (\ + echo Error: The \"$@\" file is missing. Try running \`make autospec\` to;\ + echo Error: auto generate one for you. If you are not using autospec to;\ + echo Error: generate a spec file, specify the proper "Source*" entries in the;\ + echo Error: spec header, and try running \`make generateupstream\`.;\ + exit 1 ) #help spdxcheck: Checks that the package license is a valid SPDX license, #help or that it is in the exceptions list.