From patchwork Mon Aug 5 08:37:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Whitcroft X-Patchwork-Id: 1142039 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 462B3c3hlvz9sN6; Mon, 5 Aug 2019 18:37:46 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1huYUu-0003DB-Rp; Mon, 05 Aug 2019 08:37:40 +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 1huYUr-0003Bx-7m for kernel-team@lists.ubuntu.com; Mon, 05 Aug 2019 08:37:37 +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 1huYUq-0006j6-Rn; Mon, 05 Aug 2019 08:37:36 +0000 From: Andy Whitcroft To: kernel-team@lists.ubuntu.com Subject: [precise/master-next 1/3] UBUNTU: [debian] Allow for package revisions condusive for branching Date: Mon, 5 Aug 2019 09:37:33 +0100 Message-Id: <20190805083735.13947-2-apw@canonical.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190805083735.13947-1-apw@canonical.com> References: <20190805083735.13947-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" From: dann frazier TLDR; This changes the way that version strings are parsed in the packaging to make it easier for me to maintain topic branches/PPA builds. There should be no changes to how things work today for standard Ubuntu kernels. But, it allows for topic-branch maintainers to add an optional ".X" in the ABI name, for reasons described below. ------------------ Old Parsing: = abinum = $ echo "33.58" | sed -e 's/\..*//' 33 = uploadnum = $ echo "33.58" | sed -e 's/.*\.//' 58 = abi = $ echo "33.58" | gawk -F. '{print $1}' 33 New Parsing: = abinum = $ echo "33.58" | sed -r -e 's/([^\+]*)\.[^\.]+(\+.*)?$/\1/' 33 = uploadnum = $ echo "33.58" | sed -r -e 's/[^\+]*\.([^\.]+(\+.*)?$$)/\1/' 58 = abi = $ echo "33.58" | sed -r -e 's/([^\+]*)\.[^\.]+(\+.*)?$/\1/' 33 When maintaining topic customizations that track Ubuntu kernel releases, it is nice have the following features: 1) Ability to decipher the base Ubuntu kernel revision used from the topic kernel's revision number 2) Use a version that dpkg sorts > the base Ubuntu version 3) Use a version that dpkg sorts < the next expected Ubuntu version 4) Ability to retains the same ABI as the base Ubuntu version when the ABI has indeed not changed. This helps with e.g. d-i compatibility. 5) Make use of ABI tracking facilities (vs. just disabling them) This is difficult to do with the current version scheme, which encodes the ABI number in the version string: -. I can tack a "+topic." to the end of rev, we can solve 1-3, but only as long as as the ABI is the same. Once the ABI changes, I don't have a good way to bump it. If I increment the ABI, we'll overlap with the next Ubuntu ABI (breaking #4). If we jump to a huge ABI number (e.g. x100 to go from 32 to 3200), we'll have a package revision that will never again upgrade to an Ubuntu version (breaking #3), and never get back to the Ubuntu ABI (again breaking #4). I can of course use a linux-meta package to e.g. transition from a 3200 ABI back to a 32 ABI at the packaging level, but the bootloader will still consider 3200 to be newer and therefore the default. I've therefore started using the following scheme: -(.topicabi)?.(+.)? Where topicabi must always be >= (ugly, but necessary). If I don't break the ABI, I can then branch and return like so: 3.16.0-8.6 -------------------------------------------------> 3.16.0-8.7 \ ^ \ | \--> 3.16.0-8.6+topic.1 -------> 3.16.0-8.6+topic.2 --------/ If I do need to break the ABI, I can branch and return like so: 3.16.0-8.6 -------------------------------------------------> 3.16.0-9.1 \ ^ \ ABI break #1 ABI break #2 | \--> 3.16.0-8.6.6+topic.1 -------> 3.16.0-8.7.6+topic.2 ----/ Signed-off-by: dann frazier Signed-off-by: Tim Gardner [apw@canonical.com: drop getabis changes as that has separately been backported wholesale.] BugLink: http://bugs.launchpad.net/bugs/1838610 Signed-off-by: Andy Whitcroft --- debian/rules.d/0-common-vars.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/debian/rules.d/0-common-vars.mk b/debian/rules.d/0-common-vars.mk index 17eed6a25717..1fd6daffcb02 100644 --- a/debian/rules.d/0-common-vars.mk +++ b/debian/rules.d/0-common-vars.mk @@ -70,11 +70,11 @@ ifeq ($(full_build),false) skipdbg=true endif -abinum := $(shell echo $(revision) | sed -e 's/\..*//')$(abi_suffix) -prev_abinum := $(shell echo $(prev_revision) | sed -e 's/\..*//')$(abi_suffix) +abinum := $(shell echo $(revision) | sed -r -e 's/([^\+]*)\.[^\.]+(\+.*)?$$/\1/')$(abi_suffix) +prev_abinum := $(shell echo $(prev_revision) | sed -r -e 's/([^\+]*)\.[^\.]+(\+.*)?$$/\1/')$(abi_suffix) abi_release := $(release)-$(abinum) -uploadnum := $(shell echo $(revision) | sed -e 's/.*\.//') +uploadnum := $(shell echo $(revision) | sed -r -e 's/[^\+]*\.([^\.]+(\+.*)?$$)/\1/') ifneq ($(full_build),false) uploadnum := $(uploadnum)-Ubuntu endif