diff mbox series

[1/2] UBUNTU: [Packaging] replace custom filter script with dctrl-tools

Message ID 20210219002605.1166831-2-xnox@ubuntu.com
State New
Headers show
Series Implement noudeb build profile | expand

Commit Message

Dimitri John Ledkov Feb. 19, 2021, 12:26 a.m. UTC
Use a tool from the archive to filter just the current architecture
udeb packages.

Add new line to control file snippet, in case extra paragraphs are
generated elsehwere without a leading new line.

Before adding udebs, add a new line too, in case the last snippet
anywhere else did not end with a new line.

BugLink: https://bugs.launchpad.net/bugs/1916095
Signed-off-by: Dimitri John Ledkov <xnox@ubuntu.com>
---
 debian.master/control.stub.in            |  1 +
 debian/control.d/flavour-buildinfo.stub  |  1 +
 debian/rules                             |  5 ++++-
 debian/scripts/misc/kernel-wedge-arch.pl | 26 ------------------------
 4 files changed, 6 insertions(+), 27 deletions(-)
 delete mode 100755 debian/scripts/misc/kernel-wedge-arch.pl
diff mbox series

Patch

diff --git a/debian.master/control.stub.in b/debian.master/control.stub.in
index 9c1e95609..cae6f6783 100644
--- a/debian.master/control.stub.in
+++ b/debian.master/control.stub.in
@@ -8,6 +8,7 @@  Build-Depends:
  dh-systemd,
  cpio,
  kernel-wedge,
+ dctrl-tools,
  kmod <!stage1>,
  makedumpfile [amd64] <!stage1>,
  libcap-dev <!stage1>,
diff --git a/debian/control.d/flavour-buildinfo.stub b/debian/control.d/flavour-buildinfo.stub
index ed92b3d53..dd08a6715 100644
--- a/debian/control.d/flavour-buildinfo.stub
+++ b/debian/control.d/flavour-buildinfo.stub
@@ -11,3 +11,4 @@  Description: Linux kernel buildinfo for version PKGVER on DESC
  DESC.
  .
  You likely do not want to install this package.
+
diff --git a/debian/rules b/debian/rules
index 33558795e..ceffe36be 100755
--- a/debian/rules
+++ b/debian/rules
@@ -220,10 +220,13 @@  $(DEBIAN)/control.stub: 				\
 debian/control: $(DEBIAN)/control.stub
 	echo "# placebo control.stub for kernel-wedge flow change" >debian/control.stub
 	cp $(DEBIAN)/control.stub debian/control
+	# start new paragraph in debian/control
+	echo >> debian/control
+	# append udeb packages
 	export KW_DEFCONFIG_DIR=$(DEBIAN)/d-i && \
 	export KW_CONFIG_DIR=$(DEBIAN)/d-i && \
 	LANG=C kernel-wedge gen-control $(release)-$(abinum) | \
-		perl -f $(DROOT)/scripts/misc/kernel-wedge-arch.pl $(arch) \
+		grep-dctrl -FArchitecture $(arch) \
 		>>$(CURDIR)/debian/control
 
 debian/canonical-certs.pem: $(wildcard $(DROOT)/certs/*-all.pem) $(wildcard $(DROOT)/certs/*-$(arch).pem) $(wildcard $(DEBIAN)/certs/*-all.pem) $(wildcard $(DEBIAN)/certs/*-$(arch).pem)
diff --git a/debian/scripts/misc/kernel-wedge-arch.pl b/debian/scripts/misc/kernel-wedge-arch.pl
deleted file mode 100755
index 4b4fefe67..000000000
--- a/debian/scripts/misc/kernel-wedge-arch.pl
+++ /dev/null
@@ -1,26 +0,0 @@ 
-#!/usr/bin/perl
-#
-# kernel-wedge-arch.pl -- select only specifiers for the supplied arch.
-#
-use strict;
-
-require Dpkg::Control;
-require Dpkg::Deps;
-
-my $fh = \*STDIN;
-
-my @entries;
-
-my $wanted = $ARGV[0];
-
-my $entry;
-while (!eof($fh)) {
-	$entry = Dpkg::Control->new();
-	$entry->parse($fh, '???');
-
-	if ($entry->{'Architecture'} eq $wanted) {
-		print("\n" . $entry);
-	}
-}
-
-close($fh);