[REVIEW 04/10][linux] UBUNTU: [Debian] Read variants list into a variable
Seth Forshee
seth.forshee at canonical.com
Tue Dec 3 22:26:38 UTC 2019
Read the contents of $DEBIAN/variants into a variable, for use
in later patches. For backwards compatability, assume the primary
variant "--" if the variants file is not present.
Signed-off-by: Seth Forshee <seth.forshee at canonical.com>
---
debian/rules.d/0-common-vars.mk | 6 ++++++
debian/rules.d/1-maintainer.mk | 1 +
2 files changed, 7 insertions(+)
diff --git a/debian/rules.d/0-common-vars.mk b/debian/rules.d/0-common-vars.mk
index bcab5749f8aa..a5035def11d6 100644
--- a/debian/rules.d/0-common-vars.mk
+++ b/debian/rules.d/0-common-vars.mk
@@ -18,6 +18,12 @@ prev_revision := $(word $(words $(prev_revisions)),$(prev_revisions))
prev_fullver ?= $(shell dpkg-parsechangelog -l$(DEBIAN)/changelog -o1 -c1 | sed -ne 's/^Version: *//p')
+# Get variants. Assume primary if debian/variants is not present.
+variants = --
+ifneq (,$(wildcard $(DEBIAN)/variants))
+ variants := $(shell cat $(DEBIAN)/variants)
+endif
+
# Get upstream version info
upstream_version := $(shell sed -n 's/^VERSION = \(.*\)$$/\1/p' Makefile)
upstream_patchlevel := $(shell sed -n 's/^PATCHLEVEL = \(.*\)$$/\1/p' Makefile)
diff --git a/debian/rules.d/1-maintainer.mk b/debian/rules.d/1-maintainer.mk
index 6b4e0901c288..2c07c075f349 100644
--- a/debian/rules.d/1-maintainer.mk
+++ b/debian/rules.d/1-maintainer.mk
@@ -62,6 +62,7 @@ printenv:
@echo "abinum = $(abinum)"
@echo "upstream_tag = $(upstream_tag)"
@echo "gitver = $(gitver)"
+ @echo "variants = $(variants)"
@echo "flavours = $(flavours)"
@echo "skipabi = $(skipabi)"
@echo "skipmodule = $(skipmodule)"
--
2.24.0
More information about the kernel-team
mailing list