aboutsummaryrefslogtreecommitdiffstats
path: root/Mk/Uses
diff options
context:
space:
mode:
authormat <mat@FreeBSD.org>2017-12-14 21:48:58 +0800
committermat <mat@FreeBSD.org>2017-12-14 21:48:58 +0800
commit7454e8556438837d66fc0e4847ee1e065f149a6f (patch)
tree9ce30a4b30fd6bdef84705418f980554fdc6c952 /Mk/Uses
parent488e89aa11e49e2120f50d484de95e22926c7f66 (diff)
downloadfreebsd-ports-gnome-7454e8556438837d66fc0e4847ee1e065f149a6f.tar.gz
freebsd-ports-gnome-7454e8556438837d66fc0e4847ee1e065f149a6f.tar.zst
freebsd-ports-gnome-7454e8556438837d66fc0e4847ee1e065f149a6f.zip
Rework PY_FLAVOR to always work.
Before this, it could have been set to the current flavor of the port that may not have been related to Python at all. This of course never came up during development because at that time, the only flavors were the Python flavors. Reported by: dbn Sponsored by: Absolight
Diffstat (limited to 'Mk/Uses')
-rw-r--r--Mk/Uses/python.mk11
1 files changed, 6 insertions, 5 deletions
diff --git a/Mk/Uses/python.mk b/Mk/Uses/python.mk
index 690113b13a52..4ee191581088 100644
--- a/Mk/Uses/python.mk
+++ b/Mk/Uses/python.mk
@@ -463,11 +463,12 @@ PKGNAMESUFFIX= ${PYTHON_PKGNAMESUFFIX}
.endif
# To avoid having dependencies with @ and empty flavor:
-.if empty(FLAVOR)
-PY_FLAVOR= ${PYTHON_VERSION:S/^python/py/:S/.//}
-.else
-PY_FLAVOR= ${FLAVOR}
-.endif
+# _PYTHON_VERSION is either set by (first that matches):
+# - If using Python flavors, from the current Python flavor
+# - If using a version restriction (USES=python:3.4+), from the first
+# acceptable default Python version.
+# - From PYTHON_DEFAULT
+PY_FLAVOR= py${_PYTHON_VERSION:S/.//}
# Pass PYTHON_VERSION down the dependency chain. This ensures that
# port A -> B -> C all will use the same python version and do not