From: Patrick Talbert <[email protected]>

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 <[email protected]>

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 mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/[email protected]
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to