[OS-BUILD PATCHv4 6/8] redhat: use new genlog.sh script to detect changes for dist-release

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

 



From: Herton R. Krzesinski <herton@xxxxxxxxxx>

redhat: use new genlog.sh script to detect changes for dist-release

The current dist-release process has a flaw, where both its subtargets
(dist-release-changed and dist-release-finish) depends on setup-source
target to run (so genspec.sh is run twice). To avoid having to do the
work twice and do and revert changes before dist-release-finish is
called, we now detect changes by creating the changelog using genlog.sh
first to detect if there are really changes, and do the marker check
using an if condition instead of relying on git to see if there are
changes.

Signed-off-by: Herton R. Krzesinski <herton@xxxxxxxxxx>

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -572,18 +572,18 @@ dist-rpm-baseonly: dist-sources do-rpmbuild
 # unless you know what you're doing, you don't want to use the next four ones
 dist-release-finish: setup-source
 	@cp $(SOURCES)/$(SPECCHANGELOG) $(REDHAT)/$(SPECCHANGELOG)
+	@echo $(MARKER) > $(REDHAT)/marker
 	@$(GIT) add $(REDHAT)/$(SPECCHANGELOG)
 	@$(GIT) add $(REDHAT)/marker
 	@$(GIT) commit -s ../Makefile.rhelver $(REDHAT)/marker $(REDHAT)/$(SPECCHANGELOG) $(SPECFILE).template -m "[redhat] $(RELEASETAG)"
-dist-release-changed: setup-source
-	@cp $(SOURCES)/$(SPECCHANGELOG) $(REDHAT)/$(SPECCHANGELOG)
-	@echo $(MARKER) > $(REDHAT)/marker
-	@# if neither changelog nor marker was updated, skip bumping a release
-	@$(GIT) update-index -q --really-refresh
-	@if $(GIT) diff-index --quiet HEAD; then \
+dist-release-changed:
+	@CLOGF="$$(mktemp)"; \
+	trap 'rm -f "$$CLOGF"' SIGHUP SIGINT SIGTERM EXIT; \
+	$(REDHAT)/genlog.sh "$$CLOGF"; \
+	if [ "$(MARKER)" == "$$(cat $(REDHAT)/marker)" ] && \
+	   [ "$$(wc -l $$CLOGF | cut -d ' ' -f 1)" -le 3 ]; then \
 		echo "Nothing changed, skipping updates"; \
 	else \
-		$(GIT) checkout -- $(REDHAT)/$(SPECCHANGELOG); \
 		$(REDHAT)/scripts/new_release.sh; \
 		$(MAKE) dist-release-finish; \
 	fi

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1980
_______________________________________________
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