Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 189865 - app-portage/g-cpan won't install Data::Dump because thinks part of core perl install
Summary: app-portage/g-cpan won't install Data::Dump because thinks part of core perl ...
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Perl team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-22 18:28 UTC by Marcus Sen
Modified: 2012-06-12 16:29 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcus Sen 2007-08-22 18:28:21 UTC
Can't install Data::Dump with g-cpan . I guess the search through the /var/db/pkg/dev-lang/perl-.../CONTENTS matches Data/Dumper as Data/Dump is a substring. 

Reproducible: Always

Steps to Reproduce:
1. g-cpan -i Data::Dump

Actual Results:  
 * Data::Dump is part of the core perl install
 * Nothing to install!!


Expected Results:  
Successful install of Data::Dump

Using g-cpan 0.15.0-r1, perl 5.8.8-r2
Comment 1 Fabio Coatti 2007-10-31 10:11:25 UTC
Confirmed here: I suppose that the problem is in the regexp used to loock for packages in core installation.

I've placed a debug line at 517 in g-cpan file:

                                           {
                                                spinner_stop();
                                                        print_info("$ebuild_wanted - $thisfile is part of the core perl install");
                                                        return;
                                                }
                    }

and the result is:

kefk ~ # g-cpan -i Data::Dump
 * Data::Dump - /usr/lib/perl5/5.8.8/i686-linux-thread-multi/auto/Data/Dumper
 is part of the core perl install
 * Nothing to install!!
kefk ~ #


basically, the regexp is broken and identifies the wrong package. In a few minutes I'll send a possible fix (now I'm in a hurry)
Comment 2 Fabio Coatti 2007-10-31 10:31:57 UTC
Maybe something like that?
============================================================
--- /usr/bin/g-cpan     2007-10-31 11:24:52.000000000 +0100
+++ g-cpan      2007-10-31 11:26:09.583302945 +0100
@@ -511,7 +511,7 @@
                     {
                         my $thisfile = (split(/ /, $_))[1];
                                                $thisfile =~ s{\.([A-Za-z]{1,3})$}{};
-                        if (($thisfile =~ m{$eb}x) && !defined($passed_to_install{$eb}))
+                        if (($thisfile =~ m{$eb$}x) && !defined($passed_to_install{$eb}))
                                                {
                                                spinner_stop();
                                                        print_info("$ebuild_wanted is part of the core perl install");

============================================================

Not sure if I broke something else and it's not tested, it works just only in case of Data::Dump e Data::Dumper

Comment 3 Erik Wasser 2008-04-09 06:27:25 UTC
(In reply to comment #2)

> Maybe something like that?

Thanks for that. The fix is working here too.
Comment 4 David Sparks 2008-06-04 18:20:36 UTC
--- /usr/bin/g-cpan~    2008-06-04 11:18:26.468577219 -0700
+++ /usr/bin/g-cpan     2008-06-04 11:18:36.996578232 -0700
@@ -511,7 +511,7 @@
                     {
                         my $thisfile = (split(/ /, $_))[1];
                                                $thisfile =~ s{\.([A-Za-z]{1,3})$}{};
-                        if (($thisfile =~ m{$eb}x) && !defined($passed_to_install{$eb}))
+                        if (($thisfile =~ m{^$eb$}x) && !defined($passed_to_install{$eb}))
                                                {
                                                spinner_stop();
                                                        print_info("$ebuild_wanted is part of the core perl install");
Comment 5 Yuval Yaari (RETIRED) gentoo-dev 2008-10-04 18:01:30 UTC
Just FYI (and mainly a reminder to myself), both suggested regexps are not a "fix", you just broke the regex so the check would fail.
The code for checking if a requested module is a core module is a bit wrong/outdated, I'll work on refactoring it.
Comment 6 Sergiy Borodych 2008-10-06 18:39:39 UTC
For me worked this

if (($thisfile =~ m/\Q$eb\E$/) && !defined($passed_to_install{$eb}))
Comment 7 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-02-15 04:16:42 UTC
Already fixed from the looks of things.
If not, please give me a testcase other than Data::Dump (which has dev-perl/Data-Dump already).
Comment 8 William Throwe 2012-06-11 04:26:11 UTC
Please reopen.  This is not fixed as of g-cpan-0.16.4.  (It does not appear that anything was ever changed.)

A failing package is Hash::FieldHash :

$ g-cpan -g Hash::FieldHash
 * Hash::FieldHash is part of the core perl install
$ corelist Hash::FieldHash

Hash::FieldHash was not in CORE (or so I think)
$ 

It appears to be finding /usr/lib/perl5/5.12.4/x86_64-linux/auto/Hash/Util/FieldHash/FieldHash.so
Comment 9 Sergiy Borodych 2012-06-12 07:40:02 UTC
Confirmed,

and problem with Data::Dump still here also

$ g-cpan -i -p -v Data::Dump
 * Data::Dump is part of the core perl install
 * Nothing to install!!
 * Cleaning temporary space

because we still have 

($thisfile =~ m{$eb}x)

at g-cpan l. 536
Comment 10 Sergiy Borodych 2012-06-12 10:06:49 UTC
https://github.com/gentoo-perl/g-cpan/pull/1