[9000] in athena10

home help back first fref pref prev next nref lref last post

Bug#672711: sbuild: --append-to-version should set source:Version substvar

daemon@ATHENA.MIT.EDU (Geoffrey Thomas)
Sat May 12 23:36:12 2012

Reply-To: Geoffrey Thomas <geofft@MIT.EDU>, 672711@bugs.debian.org
Resent-From: Geoffrey Thomas <geofft@MIT.EDU>
Resent-To: debian-bugs-dist@lists.debian.org
Date: Sat, 12 May 2012 20:32:11 -0700 (PDT)
From: Geoffrey Thomas <geofft@MIT.EDU>
To: submit@bugs.debian.org
Message-ID: <alpine.DEB.2.00.1205121719210.13102@dr-wily.mit.edu>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII

Package: sbuild
Version: 0.62.6-1

Hi Roger,

As you saw on #debian-devel about a week ago, Paul Wise noticed (as a 
result of running the debian-derivatives analysis scripts on Debathena, 
which uses --append-to-version for all builds) that builds with 
--append-to-version do not correctly report the original/source package 
version number in the Source: field of the binary control file and binary 
.changes file. Namely, the field is expected to contain something of the 
form "package (1.0)", not just "package", if the resulting binary package 
is not version 1.0. This works fine for sbuild's --binNMU option -- the 
binary package will be version e.g. 1.0+b1, but contain a Source: field of 
"package (1.0)".

On tracking this down a little further (and noticing that 
--append-to-version=+b2 did not exhibit this bug), I found that when 
dpkg-source generates substvars (in Dpkg::Substvar), it uses the following 
logic:

sub set_version_substvars {
     my ($self, $version) = @_;

     $self->{'vars'}{'binary:Version'} = $version;
     $self->{'vars'}{'source:Version'} = $version;
     $self->{'vars'}{'source:Version'} =~ s/\+b[0-9]+$//;
     [...]
}

So the source:Version field is only correct when the binary version 
happens to end with a +bNNN (or when it is the same as the source version, 
of course). So sbuild did not need to specifically do anything about 
source:Version when --binNMU was the only option that changed the binary 
version from the source version, but this assumption is no longer true 
with --append-to-version.

I'm not sure what the right way to fix this is. Possibly sbuild itself 
should edit debian/substvars to change the source:Version field. I can't 
get --dpkg-source-opt=-Vsource:Version=1.0 to work, although maybe 
dpkg-source getting run before "Hack binNMU version" is relevant. Possibly 
dpkg-source gaining an option to be explicitly told the source package 
version is the most-right answer here, but would require changes in both 
sbuild and dpkg-dev.

-- 
Geoffrey Thomas
geofft@mit.edu



home help back first fref pref prev next nref lref last post