[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#768440: unblock: libconfig-model-dpkg-perl/2.059



Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock

Please unblock package libconfig-model-dpkg-perl

version 2.058 has 2 bugs related to handling the content
of debian/copyright (#767494):
- default license text is not found when adding a know license
  section in debian/copyright
- a misleading warning message about license text is issued
  when running 'cme check dpkg' even if the content of
  debian/copyright is fine

As a packager, I find the misleading error message (#767494) really
annoying. I think this should be part of Jessie so that backporters
are not misled during their packaging activities.

version 2.059 fixes these 2 problems in
lib/Config/Model/models/Dpkg/Copyright/LicenseSpec.pl by:
- making sure that the license text is returned by adding
  '$text' at the end of the code to be eval'ed (the formula)
- commenting out the code issuing the misleading message. This message
  actually means that Software::License module does not know the
  license short name in debian/copyright (which happens most of the
  time: Software::License know only about well known license like Apache
  GPL Artistic)

The modification in lib/Config/Model/models/Dpkg/Control/Binary.pl is
purely cosmetic ( \ replaced by \\ in a string generated by
Data::Dumper when saving Dpkg model with 'config-model-edit').

The last part of the patch is a addition to tests (t/dpkg.t) to ensure
that eval'ed code actually finds well known license text.

The debdiff is attached to this message.

Thanks

unblock libconfig-model-dpkg-perl/2.059

-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.16-3-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff -Nru libconfig-model-dpkg-perl-2.058/debian/changelog libconfig-model-dpkg-perl-2.059/debian/changelog
--- libconfig-model-dpkg-perl-2.058/debian/changelog	2014-10-10 16:45:25.000000000 +0200
+++ libconfig-model-dpkg-perl-2.059/debian/changelog	2014-10-31 14:08:51.000000000 +0100
@@ -1,3 +1,11 @@
+libconfig-model-dpkg-perl (2.059) unstable; urgency=medium
+
+  * Copyright license text (Closes: #767494):
+    * fix (really) automatic import of license summary or text
+    * suppress misleading warning
+
+ -- Dominique Dumont <dod@debian.org>  Fri, 31 Oct 2014 14:06:18 +0100
+
 libconfig-model-dpkg-perl (2.058) unstable; urgency=medium
 
   * Team upload.
diff -Nru libconfig-model-dpkg-perl-2.058/lib/Config/Model/models/Dpkg/Control/Binary.pl libconfig-model-dpkg-perl-2.059/lib/Config/Model/models/Dpkg/Control/Binary.pl
--- libconfig-model-dpkg-perl-2.058/lib/Config/Model/models/Dpkg/Control/Binary.pl	2014-10-10 16:45:25.000000000 +0200
+++ libconfig-model-dpkg-perl-2.059/lib/Config/Model/models/Dpkg/Control/Binary.pl	2014-10-31 14:08:51.000000000 +0100
@@ -305,7 +305,7 @@
       'Build-Profiles',
       {
         'description' => 'A list of lists of (optionally negated) profile names, forming a conjunctive normal form expression in the same syntax as in the Build-Depends field',
-        'match' => '<!?[a-z0-9]+(?:\s+!?[a-z0-9]+)*>(?:\s+<!?[a-z0-9]+(?:\s+!?[a-z0-9]+)*>)*',
+        'match' => '<!?[a-z0-9]+(?:\\s+!?[a-z0-9]+)*>(?:\\s+<!?[a-z0-9]+(?:\\s+!?[a-z0-9]+)*>)*',
         'type' => 'leaf',
         'value_type' => 'uniline'
       }
diff -Nru libconfig-model-dpkg-perl-2.058/lib/Config/Model/models/Dpkg/Copyright/LicenseSpec.pl libconfig-model-dpkg-perl-2.059/lib/Config/Model/models/Dpkg/Copyright/LicenseSpec.pl
--- libconfig-model-dpkg-perl-2.058/lib/Config/Model/models/Dpkg/Copyright/LicenseSpec.pl	2014-10-10 16:45:25.000000000 +0200
+++ libconfig-model-dpkg-perl-2.059/lib/Config/Model/models/Dpkg/Copyright/LicenseSpec.pl	2014-10-31 14:08:51.000000000 +0100
@@ -24,17 +24,22 @@
           'formula' => 'require Software::LicenseUtils ;
 my $lic = &index( - ) ;
 my $h = { short_name => $lic, holder => \'foo\' } ;
+my $text;
 
 if (defined $lic and $lic) {
    # no need to fail if short_name is unknown
    eval {
-       Software::LicenseUtils->new_from_short_name($h)->debian_text ;
+       $text = Software::LicenseUtils->new_from_short_name($h)->debian_text ;
    } ;
 
-   if ($@ and ! $self->{data}) {
-       print "Cannot find license text for $lic\\n" ;
-   }
-}',
+# FIXME: find a way to warn user if a license is unknown only when
+# text is not set by another mean...
+#   if ($@ and ! $self->value_object->{data}) {
+#       print "Cannot find license text for $lic\\n" ;
+#   }
+}
+
+$text;',
           'undef_is' => '\'\'',
           'use_eval' => '1'
         },
diff -Nru libconfig-model-dpkg-perl-2.058/t/dpkg.t libconfig-model-dpkg-perl-2.059/t/dpkg.t
--- libconfig-model-dpkg-perl-2.058/t/dpkg.t	2014-10-10 16:45:25.000000000 +0200
+++ libconfig-model-dpkg-perl-2.059/t/dpkg.t	2014-10-31 14:08:51.000000000 +0100
@@ -1,5 +1,7 @@
 # -*- cperl -*-
 
+use 5.10.0;
+
 use ExtUtils::testlib;
 use Test::More ;
 use Test::Memory::Cycle;
@@ -18,7 +20,7 @@
     plan skip_all => "AptPkg::Config is not installed";
 }
 elsif ( -r '/etc/debian_version' ) {
-    plan tests => 15;
+    plan tests => 18;
 }
 else {
     plan skip_all => "Not a Debian system";
@@ -97,4 +99,19 @@
 $root->load('control source Maintainer="foo <foo@bar>" ! my_config dependency-filter=lenny') ;
 is($root->grab_value("my_config package-dependency-filter:foopkg"),
     'lenny', "check package-dependency-filter");
+
+
+my $lic_text = $root->grab("copyright License:FooBar text");
+is($lic_text->fetch, undef, "test unknown lic text") ;
+
+say "store lic_text" if $trace ;
+$lic_text->store("yada yada");
+
+say "test stored lic_text" if $trace ;
+is($lic_text->fetch, 'yada yada', "test specified lic text") ;
+
+my $lic_gpl = $root->grab("copyright License:GPL-1 text");
+like($lic_gpl->fetch,qr!/usr/share/common-licenses/GPL-1!
+     , "retrieved license text summary") ;
+
 memory_cycle_ok($model);

Reply to: