[REVIEW,04/10,linux] UBUNTU: [Debian] Read variants list into a variable
diff mbox series

Message ID 20191203222657.1152249-5-seth.forshee@canonical.com
State New
Headers show
Series
  • [REVIEW,01/10,linux] UBUNTU: [Packaging] Don't use SRCPKGNAME for linux-libc-dev
Related show

Commit Message

Seth Forshee Dec. 3, 2019, 10:26 p.m. UTC
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@canonical.com>
---
 debian/rules.d/0-common-vars.mk | 6 ++++++
 debian/rules.d/1-maintainer.mk  | 1 +
 2 files changed, 7 insertions(+)

Patch
diff mbox series

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)"