From: Patrick Talbert ptalbert@redhat.com
redhat: genlog.sh failures should interrupt the recipe
Currently if genlog.sh returns a nonzero code the dist-release-changed target will keep going which is not ideal. Fix this by including set -e in genlog.sh and adjusting the dist-release-changed target to check te return code.
This is a follow up to MR !2167.
Signed-off-by: Patrick Talbert ptalbert@redhat.com
diff --git a/redhat/Makefile b/redhat/Makefile index blahblah..blahblah 100644 --- a/redhat/Makefile +++ b/redhat/Makefile @@ -701,13 +701,18 @@ dist-release-finish: setup-source dist-release-changed: @CLOGF="$$(mktemp)"; \ trap 'rm -f "$$CLOGF"' SIGHUP SIGINT SIGTERM EXIT; \ - $(REDHAT)/scripts/genspec/genlog.sh "$$CLOGF"; \ - if [ "$(MARKER)" == "$$(cat $(REDHAT)/marker)" ] && \ - [ "$$(wc -l $$CLOGF | cut -d ' ' -f 1)" -le 3 ]; then \ - echo "Nothing changed, skipping updates"; \ + if $(REDHAT)/scripts/genspec/genlog.sh "$$CLOGF"; then \ + if [ "$(MARKER)" == "$$(cat $(REDHAT)/marker)" ] && \ + [ "$$(wc -l $$CLOGF | cut -d ' ' -f 1)" -le 3 ]; then \ + echo "Nothing changed, skipping updates"; \ + else \ + $(REDHAT)/scripts/new_release.sh; \ + $(MAKE) dist-release-finish; \ + fi \ else \ - $(REDHAT)/scripts/new_release.sh; \ - $(MAKE) dist-release-finish; \ + retval=$$?; \ + echo "genlog.sh failed with return code $$retval, aborting."; \ + exit $$retval; \ fi
dist-release: dist-clean-sources diff --git a/redhat/scripts/genspec/genlog.sh b/redhat/scripts/genspec/genlog.sh index blahblah..blahblah 100755 --- a/redhat/scripts/genspec/genlog.sh +++ b/redhat/scripts/genspec/genlog.sh @@ -1,5 +1,7 @@ #!/bin/bash
+set -e + LAST_MARKER=$(cat "${REDHAT}"/marker) clogf="$1" # hide [redhat] entries from changelog
-- https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2170
kernel@lists.fedoraproject.org