[REVIEW,2/6,linux-restricted-modules] UBUNTU: [Packaging] Set source package name from the changelog
diff mbox series

Message ID 20191203222657.1152249-20-seth.forshee@canonical.com
State New
Headers show
Series
  • Untitled series #146340
Related show

Commit Message

Seth Forshee Dec. 3, 2019, 10:26 p.m. UTC
To ease transitioning the source package name, set the name in
the control file from the name in the topmost changelog entry.
Since the src_package variable in debian/rules is unused, change
it to be the source package name from the changelog. While there,
simplify getting the source package name from the changelog.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
---
 debian/control.stub | 2 +-
 debian/rules        | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

Patch
diff mbox series

diff --git a/debian/control.stub b/debian/control.stub
index d17aff672943..b8f26eb6d409 100644
--- a/debian/control.stub
+++ b/debian/control.stub
@@ -1,4 +1,4 @@ 
-Source: linux-restricted-modules
+Source: LRM_SOURCE
 Section: utils
 Priority: optional
 Maintainer: Canonical Kernel Team <kernel-team@lists.ubuntu.com>
diff --git a/debian/rules b/debian/rules
index 6b70c81db4f8..84a306ef10b2 100755
--- a/debian/rules
+++ b/debian/rules
@@ -8,7 +8,7 @@  arch = $(shell dpkg-architecture -qDEB_HOST_ARCH)
 # Work out the source package name and version.  We assume the source package
 # is the name of this package with -restricted-modules stripped.  The version
 # is identical to this package less any rebuild suffix (+lrmN).
-src_package := $(shell LC_ALL=C dpkg-parsechangelog | grep ^Source: | cut -d ' ' -f 2 | sed -e 's/-restricted-modules//')
+src_package := $(shell LC_ALL=C dpkg-parsechangelog -S Source)
 src_fullversion = $(shell LC_ALL=C dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2)
 src_abi = $(shell echo "$(src_fullversion)" | sed -ne 's/\([0-9]*\.[0-9]*\.[0-9]*\-[0-9]*\)\..*/\1/p')
 src_version = $(shell echo $(src_fullversion) | sed -e 's/+[0-9][0-9]*//')
@@ -24,6 +24,7 @@  test:
 # we have no binary files and we will not run the appropriate targets.
 pre-clean:
 	sed <debian/control.stub >debian/control			\
+		-e 's/LRM_SOURCE/$(src_package)/g'			\
 		-e "s/ABI/$(src_abi)/g"					\
 		-e "s/VERSION/$(src_version)/g"				\
 		-e "s/@SERIES@/$(series)/g"