[PATCH 7 of 8 stable] packaging: refactor "fedora29" target to a single more generic "fedora" target

Mads Kiilerich mads at kiilerich.com
Fri Nov 1 10:40:35 EDT 2019


# HG changeset patch
# User Mads Kiilerich <mads at kiilerich.com>
# Date 1572612704 -3600
#      Fri Nov 01 13:51:44 2019 +0100
# Branch stable
# Node ID 8c57b4472c1acd7bf11f83dccb29c6cc064455a0
# Parent  0b31ec6e6e7e815a75dc465e133043582b3e4cb7
packaging: refactor "fedora29" target to a single more generic "fedora" target

Fedora moves fast in version numbers, and often with Mercurial packaging being
backwards compatible. Also, most people use the system package. There is thus
much work and tech debt and little value in providing explicit built-in support
for several versions. Thus, only aim for providing built-in support for latest
Fedora version, and make it easy to update.

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -189,7 +189,7 @@ packaging_targets := \
   docker-centos7 \
   docker-debian-jessie \
   docker-debian-stretch \
-  docker-fedora29 \
+  docker-fedora \
   docker-ubuntu-trusty \
   docker-ubuntu-trusty-ppa \
   docker-ubuntu-xenial \
@@ -198,7 +198,7 @@ packaging_targets := \
   docker-ubuntu-artful-ppa \
   docker-ubuntu-bionic \
   docker-ubuntu-bionic-ppa \
-  fedora29 \
+  fedora \
   linux-wheels \
   linux-wheels-x86_64 \
   linux-wheels-i686 \
diff --git a/contrib/packaging/Makefile b/contrib/packaging/Makefile
--- a/contrib/packaging/Makefile
+++ b/contrib/packaging/Makefile
@@ -11,8 +11,7 @@ UBUNTU_CODENAMES := \
   cosmic \
   disco
 
-FEDORA_RELEASES := \
-  29
+FEDORA_RELEASE := 29
 
 CENTOS_RELEASES := \
   5 \
@@ -31,8 +30,8 @@ help:
 	@echo 'docker-debian-{$(strip $(DEBIAN_CODENAMES))}'
 	@echo '   Build Debian packages specific to a Debian distro using Docker.'
 	@echo ''
-	@echo 'docker-fedora{$(strip $(FEDORA_RELEASES))}'
-	@echo '   Build an RPM for a specific Fedora version using Docker.'
+	@echo 'docker-fedora'
+	@echo '   Build an RPM for a Fedora $(FEDORA_RELEASE) using Docker.'
 	@echo ''
 	@echo 'docker-ubuntu-{$(strip $(UBUNTU_CODENAMES))}'
 	@echo '   Build Debian package specific to an Ubuntu distro using Docker.'
@@ -56,8 +55,8 @@ help:
 	@echo 'centos{$(strip $(CENTOS_RELEASES))}'
 	@echo '   Build an RPM for a specific CentOS version locally'
 	@echo ''
-	@echo 'fedora{$(strip $(FEDORA_RELEASES))}'
-	@echo '   Build an RPM for a specific Fedora version locally'
+	@echo 'fedora'
+	@echo '   Build an RPM for Fedora $(FEDORA_RELEASE) locally'
 
 .PHONY: help
 
@@ -94,22 +93,17 @@ endef
 $(foreach codename,$(UBUNTU_CODENAMES),$(eval $(call ubuntu_targets,$(codename))))
 
 # Fedora targets.
-define fedora_targets
-.PHONY: fedora$(1)
-fedora$(1):
-	mkdir -p $$(HGROOT)/packages/fedora$(1)
+.PHONY: fedora
+fedora:
+	mkdir -p $(HGROOT)/packages/fedora$(FEDORA_RELEASE)
 	./buildrpm
-	cp $$(HGROOT)/contrib/packaging/rpmbuild/RPMS/*/* $$(HGROOT)/packages/fedora$(1)
-	cp $$(HGROOT)/contrib/packaging/rpmbuild/SRPMS/* $$(HGROOT)/packages/fedora$(1)
+	cp $(HGROOT)/contrib/packaging/rpmbuild/RPMS/*/* $(HGROOT)/packages/fedora$(FEDORA_RELEASE)
+	cp $(HGROOT)/contrib/packaging/rpmbuild/SRPMS/* $(HGROOT)/packages/fedora$(FEDORA_RELEASE)
 	rm -rf $(HGROOT)/rpmbuild
 
-.PHONY: docker-fedora$(1)
-docker-fedora$(1):
-	./dockerrpm fedora$(1)
-
-endef
-
-$(foreach release,$(FEDORA_RELEASES),$(eval $(call fedora_targets,$(release))))
+.PHONY: docker-fedora
+docker-fedora:
+	./dockerrpm fedora$(FEDORA_RELEASE)
 
 # CentOS targets.
 define centos_targets


More information about the Mercurial-devel mailing list