Your message dated Tue, 12 Jun 2018 20:43:54 +0000
with message-id <e1fsq8w-000aq0...@fasolo.debian.org>
and subject line Bug#851848: fixed in dh-make-perl 0.84-2+deb8u1
has caused the Debian Bug report #851848,
regarding dh-make-perl: Dependency resolution using Debian::AptContents fails 
with current Contents files in Debian archive
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
851848: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=851848
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: dh-make-perl
Version: 0.84-2
Severity: normal
Tags: patch

Dear Maintainer,

I recently noticed that the dependency resolution does not find existing Debian
packages anymore when it is done using Debian::AptContents. One example is a
Perl distribution that uses Catalyst::Runtime, which resulted in a dependency
on libcatalyst-runtime-perl (caused by falling back to CPAN-based dependency
resolution), even though Catalyst::Runtime is part of the libcatalyst-perl
package available in Debian.

After adding some debug code to dh-make-perl and looking at Contents.cache, I
noticed that a lot of files never made it into the cache. Then I noticed that
Debian::AptContents attempts to skip the header in Contents files, which is not
contained in current Contents files in the archive anymore (which likely is a
change that became visible for Jessie during the recent point release, the main
bug regarding this seems to be #841997 [1], and there already is #842887 [2] in
dh-make-perl, which is somewhat related). This change in the Contents files
does not affect current versions of dh-make-perl, but caused a regression in
the version of dh-make-perl in Jessie. The attached patch fixed the problem for
me.

Kind regards
Manfred

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=841997
[2] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=842887

-- System Information:
Debian Release: 8.7
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.8.0-0.bpo.2-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_CH.utf8, LC_CTYPE=de_CH.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages dh-make-perl depends on:
ii  debhelper                         9.20150101+deb8u2
ii  dpkg-dev                          1.17.27
ii  fakeroot                          1.20.2-1
ii  libapt-pkg-perl                   0.1.29+b2
ii  libarray-unique-perl              0.08-1
ii  libclass-accessor-perl            0.34-1
ii  libcpan-meta-perl                 2.142690-1
ii  libdpkg-perl                      1.17.27
ii  libemail-address-perl             1.905-2
ii  libemail-date-format-perl         1.005-1
ii  libfile-which-perl                1.09-1
ii  liblist-moreutils-perl            0.33-2+b1
ii  libmodule-depends-perl            0.16-1
ii  libparse-debcontrol-perl          2.005-4
ii  libparse-debianchangelog-perl     1.2.0-1.1
ii  libsoftware-license-perl          0.103010-3
ii  libtie-ixhash-perl                1.23-1
ii  libwww-mechanize-perl             1.73-2
ii  libyaml-libyaml-perl              0.41-6
ii  libyaml-perl                      1.13-1
ii  make                              4.0-8.1
ii  perl                              5.20.2-3+deb8u6
ii  perl-modules [libcpan-meta-perl]  5.20.2-3+deb8u6

Versions of packages dh-make-perl recommends:
ii  apt-file      2.5.4
ii  git           1:2.1.4-2.1+deb8u2
ii  pristine-tar  1.33

dh-make-perl suggests no packages.

-- debconf-show failed
>From d18535572869a6a3e526bfb4ad08e667ce479c71 Mon Sep 17 00:00:00 2001
From: Manfred Stock <manfred.stock+deb...@gmail.com>
Date: Thu, 19 Jan 2017 09:34:13 +0100
Subject: [PATCH] Support Contents files without header

Current versions of the Contents files in the Debian archive don't seem to
contain a header anymore, which kind-of breaks the parser, as it only processed
lines after the line matched by the regular expression ^FILE\s+LOCATION. Since
the regular expression which is used to parse the file column of the Contents
files looks robust enough, it seems like this check can be dropped (which gets
done in a rather unrelated change in dh-make-perl commit
885b31c44b4a61d6f6ca44d3335c20506ab41ee9, too, so current versions are not
affected by this problem).
---
 lib/Debian/AptContents.pm                         | 38 ++++++++++-------------
 t/AptContents.t                                   | 16 +++++++++-
 t/contents/sources.list                           |  1 +
 t/contents/test_debian_dists_stable_main_Contents |  2 ++
 4 files changed, 34 insertions(+), 23 deletions(-)
 create mode 100644 t/contents/test_debian_dists_stable_main_Contents

diff --git a/lib/Debian/AptContents.pm b/lib/Debian/AptContents.pm
index e47af51..5844847 100644
--- a/lib/Debian/AptContents.pm
+++ b/lib/Debian/AptContents.pm
@@ -315,30 +315,24 @@ sub read_cache {
             }
 
             $self->warning( 1, "Parsing $_ ..." );
-            my $capturing = 0;
             my $line;
             while ( defined( $line = $f->getline ) ) {
-                if ($capturing) {
-                    my ( $file, $packages ) = split( /\s+/, $line );
-                    next unless $file =~ s{
-                        ^usr/
-                        (?:share|lib)/
-                        (?:perl\d+/             # perl5/
-                        | perl/(?:\d[\d.]+)/   # or perl/5.10/
-                        )
-                    }{}x;
-                    $cache->{apt_contents}{$file} = exists $cache->{apt_contents}{$file}
-                        ? $cache->{apt_contents}{$file}.','.$packages
-                        : $packages;
-
-                    # $packages is a comma-separated list of
-                    # section/package items. We'll parse it when a file
-                    # matches. Otherwise we'd parse thousands of entries,
-                    # while checking only a couple
-                }
-                else {
-                    $capturing = 1 if $line =~ /^FILE\s+LOCATION/;
-                }
+                my ( $file, $packages ) = split( /\s+/, $line );
+                next unless $file =~ s{
+                    ^usr/
+                    (?:share|lib)/
+                    (?:perl\d+/             # perl5/
+                    | perl/(?:\d[\d.]+)/   # or perl/5.10/
+                    )
+                }{}x;
+                $cache->{apt_contents}{$file} = exists $cache->{apt_contents}{$file}
+                    ? $cache->{apt_contents}{$file}.','.$packages
+                    : $packages;
+
+                # $packages is a comma-separated list of
+                # section/package items. We'll parse it when a file
+                # matches. Otherwise we'd parse thousands of entries,
+                # while checking only a couple
             }
         }
 
diff --git a/t/AptContents.t b/t/AptContents.t
index 4aec946..9348e49 100755
--- a/t/AptContents.t
+++ b/t/AptContents.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 26;
+use Test::More tests => 29;
 
 BEGIN {
     use_ok 'Debian::AptContents';
@@ -125,6 +125,8 @@ $apt_contents = instance();
 
 is( $apt_contents->source, 'cache', 'cache was used' );
 
+is(scalar keys %{$apt_contents->cache()->{apt_contents}}, 185, 'all Perl-related Contents lines read');
+
 sleep(1);   # allow the clock to tick so the timestamp actually differs
 touch( glob "$Bin/contents/*Contents*" );
 
@@ -143,6 +145,7 @@ is( $apt_contents->find_perl_module_package('Moose') . '',
 is_deeply(
     $apt_contents->get_contents_files,
     [   "$Bin/contents/test_debian_dists_sid_main_Contents",
+        "$Bin/contents/test_debian_dists_stable_main_Contents",
         "$Bin/contents/test_debian_dists_testing_main_Contents"
     ]
 );
@@ -159,6 +162,17 @@ is( $apt_contents->find_perl_module_package('GD') . '',
 );
 
 is_deeply(
+    [ $apt_contents->find_file_packages('Catalyst/Runtime.pm') ],
+    [ 'libcatalyst-perl' ],
+    "Catalyst/Runtime.pm is in libcatalyst-perl"
+);
+
+is( $apt_contents->find_perl_module_package('Catalyst::Runtime') . '',
+    'libcatalyst-perl',
+    'Catalyst::Runtime found by module name'
+);
+
+is_deeply(
     [ $apt_contents->find_file_packages('Image/Magick.pm') ],
     [ 'perlmagick', 'graphicsmagick-libmagick-dev-compat' ],
     "Image/Magick.pm in perlmagick and graphicsmagick-libmagick-dev-compat, but different paths"
diff --git a/t/contents/sources.list b/t/contents/sources.list
index bb7f14b..f7a11d4 100644
--- a/t/contents/sources.list
+++ b/t/contents/sources.list
@@ -3,6 +3,7 @@
 deb http://test/debian sid main
 deb http://test/debian testing main
 deb http://test/debian testing main
+deb http://test/debian stable main
 deb     http://security.debian.org/ stable/updates main contrib non-free
 deb     http://www.toastfreeware.priv.at/debian stable/
 deb     http://www.kiberpipa.org/~minmax/cinelerra/builds/sid/ ./
diff --git a/t/contents/test_debian_dists_stable_main_Contents b/t/contents/test_debian_dists_stable_main_Contents
new file mode 100644
index 0000000..d3b8354
--- /dev/null
+++ b/t/contents/test_debian_dists_stable_main_Contents
@@ -0,0 +1,2 @@
+bin/afio						    utils/afio
+usr/share/perl5/Catalyst/Runtime.pm perl/libcatalyst-perl
-- 
2.1.4


--- End Message ---
--- Begin Message ---
Source: dh-make-perl
Source-Version: 0.84-2+deb8u1

We believe that the bug you reported is fixed in the latest version of
dh-make-perl, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 851...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
gregor herrmann <gre...@debian.org> (supplier of updated dh-make-perl package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Fri, 08 Jun 2018 22:31:49 +0200
Source: dh-make-perl
Binary: dh-make-perl
Architecture: source all
Version: 0.84-2+deb8u1
Distribution: jessie
Urgency: medium
Maintainer: Debian Perl Group <pkg-perl-maintain...@lists.alioth.debian.org>
Changed-By: gregor herrmann <gre...@debian.org>
Description:
 dh-make-perl - helper for creating Debian packages from perl modules
Closes: 851848
Changes:
 dh-make-perl (0.84-2+deb8u1) jessie; urgency=medium
 .
   [ Manfred Stock ]
   * Support Contents files without header.
     Current versions of the Contents files in the Debian archive don't seem to
     contain a header anymore, which kind-of breaks the parser, as it only
     processed lines after the line matched by the regular expression
     ^FILE\s+LOCATION. Since the regular expression which is used to parse the
     file column of the Contents files looks robust enough, it seems like this
     check can be dropped.
 .
     Closes: #851848
Checksums-Sha1:
 7f1806db78523fd3a52420a62b8b8479153f0db2 3155 dh-make-perl_0.84-2+deb8u1.dsc
 1f8b8d39477fffb224b9c70a914fd4d2e890d937 27032 
dh-make-perl_0.84-2+deb8u1.debian.tar.xz
 c5703b33877b6a7da24f52e58441cc6aebe0a548 170798 
dh-make-perl_0.84-2+deb8u1_all.deb
Checksums-Sha256:
 6da856e5be188c589e910a3d71ac8cfc62c794adae7e7f0daf7cb5a36903bf53 3155 
dh-make-perl_0.84-2+deb8u1.dsc
 a8e319030a730c179af0f80fbb58e36343f3a9edd05ba52f5378d85c9896d66d 27032 
dh-make-perl_0.84-2+deb8u1.debian.tar.xz
 e1b8e652d169fd60d208a91fea5ae47460d235001e9fa49775078dbc2478d9fa 170798 
dh-make-perl_0.84-2+deb8u1_all.deb
Files:
 8b1c5b117dda815dd6c638462f6f7d85 3155 perl optional 
dh-make-perl_0.84-2+deb8u1.dsc
 dfd490dcbd1d01724c6603a2b3a041c9 27032 perl optional 
dh-make-perl_0.84-2+deb8u1.debian.tar.xz
 6ceabdfa806988cf101a04c362733214 170798 perl optional 
dh-make-perl_0.84-2+deb8u1_all.deb

-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEE0eExbpOnYKgQTYX6uzpoAYZJqgYFAlsa6FtfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEQx
RTEzMTZFOTNBNzYwQTgxMDREODVGQUJCM0E2ODAxODY0OUFBMDYACgkQuzpoAYZJ
qgbxGRAAhICc3rbSOHJNaEvqG4fcRDw9pPr6S+TpoRah5UQZOaFwjLPopHXxIg3w
GiB+cGfjQrFf6jSSQAUS5f/3NCMjfc8hIN7xDIHB0hapNRG5A99ocpN9P0JvANW/
6x6Js/KXnCoPfa4nSkDN8OzSG9sJNv8pQOx8g7Gb7yb6weHMdNU6M1+zHqno8m3k
dV5NIyi2+e9G1CumO0Wudyrdq9K4sjDNeml9YxrBsc7kxu0Y7qxAYSNB0h13/mNM
fG/Yk7W5qUo2zL3KVEIZTbuIJ3VL3Qh4z6Mr2QHyWXY69naUio0aZBx4CJVLBluT
InWysS8PLs1VgsUArt1QPhH48OCcpJYxJ79B3H8Y1lr0coRykuOyug4cxzAzb/dd
dpjm0ZbW4ly4URG+Ogusof5LRUDz93heOx/RiE+4CpEE86gnz3C18Kc4hb7Lxodl
rWpgCoQjiCvesU5ZPntyoRWaV2VYtrkaXTAIVkJ+8TqGDvsTqgOkbB3FaK6ECrDw
nezPDs2IKM8p7OTuF3i3gJy31M7k3at6kh+lrfEPU3yGhMkYnDhz1yaty+efE9vu
VkikfGtn4xzKrC1Jxq3YmcKYuxg3DKy0o+24Xdvxy0r/hsO4T+59LmpKH4GpBm4T
1BtRKxJn3UZ+dVMzWSKlswOTrGOYai6h+idNEnPnalRhPB+XE8o=
=jDx/
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to