From patchwork Tue Mar 12 15:57:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Whitcroft X-Patchwork-Id: 1055501 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44JfkS1YtGz9s9T; Wed, 13 Mar 2019 02:57:36 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1h3jmT-00063b-7O; Tue, 12 Mar 2019 15:57:29 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1h3jmP-0005zm-1q for kernel-team@lists.ubuntu.com; Tue, 12 Mar 2019 15:57:25 +0000 Received: from 1.general.apw.uk.vpn ([10.172.192.78] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1h3jmO-0005A3-I2; Tue, 12 Mar 2019 15:57:24 +0000 From: Andy Whitcroft To: kernel-team@lists.ubuntu.com Subject: [disco/master-next 6/9] UBUNTU: [Packaging] dkms-build -- add support for unversioned overrides Date: Tue, 12 Mar 2019 15:57:16 +0000 Message-Id: <20190312155719.3532-7-apw@canonical.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190312155719.3532-1-apw@canonical.com> References: <20190312155719.3532-1-apw@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andy Whitcroft Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" We allow package specific overrides for dkms-build. However some packages have versions in their names. To make these easier to handle when the version changes add optional unversioned overrides. Where a package ends with a -NNN version look for overrides in the full name and with a (literal) -N suffix. BugLink: http://bugs.launchpad.net/bugs/1764792 Signed-off-by: Andy Whitcroft --- debian/scripts/dkms-build | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/debian/scripts/dkms-build b/debian/scripts/dkms-build index 251761b54e4f..6457d3650506 100755 --- a/debian/scripts/dkms-build +++ b/debian/scripts/dkms-build @@ -163,9 +163,14 @@ done # it the original source directory, destination package directory, the objects # as squirreled away, and the log in case it is useful. Finally pass a formed # signing command line in case we need to do that. -dkms_build="$srcdir/$0--$package" -if [ -e "$dkms_build" ]; then - echo "II: dkms-build override $package found, executing" +dkms_build_specific="$srcdir/$0--$package" +dkms_build_generic=$(echo "$dkms_build_specific" | sed -e 's/-[0-9][0-9]*$/-N/') +for dkms_build in "$dkms_build_specific" "$dkms_build_generic" +do + if [ ! -e "$dkms_build" ]; then + continue + fi + echo "II: dkms-build override $(basename "$dkms_build") found, executing" $SHELL "$dkms_build" \ "$srcdir" \ "$dkms_dir/build/$dkms_package/$dkms_version/objects" \ @@ -177,6 +182,7 @@ if [ -e "$dkms_build" ]; then "$pkgdir" \ "$package" \ "$@" || exit 1 -fi + break +done echo "II: dkms-build build $package complete"