Commit 425c2f8e authored by Chris Lamb's avatar Chris Lamb

Add support for derivative-specific version validation to permit enforcement of…

Add support for derivative-specific version validation to permit enforcement of additional restrictions on the version number.
parent fb04da29
......@@ -206,3 +206,13 @@ Info: The packaging includes an upstream signing key but the corresponding
.
Support for signatures was added to <tt>pristine-tar</tt> in version 1.41
and support in <tt>git-buildpackage</tt> is being tracked in #872864.
Tag: invalid-version-number-for-derivative
Severity: serious
Certainty: certain
Info: The version number for this package does not comply with the
required format for this Debian derivative.
.
Derivative distributions of Debian may enforce additional restrictions
on the version in order to ensure that forked (or packages that are
otherwise modified) are marked as such.
......@@ -32,6 +32,8 @@ use Lintian::Util qw(get_file_checksum);
my $KNOWN_DISTS = Lintian::Data->new('changes-file/known-dists');
my $SIGNING_KEY_FILENAMES = Lintian::Data->new('common/signing-key-filenames');
my $DERIVATIVE_VERSIONS= Lintian::Data->new('changes-file/derivative-versions',
qr/\s*~~\s*/, sub { $_[1]; });
sub run {
my (undef, undef, $info, undef, $group) = @_;
......@@ -254,6 +256,14 @@ sub run {
if $seen != $expected;
}
# Check version field
my $version = $info->field('version');
foreach my $re ($DERIVATIVE_VERSIONS->all) {
next if $version =~ m/$re/;
my $explanation = $DERIVATIVE_VERSIONS->value($re);
tag 'invalid-version-number-for-derivative', $version,"($explanation)";
}
return;
}
......
# Derivative-specific version number validation
#
# format: $regex ~~ explanation
. ~~ always matches
......@@ -2,6 +2,10 @@ lintian (2.5.82) UNRELEASED; urgency=medium
XXX: generate tag summary
* checks/changes-file.{desc,pm}:
+ [CL] Add support for derivative-specific version validation to permit
enforcement of additional restrictions on the version number such as
being suffixed by "derivativeos1", etc.
* checks/debhelper.pm:
+ [CL] Add a special case for the python3 addon as it needs a
dependency on dh-python unless the -dev packages are used.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment