From: "Herton R. Krzesinski" <her...@redhat.com>

When doing dist-release, the release commit will have the wrong release
number, eg.:

  commit db61196cc6aab3f6ece65027551ebfb2f5edea90
  ...
      [redhat] kernel-5.10.0-0.rc3.20201111giteccc87672492.69.test
  ...
  -RHEL_RELEASE = 69
  +RHEL_RELEASE = 70
  ...

While the new release is 70 in example above, the commit title has the wrong
value. That mismatch happens because the release number is a Makefile.rhelver
variable included and used by make rules, and make doesn't see the updated
value, you need to eg. reload it through a sub make process. This change adds
a new rule and new make invocation so the proper RHEL_RELEASE value is used when
doing the release commit.

Signed-off-by: Herton R. Krzesinski <her...@redhat.com>
---
 redhat/Makefile | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/redhat/Makefile b/redhat/Makefile
index 834704a1a0a7..3cb52956ff7e 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -295,19 +295,20 @@ dist-rpm-baseonly: dist-sources
        $(RPMBUILD) --define "_sourcedir $(SOURCES)" --define "_builddir 
$(RPM)/BUILD" --define "_srcrpmdir $(RPM)/SRPMS" --define "_rpmdir $(RPM)/RPMS" 
--define "_specdir $(RPM)/SPECS" --define "dist $(DIST)" --target $(MACH) 
--without debug --without debuginfo --without vdso_install --without bpftool 
--without perf --without tools -bb $(RPM)/SOURCES/$(PACKAGE_NAME).spec
 
 
-# unless you know what you're doing, you don't want to use the next three ones
-dist-release-finish: setup-source
+# unless you know what you're doing, you don't want to use the next four ones
+dist-release-finish:
+       @git add $(REDHAT)/$(CHANGELOG)
+       @git add $(REDHAT)/marker
+       @git commit -s ../Makefile.rhelver $(REDHAT)/marker 
$(REDHAT)/$(CHANGELOG) $(PACKAGE_NAME).spec.template -m "[redhat] 
$(PACKAGE_NAME)-$(STAMP_VERSION)-$(PREBUILD)$(BUILD)$(BUILDID)"
+dist-release-changed: setup-source
        @cp $(SOURCES)/$(CHANGELOG) $(REDHAT)/$(CHANGELOG)
        @echo $(MARKER) > $(REDHAT)/marker
        @# if neither changelog nor marker was updated, skip bumping a release
        git diff-index --quiet HEAD && (echo "Nothing changed, skipping 
updates"; exit 0) || true
-       $(REDHAT)/scripts/new_release.sh $(REDHAT) $(__YSTREAM) $(__ZSTREAM); \
-       git add $(REDHAT)/$(CHANGELOG); \
-       git add $(REDHAT)/marker; \
-       git commit -s ../Makefile.rhelver $(REDHAT)/marker 
$(REDHAT)/$(CHANGELOG) $(PACKAGE_NAME).spec.template -m "[redhat] 
$(PACKAGE_NAME)-$(STAMP_VERSION)-$(PREBUILD)$(BUILD)$(BUILDID)"; \
-
-dist-release: dist-clean-sources
+       $(REDHAT)/scripts/new_release.sh $(REDHAT) $(__YSTREAM) $(__ZSTREAM)
        @$(MAKE) dist-release-finish
+dist-release: dist-clean-sources
+       @$(MAKE) dist-release-changed
 dist-release-tag:
        @git tag -a -m "$(PACKAGE_NAME)-$(STAMP_VERSION)-$(PKGRELEASE)" 
$(PACKAGE_NAME)-$(STAMP_VERSION)-$(PKGRELEASE)
 
-- 
GitLab
_______________________________________________
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org

Reply via email to