[OS-BUILD PATCH] redhat: genlog.sh failures should interrupt the recipe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Patrick Talbert <ptalbert@xxxxxxxxxx>

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@xxxxxxxxxx>

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 -- kernel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to kernel-leave@xxxxxxxxxxxxxxxxxxxxxxx
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/kernel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue




[Index of Archives]     [Fedora General Discussion]     [Older Fedora Users Archive]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Tux]     [Yosemite News]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [USB]     [Asterisk PBX]

  Powered by Linux