Bug#905614: FTBFS: Failed test 'no warnings' with libsoftware-license-perl 0.103013-2

2018-08-07 Thread gregor herrmann
On Tue, 07 Aug 2018 07:01:15 +, Damyan Ivanov wrote:

> Package: license-reconcile
> Version: 0.15
> Severity: serious
> 
> license-reconcile fails to build with libsoftware-license-perl 0.103013-2 or 
> later because of failing tests:
> 
> #   Failed test 'no warnings'
> #   at /usr/share/perl/5.28/Test/Builder.pm line 158.
> # There were 12 warning(s)
> #   Previous test 0 ''
> #   debian_text method is deprecated. Please use summary_or_text 
> methodfrom Software::LicenseMoreUtils at t/08-licensecheck.t line 57.
> #  at /usr/share/perl5/Software/License.pm line 96,  line 6.
> #   
> Software::License::debian_text(Software::License::Apache_2_0=HASH(0x55ba508b14c0))
>  called at t/08-licensecheck.t line 57
> #
> ...
> 
> This seems to be caused by the add-debian-text-method patch, part of 
> libsoftware-license-perl since 0.103013-2.
> 
> Full build logs can be seen on 
> https://ci.debian.net/packages/l/license-reconcile/


I had a look at this, but either I don't understand the
Software::License* modules not well enough, or there's something
weird going on.

With the following patch (also in git):

#v+
--- a/t/08-licensecheck.t
+++ b/t/08-licensecheck.t
@@ -6,7 +6,7 @@ use Test::NoWarnings;
 use Debian::LicenseReconcile::LicenseCheck;
 use Readonly;
 use File::Temp qw();
-use Software::License;
+use Software::LicenseMoreUtils;
 use Data::Dumper;
 require UNIVERSAL::require;

@@ -46,15 +46,14 @@ my $dir = File::Temp->newdir('t/slgenX');
 my $year = 2000;
 foreach my $license (@LICENSES) {
my $slfile = $dir->dirname . "/$license";
-   my $module = "Software::License::$license";
-   $module->require;
-   my $slobj = $module->new({
+   my $slobj = Software::LicenseMoreUtils->new_from_short_name({
holder => 'Testophilus Testownik ',
year=>$year,
+   short_name => $license,
});
open my $fh, '>', $slfile;
print $fh $slobj->notice;
-   print $fh $slobj->debian_text;
+   print $fh $slobj->summary_or_text;
close $fh;
++$year;
 }
#v-

the tests kind of work, except that they fail for all licenses which
don't have a debian short text; for them the copyright line is
duplicated, as can be seen in the dumped @data in the test, and also
in the generated temp files:

#v+
#   Failed test at t/08-licensecheck.t line 84.
# Comparing $data as a Bag
# Missing: 4 references
# Extra: 4 references
# Looks like you failed 1 test of 3.
t/08-licensecheck.t ...
1..3
ok 1 - An object of class 'Debian::LicenseReconcile::LicenseCheck' isa 
'Debian::LicenseReconcile::LicenseCheck'
$VAR1 = {
  'license' => 'test10',
  'copyright' => [
   'Copyright: 2009 Testophilus Testownik 
.'
 ],
  'file' => 'Mozilla_2_0'
};
$VAR2 = {
  'copyright' => [
   'Copyright: 2008 Testophilus Testownik 
.',
   '2008 Testophilus Testownik .'
 ],
  'license' => 'test9',
  'file' => 'MIT'
};
$VAR3 = {
  'copyright' => [
   'Copyright: 2006 Testophilus Testownik 
.'
 ],
  'license' => 'test7',
  'file' => 'LGPL_2_1'
};
$VAR4 = {
  'copyright' => [
   'Copyright: 2011 Testophilus Testownik 
.',
   '2011 Testophilus Testownik .'
 ],
  'license' => 'test12',
  'file' => 'Zlib'
};
$VAR5 = {
  'copyright' => [
   'Copyright: 2003 Testophilus Testownik 
.'
 ],
  'license' => 'test4',
  'file' => 'GPL_2'
};
$VAR6 = {
  'file' => 'GPL_1',
  'license' => 'test3',
  'copyright' => [
   'Copyright: 2002 Testophilus Testownik 
.'
 ]
};
$VAR7 = {
  'file' => 'LGPL_2',
  'copyright' => [
   'Copyright: 2005 Testophilus Testownik 
.'
 ],
  'license' => 'test6'
};
$VAR8 = {
  'copyright' => [
   'Copyright: 2007 Testophilus Testownik 
.'
 ],
  'license' => 'test8',
  'file' => 'LGPL_3_0'
};
$VAR9 = {
  'license' => 'test11',
  'copyright' => [
   'Copyright: 2010 Testophilus Testownik 
.',
   '2010 Testophilus Testownik .'
 ],
  'file' => 'QPL_1_0'
};
$VAR10 = {
   'file' => 'GPL_3',
   'license' => 'test5',
   'copyright' => [
'Copyright: 2004 Testophilus Testownik 
.'
  ]
 };
$VAR11 = {
   'file' => 'FreeBSD',
   'copyright' => [

Bug#905614: FTBFS: Failed test 'no warnings' with libsoftware-license-perl 0.103013-2

2018-08-07 Thread Damyan Ivanov
Package: license-reconcile
Version: 0.15
Severity: serious

license-reconcile fails to build with libsoftware-license-perl 0.103013-2 or 
later because of failing tests:

#   Failed test 'no warnings'
#   at /usr/share/perl/5.28/Test/Builder.pm line 158.
# There were 12 warning(s)
#   Previous test 0 ''
#   debian_text method is deprecated. Please use summary_or_text methodfrom 
Software::LicenseMoreUtils at t/08-licensecheck.t line 57.
#  at /usr/share/perl5/Software/License.pm line 96,  line 6.
#   
Software::License::debian_text(Software::License::Apache_2_0=HASH(0x55ba508b14c0))
 called at t/08-licensecheck.t line 57
#
...

This seems to be caused by the add-debian-text-method patch, part of 
libsoftware-license-perl since 0.103013-2.

Full build logs can be seen on 
https://ci.debian.net/packages/l/license-reconcile/


-- dam