summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgregor herrmann <gregoa@debian.org>2021-09-08 20:24:38 +0200
committergregor herrmann <gregoa@debian.org>2021-09-08 20:40:55 +0200
commit4032e0657b9841d303d254827904377e27c3e924 (patch)
treeaa6751a45b4c490b4b2f3348b93aa01b20635ee5
parentca6aa5eea6ac311efad0aa7458c08c9eab9ec525 (diff)
improve Standars-Version handling
relax regexp and croak on failure thanks: dod Gbp-Dch: Ignore
-rw-r--r--lib/Config/Model/Dpkg/Control/Source/StandardVersion.pm4
-rw-r--r--t/model_tests.d/dpkg-control-test-conf.pl4
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/Config/Model/Dpkg/Control/Source/StandardVersion.pm b/lib/Config/Model/Dpkg/Control/Source/StandardVersion.pm
index 29739239..9490be50 100644
--- a/lib/Config/Model/Dpkg/Control/Source/StandardVersion.pm
+++ b/lib/Config/Model/Dpkg/Control/Source/StandardVersion.pm
@@ -8,10 +8,12 @@ extends 'Config::Model::Value';
use Sort::Versions;
use feature qw/postderef signatures/;
no warnings qw/experimental::postderef experimental::signatures/;
+use Carp;
# lintian 2.105.0, #968000
chomp( my $std_ver = qx| /usr/share/lintian/private/latest-policy-version | );
-$std_ver =~ s|^(\d+\.\d+\.\d+)\.\d+$|$1|;
+$std_ver =~ s|^(\d+\.\d+\.\d+)|$1|;
+croak "Failed to get last Standards-Version" unless defined $std_ver;
sub _fetch_std {
goto &_fetch_std_no_check;
diff --git a/t/model_tests.d/dpkg-control-test-conf.pl b/t/model_tests.d/dpkg-control-test-conf.pl
index d2539a7a..6ada8b54 100644
--- a/t/model_tests.d/dpkg-control-test-conf.pl
+++ b/t/model_tests.d/dpkg-control-test-conf.pl
@@ -1,6 +1,7 @@
use Data::Dumper;
use Path::Tiny;
use Config::Model::Dpkg::Dependency;
+use Carp;
use strict;
use warnings;
@@ -10,7 +11,8 @@ my $conf_dir = 'debian';
# lintian 2.105.0, #968000
chomp( my $std_ver = qx| /usr/share/lintian/private/latest-policy-version | );
-$std_ver =~ s|^(\d+\.\d+\.\d+)\.\d+$|$1|;
+$std_ver =~ s|^(\d+\.\d+\.\d+)|$1|;
+croak "Failed to get last Standards-Version" unless defined $std_ver;
my $t3_description = "This is an extension of Dist::Zilla::Plugin::InlineFiles,
providing the following file: