Bug#530675: dh-make-perl: uninit warning building cpan libintl-perl

Damyan Ivanov dam at modsoftsys.com
Wed May 27 09:18:28 UTC 2009


tags 530675 confirmed
thanks

-=| Kevin Ryde, Wed, May 27, 2009 at 07:48:19AM +1000 |=-
> Package: dh-make-perl
> Version: 0.55
> Severity: minor
> File: /usr/bin/dh-make-perl
> 
> When building libintl-perl from cpan,
> 
>     wget http://search.cpan.org/CPAN/authors/id/G/GU/GUIDO/libintl-perl-1.18.tar.gz
>     tar xfz libintl-perl-1.18.tar.gz
>     dh-make-perl --build libintl-perl-1.18
> 
> dh-make-perl gives a warning
> 
>     Use of uninitialized value in pattern match (m//) at /usr/share/perl5/DhMakePerl.pm line 545.
> 
> libintl-perl is a debian package of course, so dh-make-perl is not
> normally needed on it, but perhaps the warning is something to do with
> "-perl" already in the name.

The warning is present in trunk too. The cause is that no --cpan 
option is given and the dist name matches /-perl$/. Here's the code:

    ( $perlname, $version ) = $self->extract_name_ver();
    $pkgname = lc $perlname;
    $pkgname = 'lib' . $pkgname unless $pkgname =~ /^lib/;
    $pkgname .= '-perl'
        unless ( $pkgname =~ /-perl$/
            and $self->cfg->cpan !~ /::perl$/i );

As I see it (unless !~ is confusing me) , the idea is to not append 
-perl to package name if it is already there, unless -perl$ was 
specified on the command line. So things like File::Find::Rule::Perl 
get a package name of libfile-find-rule-perl-perl.

The problem here is that $self->cfg->cpan is not defined because no 
--cpan option was used (in fact I didn't succeed in fetching the dist 
from the cpan shell).

I am not sure why the check for --cpan is there. That code is present 
in the earliest SVN revision I've found, r4172 ("Adding the 'tools' 
directory, with dh-make-perl 0.23", by gwolf in October 2006).

The package name is derived from distribution name anyway, not from 
--cpan argument directly and the code seems to trust --cpan argument 
more than the upstream contents. I think that the while condition 
shall be dropped, i.e.

    $pkgname .= '-perl';


How does this sound?

-- 
dam
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-perl-maintainers/attachments/20090527/c811dea0/attachment.pgp>


More information about the pkg-perl-maintainers mailing list