changeset 43357:90dc0d3111d0 stable

packaging: use "--python python" for centos7 to avoid explicit "python2" This is a partial backout of 92a51a45d44c. We will need to be able to control whether package dependencies are python2 or python3. Generally (at least in recent Fedora), the package prefix match the name of the python executable ... but CentOS 7 doesn't use the python2 prefix in package name or alias for python-docutils yet, so just keep centos7 in the unversioned "python" world. Change the new (unused) buildrpm "--python3" option (introduced in a6dcac6454c1) to "--python python3" to get a more generic method for explicit control over whether we use python, python2 or python3.
author Mads Kiilerich <mads@kiilerich.com>
date Fri, 01 Nov 2019 12:47:38 +0100
parents 5989f697890a
children 518655314fc5
files contrib/packaging/Makefile contrib/packaging/buildrpm
diffstat 2 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/packaging/Makefile	Fri Nov 01 12:34:08 2019 +0100
+++ b/contrib/packaging/Makefile	Fri Nov 01 12:47:38 2019 +0100
@@ -116,13 +116,13 @@
 .PHONY: centos$(1)
 centos$(1):
 	mkdir -p $$(HGROOT)/packages/centos$(1)
-	./buildrpm $$(if $$(filter $(1),$$(CENTOS_WITH_PYTHON_RELEASES)),--withpython)
+	./buildrpm $$(if $$(filter $(1),$$(CENTOS_WITH_PYTHON_RELEASES)),--withpython,--python python)
 	cp $$(HGROOT)/contrib/packaging/rpmbuild/RPMS/*/* $$(HGROOT)/packages/centos$(1)
 	cp $$(HGROOT)/contrib/packaging/rpmbuild/SRPMS/* $$(HGROOT)/packages/centos$(1)
 
 .PHONY: docker-centos$(1)
 docker-centos$(1):
-	./dockerrpm centos$(1) $$(if $$(filter $(1),$$(CENTOS_WITH_PYTHON_RELEASES)),--withpython)
+	./dockerrpm centos$(1) $$(if $$(filter $(1),$$(CENTOS_WITH_PYTHON_RELEASES)),--withpython,--python python)
 
 endef
 
--- a/contrib/packaging/buildrpm	Fri Nov 01 12:34:08 2019 +0100
+++ b/contrib/packaging/buildrpm	Fri Nov 01 12:47:38 2019 +0100
@@ -14,9 +14,10 @@
         shift
         BUILD=
         ;;
-    --python3)
+    --python)
         shift
-        PYTHONEXE=python3
+        PYTHONEXE=$1
+        shift
         ;;
     --withpython | --with-python)
         shift