From patchwork Tue Feb 19 16:17:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Henrique Cerri X-Patchwork-Id: 1044771 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 443mCB6NKXz9s3l; Wed, 20 Feb 2019 03:19:18 +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 1gw86y-00084q-Bc; Tue, 19 Feb 2019 16:19:12 +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 1gw86x-00084h-0y for kernel-team@lists.ubuntu.com; Tue, 19 Feb 2019 16:19:11 +0000 Received: from mail-wr1-f71.google.com ([209.85.221.71]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1gw85g-0005tH-Dn for kernel-team@lists.ubuntu.com; Tue, 19 Feb 2019 16:17:52 +0000 Received: by mail-wr1-f71.google.com with SMTP id m7so9321240wrn.15 for ; Tue, 19 Feb 2019 08:17:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=1n2fkeLk5X89jkc3SKDbef0mG9dYZqLZnUxEoq/ho5U=; b=FaUE9Ms8iQc6KzKixJrPdYpfHRcITCw/bsebODWH0bqksAMPdLMXzJIJh1lzC4hrZI LuMXpzTt/xPTACt17SZFkBnxjzFhzhuxoTUxsMu3qOQZwszEFYXzK0WUQGVjIn4/cGsG rQSweKIdHHrQAlmSVb+8uuhgzVdWF2mOb56nVdcUU3/J0SI3VQEwfkb2YLtSFGWylXyw +WgLjQwS8XWl57k+E+ylXk24gCkBaUC/4RnX8LqlcAH6v4hMVcZbT2F2qCYxohRzKxIy EykAdt0w1datyZvmI9jHNIHzNLIb6evlmjyk914rfvjzBWvSicna03991dtwQt9ORRMC bx+A== X-Gm-Message-State: AHQUAuYSUZm5tI9x4C42wiMvOUPqerghOrRYAvIdEC+Q1gWtk7DuC70n ErHOegc24RujD9qYM5FdCh1hq8btDa2EZbYjTR8RHEKFTJ8uVccKLVa/opuQMko+k0RXI5GJxcf CWk6j7+VlJws37GVovJJe4UrEh6ru0ndjBduB17gZ X-Received: by 2002:a5d:68c9:: with SMTP id p9mr3612206wrw.172.1550593071577; Tue, 19 Feb 2019 08:17:51 -0800 (PST) X-Google-Smtp-Source: AHgI3IbdfeEayVkwvZUKJ8XJkUXiUQF8AWN9t2OMpyAueCSTaT/p7kEZKFTeXCB/STyvvpdIxTSKzQ== X-Received: by 2002:a5d:68c9:: with SMTP id p9mr3612191wrw.172.1550593071119; Tue, 19 Feb 2019 08:17:51 -0800 (PST) Received: from gallifrey.c.hoisthospitality.com ([194.158.46.138]) by smtp.gmail.com with ESMTPSA id r14sm13354317wrv.77.2019.02.19.08.17.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Feb 2019 08:17:50 -0800 (PST) From: Marcelo Henrique Cerri To: kernel-team@lists.ubuntu.com Subject: [u, d, c, b, x, t][PATCH] UBUNTU: [Packaging] startnewrelease: Add support for backport versioning Date: Tue, 19 Feb 2019 13:17:48 -0300 Message-Id: <20190219161748.20999-1-marcelo.cerri@canonical.com> X-Mailer: git-send-email 2.17.1 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: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" Ignore: yes Use the parent kernel version as base for the new release version if the BACKPORT_SUFFIX variable is set in the update.conf file. Signed-off-by: Marcelo Henrique Cerri Acked-by: Thadeu Lima de Souza Cascardo Acked-by: Stefan Bader --- debian/rules.d/1-maintainer.mk | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/debian/rules.d/1-maintainer.mk b/debian/rules.d/1-maintainer.mk index ee8010ba7fa0..d57145b644d9 100644 --- a/debian/rules.d/1-maintainer.mk +++ b/debian/rules.d/1-maintainer.mk @@ -126,10 +126,20 @@ diffupstream: startnewrelease: dh_testdir - @ver=$$(echo "$(revision)" | perl -ne 'if (/^(\d*)\.(\d*)(.*)?$$/) { printf("%d.%d%s\n", $$1 + 1, $$2 +1, $$3) }'); \ + @[ -f "$(DEBIAN)/etc/update.conf" ] && . "$(DEBIAN)/etc/update.conf"; \ + if [ -n "$$BACKPORT_SUFFIX" ]; then \ + ver="$$(dpkg-parsechangelog -l"$$DEBIAN_MASTER/changelog" -SVersion)~$${BACKPORT_SUFFIX}.1"; \ + prev_ver="$$(dpkg-parsechangelog -l"$(DEBIAN)/changelog" -SVersion)"; \ + if [ "$${ver%.*}" = "$${prev_ver%.*}" ]; then \ + ver="$${ver%.*}.$$(( $${prev_ver##*.} +1 ))"; \ + fi; \ + else \ + ver="$(release)-$$(echo "$(revision)" | \ + perl -ne 'if (/^(\d*)\.(\d*)(.*)?$$/) { printf("%d.%d%s\n", $$1 + 1, $$2 +1, $$3) }')"; \ + fi; \ now="$(shell date -R)"; \ - echo "Creating new changelog set for $(release)-$$ver..."; \ - echo -e "$(src_pkg_name) ($(release)-$$ver) UNRELEASED; urgency=medium\n" > $(DEBIAN)/changelog.new; \ + echo "Creating new changelog set for $$ver..."; \ + echo -e "$(src_pkg_name) ($$ver) UNRELEASED; urgency=medium\n" > $(DEBIAN)/changelog.new; \ echo " CHANGELOG: Do not edit directly. Autogenerated at release." >> \ $(DEBIAN)/changelog.new; \ echo " CHANGELOG: Use the printchanges target to see the curent changes." \