Bug 1132321

Summary: cpan should offer creating site directories
Product: [Fedora] Fedora Reporter: unclebob
Component: perlAssignee: Petr Pisar <ppisar>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: cweyl, iarnell, jplesnik, kasal, perl-devel, ppisar, psabata, rc040203, tcallawa
Target Milestone: ---Keywords: FutureFeature, Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: perl-5.18.4-305.fc21 Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
: 1158873 (view as bug list) Environment:
Last Closed: 2014-11-10 06:28:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1090112    
Bug Blocks:    
Attachments:
Description Flags
Fix ported to perl-5.18.4 none

Description unclebob 2014-08-21 06:41:37 UTC
Description of problem:

The command

    cpan install WeakRef

installed the module incorrectly into

    /root/perl5/lib/perl5/x86_64-linux-thread-multi/auto

instead of the global directory.

Version-Release number of selected component (if applicable):

perl-CPAN-2.00-289.fc20.noarch

How reproducible:

Every time.

Steps to Reproduce:

As root enter-
1. yum install perl-CPAN
2. cpan install WeakRef
3.

Actual results:

Module installed in /root/perl5/..... 

Expected results:

Module installed in 

/usr/local/share/perl5

Additional info:

It is possible to clear this bug by removing /root/.cpan and /root/perl5/, editing out the two lines cpan adds to /root/.bashrc, closing the shell and reopening then rerunning the command, but selecting manual as the installation method.

Comment 1 Petr Pisar 2014-08-21 11:09:19 UTC
This is matter of cpan tool configuration. If you configured cpan to install files into ~/perl5, then it will install it there. If you remove ~/.cpan/CPAN/MyConfig.pm (or the global one under /usr/share/perl5), and run cpan(1) again, you get question, where how to install the files:


Warning: You do not have write permission for Perl library directories.

To install modules, you need to configure a local Perl library directory or
escalate your privileges.  CPAN can help you by bootstrapping the local::lib
module or by configuring itself to use 'sudo' (if available).  You may also
resolve this problem manually if you need to customize your setup.

What approach do you want?  (Choose 'local::lib', 'sudo' or 'manual')

The message is a little bit misleading, because the real error is that /usr/local/{lib*,share}/perl5 do not exist. If select `manual' or if you create the directories, cpan will install into the site perl directories.

Comment 2 unclebob 2014-08-21 11:33:40 UTC
Granted, but the point is that installing out of the box cpan doesn't work. By reading the code and experimenting I manged to get it to life, but for the ordinary user this would be a pain.

As supplied cpan does not let you install modules. To my mind this is wrong.

Comment 3 Petr Pisar 2014-08-21 11:41:31 UTC
Who said that "installing out of the box" means "install into site directories"?

Comment 4 Petr Pisar 2014-08-21 14:43:59 UTC
I think the cpan(1) tool could be augmented to create the site directories if they are missing.

Comment 5 Petr Pisar 2014-10-30 14:05:52 UTC
I fixed it as perl-CPAN-2.05-308.fc22 in F22. Older Fedoras will patch the perl sources.

Comment 6 Petr Pisar 2014-10-30 14:35:54 UTC
Created attachment 952169 [details]
Fix ported to perl-5.18.4

Comment 7 Fedora Update System 2014-10-30 15:39:48 UTC
perl-5.18.4-305.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/perl-5.18.4-305.fc21

Comment 8 Fedora Update System 2014-10-30 15:40:13 UTC
perl-5.18.4-291.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/perl-5.18.4-291.fc20

Comment 9 Fedora Update System 2014-10-31 01:26:27 UTC
Package perl-5.18.4-305.fc21:
* should fix your issue,
* was pushed to the Fedora 21 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing perl-5.18.4-305.fc21'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-13948/perl-5.18.4-305.fc21
then log in and leave karma (feedback).

Comment 10 Fedora Update System 2014-11-10 06:28:38 UTC
perl-5.18.4-291.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 11 Fedora Update System 2014-11-10 06:49:35 UTC
perl-5.18.4-305.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.