This is an automated email from the git hooks/post-receive script. tincho pushed a commit to branch master in repository libconfig-model-dpkg-perl.
commit 13b6b512592f67e2607ed4cf0cd8a7701c1dcaf8 Author: Martín Ferrari <tin...@debian.org> Date: Mon Aug 28 03:41:14 2017 +0200 Add support for autopkgtest-pkg-go and others. This commit adds full support for pkg-go autopkgtest, including matching with maintainer name. It also stops considering invalid other teams supported by autodep8. I added tests for all this, but I am doubtful of their quality. --- lib/Config/Model/models/Dpkg/Control/Source.pl | 12 ++++++------ t/dpkg.t | 25 +++++++++++++++++++------ 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/lib/Config/Model/models/Dpkg/Control/Source.pl b/lib/Config/Model/models/Dpkg/Control/Source.pl index 7739dfa..4bdc3d3 100644 --- a/lib/Config/Model/models/Dpkg/Control/Source.pl +++ b/lib/Config/Model/models/Dpkg/Control/Source.pl @@ -128,27 +128,27 @@ area/section if the package is in the contrib or non-free archive areas. 'warn_unless' => { 'defined-test' => { 'code' => 'my $m = $self->grab_value(\'- Maintainer\'); -my ($team) = ( $m =~ /(pkg-(?:perl|ruby))/ ); +my ($team) = ( $m =~ /(pkg-(?:perl|ruby|go))/ ); not defined $team or defined $_;', 'fix' => 'my $m = $self->grab_value(\'- Maintainer\'); -my ($str) = ($m =~ /pkg-(perl|ruby)/); +my ($str) = ($m =~ /pkg-(perl|ruby|go)/); $_ = $str ? \'autopkgtest-pkg-\'.$str : undef;', 'msg' => 'Undefined while packaging team supports test suite' }, 'team-test' => { 'code' => 'my $m = $self->grab_value(\'- Maintainer\'); -my ($team) = ( $m =~ /(pkg-(?:perl|ruby))/ ); +my ($team) = ( $m =~ /(pkg-(?:perl|ruby|go))/ ); not defined $_ or not defined $team or $_ eq \'autopkgtest-\'.$team ;', 'fix' => 'my $m = $self->grab_value(\'- Maintainer\'); -my ($str) = ($m =~ /pkg-(perl|ruby)/); +my ($str) = ($m =~ /pkg-(perl|ruby|go)/); $_ = $str ? \'autopkgtest-pkg-\'.$str : undef;', 'msg' => 'value does not match maintainer team' } }, 'warn_unless_match' => { - '^autopkgtest(-pkg-(perl|ruby))?$' => { + '^autopkgtest(-pkg-(dkms|elpa|go|nodejs|perl|python|r|ruby))?$' => { 'fix' => 'my $m = $self->grab_value(\'- Maintainer\'); -my ($str) = ($m =~ /pkg-(perl|ruby)/); +my ($str) = ($m =~ /pkg-(perl|ruby|go)/); $_ = $str ? \'autopkgtest-pkg-\'.$str : undef;', 'msg' => 'Unknown value' } diff --git a/t/dpkg.t b/t/dpkg.t index ca7cc8f..0dd78af 100644 --- a/t/dpkg.t +++ b/t/dpkg.t @@ -20,7 +20,7 @@ if ( $@ ) { plan skip_all => "AptPkg::Config is not installed"; } elsif ( -r '/etc/debian_version' ) { - plan tests => 24; + plan tests => 43; } else { plan skip_all => "Not a Debian system"; @@ -102,7 +102,16 @@ foreach my $t (@test) { warning_is { my $ts = $root->grab_value("control source Testsuite"); -} undef, 'check that Testsuite does not warn for random maintainer '; +} undef, 'check that Testsuite does not warn for random maintainer '; + +foreach my $target (qw(dkms elpa go nodejs perl python r ruby)) { + warning_is { + $root->load("control source Testsuite=autopkgtest-pkg-$target"); + } undef, "check that Testsuite is accepted for autopkgtest-pkg-$target"; + $root->grab('control source Testsuite')->apply_fixes; + is($root->grab_value("control source Testsuite"), + "autopkgtest-pkg-$target", 'check Testsuite value'); +} warning_like { $root->load('control source Testsuite=autopkgtest-foobar'); @@ -110,6 +119,7 @@ warning_like { my @teams = ( 'Debian Perl Group <pkg-perl-maintain...@lists.alioth.debian.org>', + 'Debian Go Packaging Team <pkg-go-maintain...@lists.alioth.debian.org>', 'Debian Ruby Extras Maintainers <pkg-ruby-extras-maintain...@lists.alioth.debian.org>', ); @@ -117,21 +127,24 @@ foreach my $team (@teams) { # reset testsuite values, maintainer cannot be null, so use John Doe instead # of a packaging team that triggers a special behavior $root->load('control source Maintainer="John Doe <j...@doe.com>" Testsuite~') ; - my ($str) = ($team =~ /pkg-(perl|ruby)/); + my ($str) = ($team =~ /pkg-(perl|ruby|go)/); my $target = "autopkgtest-pkg-$str"; $root->load(qq!control source Maintainer="$team"!); - is($root->grab_value("control source Testsuite"), undef,'check Testsuite default value'); + is($root->grab_value("control source Testsuite"), undef, 'check Testsuite default value'); $root->grab('control source Testsuite')->apply_fixes; - is($root->grab_value("control source Testsuite"), $target,"check Testsuite $str output"); + is($root->grab_value("control source Testsuite"), $target, "check Testsuite $str output"); } # perl vs ruby, requires that loop above does not finish with perl team warning_like { $root->load('control source Testsuite=autopkgtest-pkg-perl'); -} qr/maintainer team/i, "check that a warning is emitted for Testsuite value mistmatch"; +} qr/maintainer team/i, "check that a warning is emitted for Testsuite value mismatch"; +$root->grab('control source Testsuite')->apply_fixes; +is($root->grab_value("control source Testsuite"), "autopkgtest-pkg-ruby", + "check invalid Testsuite is replaced with team flavour"); my $lic_text = $root->grab(steps => "copyright License:FooBar text", check => 'no'); is($lic_text->fetch, undef, "test unknown lic text") ; -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libconfig-model-dpkg-perl.git _______________________________________________ Pkg-perl-cvs-commits mailing list Pkg-perl-cvs-commits@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-perl-cvs-commits