diff mbox series

[1/1] UBUNTU: [Packaging] autoreconstruct -- base tag is always primary mainline version

Message ID 20190207103007.397-1-apw@canonical.com
State New
Headers show
Series [1/1] UBUNTU: [Packaging] autoreconstruct -- base tag is always primary mainline version | expand

Commit Message

Andy Whitcroft Feb. 7, 2019, 10:30 a.m. UTC
The base tag for autoreconstruct comparisons is always the primary mainline
version.  Since the switch to 3.x that has been the first two version
number elements (VERSION and PATCHLEVEL).  We already ignore the SUBLEVEL
but inexplicibly take the EXTRAVERSION into account.  This is plain wrong
as the orig.tar.gz will, for example, be of v3.13 for the trusty kernel.
The tag therefore is v$(VERSION).$(PATCHLEVEL).

Drop the errant lookup and insertion of EXTRAVERSION into the
upstream_tag specifier.

BugLink: http://bugs.launchpad.net/bugs/1806380
Signed-off-by: Andy Whitcroft <apw@canonical.com>
---
 debian/rules.d/0-common-vars.mk | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Kleber Sacilotto de Souza Feb. 7, 2019, 11:12 a.m. UTC | #1
On 2/7/19 11:30 AM, Andy Whitcroft wrote:
> The base tag for autoreconstruct comparisons is always the primary mainline
> version.  Since the switch to 3.x that has been the first two version
> number elements (VERSION and PATCHLEVEL).  We already ignore the SUBLEVEL
> but inexplicibly take the EXTRAVERSION into account.  This is plain wrong
> as the orig.tar.gz will, for example, be of v3.13 for the trusty kernel.
> The tag therefore is v$(VERSION).$(PATCHLEVEL).
>
> Drop the errant lookup and insertion of EXTRAVERSION into the
> upstream_tag specifier.
>
> BugLink: http://bugs.launchpad.net/bugs/1806380
> Signed-off-by: Andy Whitcroft <apw@canonical.com>


Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>


> ---
>  debian/rules.d/0-common-vars.mk | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/debian/rules.d/0-common-vars.mk b/debian/rules.d/0-common-vars.mk
> index 4d8886496090..e2e40b843200 100644
> --- a/debian/rules.d/0-common-vars.mk
> +++ b/debian/rules.d/0-common-vars.mk
> @@ -15,8 +15,7 @@ prev_fullver ?= $(shell dpkg-parsechangelog -l$(DEBIAN)/changelog -o1 -c1 | sed
>  # Get upstream version info
>  upstream_version := $(shell sed -n 's/^VERSION = \(.*\)$$/\1/p' Makefile)
>  upstream_patchlevel := $(shell sed -n 's/^PATCHLEVEL = \(.*\)$$/\1/p' Makefile)
> -upstream_extraversion := $(shell sed -n 's/^EXTRAVERSION = \(.*\)$$/\1/p' Makefile)
> -upstream_tag := "v$(upstream_version).$(upstream_patchlevel)$(upstream_extraversion)"
> +upstream_tag := "v$(upstream_version).$(upstream_patchlevel)"
>  
>  family=ubuntu
>
Stefan Bader Feb. 7, 2019, 11:16 a.m. UTC | #2
On 07.02.19 11:30, Andy Whitcroft wrote:
> The base tag for autoreconstruct comparisons is always the primary mainline
> version.  Since the switch to 3.x that has been the first two version
> number elements (VERSION and PATCHLEVEL).  We already ignore the SUBLEVEL
> but inexplicibly take the EXTRAVERSION into account.  This is plain wrong
> as the orig.tar.gz will, for example, be of v3.13 for the trusty kernel.
> The tag therefore is v$(VERSION).$(PATCHLEVEL).
> 
> Drop the errant lookup and insertion of EXTRAVERSION into the
> upstream_tag specifier.
> 
> BugLink: http://bugs.launchpad.net/bugs/1806380
> Signed-off-by: Andy Whitcroft <apw@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
> ---
>  debian/rules.d/0-common-vars.mk | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/debian/rules.d/0-common-vars.mk b/debian/rules.d/0-common-vars.mk
> index 4d8886496090..e2e40b843200 100644
> --- a/debian/rules.d/0-common-vars.mk
> +++ b/debian/rules.d/0-common-vars.mk
> @@ -15,8 +15,7 @@ prev_fullver ?= $(shell dpkg-parsechangelog -l$(DEBIAN)/changelog -o1 -c1 | sed
>  # Get upstream version info
>  upstream_version := $(shell sed -n 's/^VERSION = \(.*\)$$/\1/p' Makefile)
>  upstream_patchlevel := $(shell sed -n 's/^PATCHLEVEL = \(.*\)$$/\1/p' Makefile)
> -upstream_extraversion := $(shell sed -n 's/^EXTRAVERSION = \(.*\)$$/\1/p' Makefile)
> -upstream_tag := "v$(upstream_version).$(upstream_patchlevel)$(upstream_extraversion)"
> +upstream_tag := "v$(upstream_version).$(upstream_patchlevel)"
>  
>  family=ubuntu
>  
>
Kleber Sacilotto de Souza Feb. 7, 2019, 11:35 a.m. UTC | #3
On 2/7/19 11:30 AM, Andy Whitcroft wrote:
> The base tag for autoreconstruct comparisons is always the primary mainline
> version.  Since the switch to 3.x that has been the first two version
> number elements (VERSION and PATCHLEVEL).  We already ignore the SUBLEVEL
> but inexplicibly take the EXTRAVERSION into account.  This is plain wrong
> as the orig.tar.gz will, for example, be of v3.13 for the trusty kernel.
> The tag therefore is v$(VERSION).$(PATCHLEVEL).
>
> Drop the errant lookup and insertion of EXTRAVERSION into the
> upstream_tag specifier.
>
> BugLink: http://bugs.launchpad.net/bugs/1806380
> Signed-off-by: Andy Whitcroft <apw@canonical.com>
> ---
>  debian/rules.d/0-common-vars.mk | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/debian/rules.d/0-common-vars.mk b/debian/rules.d/0-common-vars.mk
> index 4d8886496090..e2e40b843200 100644
> --- a/debian/rules.d/0-common-vars.mk
> +++ b/debian/rules.d/0-common-vars.mk
> @@ -15,8 +15,7 @@ prev_fullver ?= $(shell dpkg-parsechangelog -l$(DEBIAN)/changelog -o1 -c1 | sed
>  # Get upstream version info
>  upstream_version := $(shell sed -n 's/^VERSION = \(.*\)$$/\1/p' Makefile)
>  upstream_patchlevel := $(shell sed -n 's/^PATCHLEVEL = \(.*\)$$/\1/p' Makefile)
> -upstream_extraversion := $(shell sed -n 's/^EXTRAVERSION = \(.*\)$$/\1/p' Makefile)
> -upstream_tag := "v$(upstream_version).$(upstream_patchlevel)$(upstream_extraversion)"
> +upstream_tag := "v$(upstream_version).$(upstream_patchlevel)"
>  
>  family=ubuntu
>  

Applied to trusty/master-next branch.

Thanks,
Kleber
Seth Forshee Feb. 7, 2019, 5:32 p.m. UTC | #4
On Thu, Feb 07, 2019 at 10:30:07AM +0000, Andy Whitcroft wrote:
> The base tag for autoreconstruct comparisons is always the primary mainline
> version.  Since the switch to 3.x that has been the first two version
> number elements (VERSION and PATCHLEVEL).  We already ignore the SUBLEVEL
> but inexplicibly take the EXTRAVERSION into account.  This is plain wrong
> as the orig.tar.gz will, for example, be of v3.13 for the trusty kernel.
> The tag therefore is v$(VERSION).$(PATCHLEVEL).
> 
> Drop the errant lookup and insertion of EXTRAVERSION into the
> upstream_tag specifier.
> 
> BugLink: http://bugs.launchpad.net/bugs/1806380
> Signed-off-by: Andy Whitcroft <apw@canonical.com>

Applied to disco/master-next and unstable/master, thanks!
Seth Forshee Feb. 12, 2019, 1:44 a.m. UTC | #5
On Thu, Feb 07, 2019 at 10:30:07AM +0000, Andy Whitcroft wrote:
> The base tag for autoreconstruct comparisons is always the primary mainline
> version.  Since the switch to 3.x that has been the first two version
> number elements (VERSION and PATCHLEVEL).  We already ignore the SUBLEVEL
> but inexplicibly take the EXTRAVERSION into account.  This is plain wrong
> as the orig.tar.gz will, for example, be of v3.13 for the trusty kernel.
> The tag therefore is v$(VERSION).$(PATCHLEVEL).
> 
> Drop the errant lookup and insertion of EXTRAVERSION into the
> upstream_tag specifier.

I just discovered why we were using EXTRAVERSION. That's where the -rcN
part of the version is placed, so before final release we need that to
construct a valid tag. I'm not sure if EXTRAVERSION is ever used for
anything else; it's not in any of the handful of trees I just looked at.

In one sense you're right that using EXTRAVERSION is misguided, since we
have no upstream tarball at the -rc stage. But on the other hand it
doesn't do any harm and makes the scripting work without special cases
for -rc kernels. Otherwise we could do something like this instead:

diff --git a/debian/rules.d/1-maintainer.mk b/debian/rules.d/1-maintainer.mk
index ee8010ba7fa0..477f81f6fe21 100644
--- a/debian/rules.d/1-maintainer.mk
+++ b/debian/rules.d/1-maintainer.mk
@@ -116,7 +116,11 @@ insertchanges: autoreconstruct finalchecks
 	@perl -w -f $(DROOT)/scripts/misc/insert-changes.pl $(DROOT) $(DEBIAN) 
 
 autoreconstruct:
-	$(DROOT)/scripts/misc/gen-auto-reconstruct $(upstream_tag) $(DEBIAN)/reconstruct $(DROOT)/source/options
+	if grep -q "^EXTRAVERSION = -rc[0-9]\+$$" Makefile; then \
+		rm -f $(DEBIAN)/reconstruct; \
+	else \
+		$(DROOT)/scripts/misc/gen-auto-reconstruct $(upstream_tag) $(DEBIAN)/reconstruct $(DROOT)/source/options; \
+	fi
 
 finalchecks:
 	$(DROOT)/scripts/misc/final-checks "$(DEBIAN)" "$(prev_fullver)"
Kleber Sacilotto de Souza May 7, 2019, 3:44 p.m. UTC | #6
On 2/7/19 11:30 AM, Andy Whitcroft wrote:
> The base tag for autoreconstruct comparisons is always the primary mainline
> version.  Since the switch to 3.x that has been the first two version
> number elements (VERSION and PATCHLEVEL).  We already ignore the SUBLEVEL
> but inexplicibly take the EXTRAVERSION into account.  This is plain wrong
> as the orig.tar.gz will, for example, be of v3.13 for the trusty kernel.
> The tag therefore is v$(VERSION).$(PATCHLEVEL).
> 
> Drop the errant lookup and insertion of EXTRAVERSION into the
> upstream_tag specifier.
> 
> BugLink: http://bugs.launchpad.net/bugs/1806380
> Signed-off-by: Andy Whitcroft <apw@canonical.com>
> ---
>  debian/rules.d/0-common-vars.mk | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/debian/rules.d/0-common-vars.mk b/debian/rules.d/0-common-vars.mk
> index 4d8886496090..e2e40b843200 100644
> --- a/debian/rules.d/0-common-vars.mk
> +++ b/debian/rules.d/0-common-vars.mk
> @@ -15,8 +15,7 @@ prev_fullver ?= $(shell dpkg-parsechangelog -l$(DEBIAN)/changelog -o1 -c1 | sed
>  # Get upstream version info
>  upstream_version := $(shell sed -n 's/^VERSION = \(.*\)$$/\1/p' Makefile)
>  upstream_patchlevel := $(shell sed -n 's/^PATCHLEVEL = \(.*\)$$/\1/p' Makefile)
> -upstream_extraversion := $(shell sed -n 's/^EXTRAVERSION = \(.*\)$$/\1/p' Makefile)
> -upstream_tag := "v$(upstream_version).$(upstream_patchlevel)$(upstream_extraversion)"
> +upstream_tag := "v$(upstream_version).$(upstream_patchlevel)"
>  
>  family=ubuntu
>  
> 

As per off-line discussion with Seth, I have re-applied this patch to
to disco/master-next branch as no other solution has been proposed yet.

Thanks,
Kleber
diff mbox series

Patch

diff --git a/debian/rules.d/0-common-vars.mk b/debian/rules.d/0-common-vars.mk
index 4d8886496090..e2e40b843200 100644
--- a/debian/rules.d/0-common-vars.mk
+++ b/debian/rules.d/0-common-vars.mk
@@ -15,8 +15,7 @@  prev_fullver ?= $(shell dpkg-parsechangelog -l$(DEBIAN)/changelog -o1 -c1 | sed
 # Get upstream version info
 upstream_version := $(shell sed -n 's/^VERSION = \(.*\)$$/\1/p' Makefile)
 upstream_patchlevel := $(shell sed -n 's/^PATCHLEVEL = \(.*\)$$/\1/p' Makefile)
-upstream_extraversion := $(shell sed -n 's/^EXTRAVERSION = \(.*\)$$/\1/p' Makefile)
-upstream_tag := "v$(upstream_version).$(upstream_patchlevel)$(upstream_extraversion)"
+upstream_tag := "v$(upstream_version).$(upstream_patchlevel)"
 
 family=ubuntu