Re: Making Source-Version binNMU-safe
That is actually buggy. In case the Debian version is
"-1.0.1" your code would produce "-1.0", but the correct result would be
"-1".
Um, yes, and I can fix that.
Can we decide on the naming issue (which one gets the "Source-Version"
name) before I submit a fixed patch? :-)
I guess I've got myself into the position of writing a Policy patch
on version numbering while I'm at it....
This code should work, I think (provided nobody
uses a trailing -0 or -0.0 for their uploads, which
is one of the little policy points):
{
# Get source version from possible binNMU version.
local($_);
$_ = $substvar{'Source-Version'};
if m/-0\.0\.[\d+]+$/ {
# binNMU after maintainer upload for native package
s/-0\.0\.[\d+]+$//;
} elsif m/-[\d+]+\.0\.[\d+]+$/ {
# binNMU after maintainer upload for non-native package
s/\.0\.[\d+]+$//;
} elsif m/-[\d+]+\.[\d+]+\.[\d+]+$/ {
# binNMU after NMU for any package
s/.[\d+]+$//;
}
$substvar{'Source-Version'} = $_;
}
Reply to: