[Reproducible-commits] [cdbs] 07/41: Tidy python-vars.mk: Add/improve comments.
Mattia Rizzolo
mattia at debian.org
Tue May 10 14:42:26 UTC 2016
This is an automated email from the git hooks/post-receive script.
mattia pushed a commit to branch reproducible
in repository cdbs.
commit 485e8f053de78839a460f9a492c006d1fc416592
Author: Jonas Smedegaard <dr at jones.dk>
Date: Mon Jan 20 12:58:12 2014 +0100
Tidy python-vars.mk: Add/improve comments.
---
1/class/python-sugar.mk.in | 2 +-
1/class/python-vars.mk.in | 35 ++++++++++++++++++++++++-----------
1/rules/buildcore.mk.in | 2 +-
3 files changed, 26 insertions(+), 13 deletions(-)
diff --git a/1/class/python-sugar.mk.in b/1/class/python-sugar.mk.in
index 51c71f1..ef437e1 100644
--- a/1/class/python-sugar.mk.in
+++ b/1/class/python-sugar.mk.in
@@ -64,7 +64,7 @@ cdbs_python_sugar_pkg_check = $(strip $(if \
- either rename binary packages or set \
DEB_PYTHON_SUGAR_PACKAGES before including python-sugar.mk)))
-# convenience wrappers to expand Sugar branches for package dependencies
+# convenience wrappers to resolve package dependencies for all Sugar branches
cdbs_sugar_allbranchdeps = $(call cdbs_expand_branches,$1,$(DEB_SUGAR_BRANCHES),$(comma) ,$(comma) ,$(DEB_SUGAR_PRIMARY_BRANCH))
cdbs_sugar_anybranchdeps = $(call cdbs_expand_branches,$1,$(DEB_SUGAR_BRANCHES),$(comma) , | ,$(DEB_SUGAR_PRIMARY_BRANCH))
diff --git a/1/class/python-vars.mk.in b/1/class/python-vars.mk.in
index b4de2b1..e8ede4a 100644
--- a/1/class/python-vars.mk.in
+++ b/1/class/python-vars.mk.in
@@ -25,18 +25,18 @@ _cdbs_class_python_vars = 1
include $(_cdbs_rules_path)/buildvars.mk$(_cdbs_makefile_suffix)
include $(_cdbs_class_path)/langcore.mk$(_cdbs_makefile_suffix)
-# By default the "python2" and "python3" packaging systems are used
-# Possible alternatives are "pysupport" or "pycentral"
+# By default per-implementation packaging systems are used.
+# Set explicitly to use legacy alternative "pysupport" or "pycentral".
#DEB_PYTHON_SYSTEM =
-# With "python2" and "python3", all likely packages are used by default
-# These are tied together: Set one and default is none for the other
+# Per-implementation systems use all likely packages by default.
+# These are tied together: Set one, and default is none for the others.
# NB! override needs to be done _before_ including this file!
#DEB_PYTHON2_MODULE_PACKAGES =
#DEB_PYTHON3_MODULE_PACKAGES =
-# With "pysupport" and "pycentral", first likely package in
-# 'debian/control' is used by default
+# Legacy systems "pysupport" and "pycentral" use first likely package in
+# debian/control by default.
# NB! override needs to be done _before_ including this file!
#DEB_PYTHON_MODULE_PACKAGES =
@@ -45,11 +45,16 @@ include $(_cdbs_class_path)/langcore.mk$(_cdbs_makefile_suffix)
#DEB_PYTHON_SRCDIR = $(DEB_DESTDIR)
#DEB_PYTHON_DESTDIR = $(DEB_DESTDIR)
+# binary packages
cdbs_python_potential_packages = $(strip \
- $(filter-out %-doc %-dev %-common, $(DEB_PACKAGES)))
+ $(filter-out %-doc %-dev %-common,$(DEB_PACKAGES)))
cdbs_python_legacy_packages = $(or $(strip \
$(DEB_PYTHON_MODULE_PACKAGES)),$(strip \
$(firstword $(cdbs_python_potential_packages))))
+# per-python package lists
+# * variables cdbs_$python_packages:
+# 1. any DEB_*_MODULE_PACKAGES is non-empty: DEB_$P_MODULE_PACKAGES
+# 2. $p-* (or $pkgprefix-*) in control file except *-doc *-dev *-common
cdbs_python2_packages = $(strip \
$(if $(DEB_PYTHON2_MODULE_PACKAGES)$(DEB_PYTHON3_MODULE_PACKAGES),\
$(DEB_PYTHON2_MODULE_PACKAGES),\
@@ -77,6 +82,7 @@ cdbs_python_indep_packages = $(strip \
cdbs_python_destdir = $(or $(DEB_PYTHON_DESTDIR),$(DEB_DESTDIR))
+# packaging systems to use
cdbs_python_pysupport = $(filter pysupport,$(DEB_PYTHON_SYSTEM))
cdbs_python_pycentral = $(filter pycentral,$(DEB_PYTHON_SYSTEM))
cdbs_python_legacy_system = $(or $(strip \
@@ -102,8 +108,8 @@ cdbs_python_systems = $(strip \
python2) \
$(if $(cdbs_python3_packages),\
python3)))
-
cdbs_python_stem = $(if $(DEB_PYTHON_SYSTEM),,$(if $(cdbs_python3_packages),3))
+# some build systems can handle only a single packaging system
cdbs_python_stem += $(strip \
$(if $(word 2,$(cdbs_python_systems)),$(error \
use of multiple python implementations is unsupported here - \
@@ -119,8 +125,9 @@ cdbs_python3_supported_versions := $(if $(cdbs_python3),$(shell py3versions -vr)
cdbs_python_first_supported_version = $(firstword $(strip $(sort $(cdbs_python_supported_versions))))
cdbs_python3_first_supported_version = $(firstword $(strip $(sort $(cdbs_python3_supported_versions))))
-# Non-default Python version used (only valid for arch-indendent builds)
-# arch(+indep): none; indep: none if current is supported, else first supported
+# versions to use
+# variables cdbs_$python_nondefault_version
+# * arch-indep w/ default unsupported: first alternative available
cdbs_python_nondefault_version = $(strip \
$(if $(cdbs_python_arch_packages),\
,\
@@ -133,13 +140,15 @@ cdbs_python3_nondefault_version = $(strip \
$(if $(filter $(cdbs_python3_current_version),$(cdbs_python3_supported_versions)),\
,\
$(cdbs_python3_first_supported_version))))
+# variables cdbs_$python_primary_version
cdbs_python_primary_version = $(or $(strip \
$(cdbs_python_nondefault_version)),$(strip \
$(cdbs_python_current_version)))
cdbs_python3_primary_version = $(or $(strip \
$(cdbs_python3_nondefault_version)),$(strip \
$(cdbs_python3_current_version)))
-# arch(+indep): all; indep: current if supported, else first supported
+# variables cdbs_$python_build_versions
+# * arch(+indep): all; indep: current if supported, else first supported
cdbs_python_build_versions = $(or $(strip \
$(if $(cdbs_python_arch_packages),\
$(cdbs_python_supported_versions))),$(strip \
@@ -149,13 +158,16 @@ cdbs_python3_build_versions = $(or $(strip \
$(cdbs_python3_supported_versions))),$(strip \
$(cdbs_python3_primary_version)))
+# runtime to use
cdbs_python_current_binary := $(if $(DEB_PYTHON_SYSTEM)$(cdbs_python2),$(shell pyversions -d))
cdbs_python3_current_binary := $(if $(cdbs_python3),$(shell py3versions -d))
+# resolve from binary package and optional flavor
cdbs_python_binary = $(strip \
$(if $(call cdbs_streq,$(cdbs_python$(cdbs_curpythonstem)_current_binary),$(1)),\
python$(cdbs_curpythonstem),\
$(1)))
+# resolve (implicitly) from binary package
cdbs_curpythonsystems = $(strip $(if $(DEB_PYTHON_SYSTEM),\
$(cdbs_python_legacy_system),\
$(strip \
@@ -174,6 +186,7 @@ cdbs_curpythonindepbinary = python$(or $(strip \
cdbs_curpythonpribinary = python$(cdbs_python$(cdbs_curpythonstem)_primary_version)
cdbs_curpythonbuildversions = $(cdbs_python$(cdbs_curpythonstem)_build_versions)
+# package relations
# Python-related dependencies according to Python policy, appendix A
# * Arch-independent Python 3 was broken until 0.4.93~
cdbs_python_builddeps_legacy = $(if $(DEB_PYTHON_SYSTEM),\
diff --git a/1/rules/buildcore.mk.in b/1/rules/buildcore.mk.in
index 4f0053f..2884c20 100644
--- a/1/rules/buildcore.mk.in
+++ b/1/rules/buildcore.mk.in
@@ -302,7 +302,7 @@ CDBS_REPLACES_DEFAULT ?= $(CDBS_REPLACES)
CDBS_CONFLICTS_DEFAULT ?= $(CDBS_CONFLICTS)
CDBS_ENHANCES_DEFAULT ?= $(CDBS_ENHANCES)
-# Apply CDBS-declared dependencies to binary packages
+# Resolve CDBS-declared binary package relations and apply to substvars files
$(patsubst %,install/%,$(DEB_ALL_PACKAGES)) :: install/%:
@echo 'Adding cdbs dependencies to debian/$(cdbs_curpkg).substvars'
@echo '$(call cdbs_expand_curvar,CDBS_DEPENDS,$(comma) )' \
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/cdbs.git
More information about the Reproducible-commits
mailing list