This queue is for tickets about the CPAN CPAN distribution.

Report information
The Basics
Id:
18011
Status:
resolved
Priority:
Low/Low
Queue:

People
Owner:
Nobody in particular
Requestors:
sjn+cpan [...] pvv.org
Cc:
AdminCc:

BugTracker
Severity:
Important
Broken in:
1.87
Fixed in:
(no value)



Subject: ~/.cpan/CPAN/MyConfig.pm is ignored (!)
When trying to run the cpan script (interactively) as a non-root user, I get the usual error message: =====================8<------------------------ CPAN: File::HomeDir loaded ok Your configuration suggests "/var/root/.cpan" as your CPAN.pm working directory. I could not create this directory due to this error: mkdir /var/root/.cpan: Permission denied at /System/Library/Perl/5.8.6/CPAN.pm line 636 Please make sure the directory exists and is writable. ------------------->8=========================== Usually, I fix this by creating an almost-empty ~/.cpan/CPAN/MyConfig.pm and run again throuh the config init process. $ echo '$CPAN::Config={};' > ~/.cpan/CPAN/MyConfig.pm ...after which the cpan script usually works fine. BUT This doesn't work anymore! My system is as follows: $ perl -v This is perl, v5.8.6 built for darwin-thread-multi-2level (with 2 registered patches, see perl -V for more detail) $ uname -a Darwin fnord 8.5.0 Darwin Kernel Version 8.5.0: Sun Jan 22 10:38:46 PST 2006; root:xnu-792.6.61.obj~1/RELEASE_PPC Power Macintosh powerpc CPAN version: $ perl -MCPAN -le'print $CPAN::VERSION' 1.8751 Thanks for your time! :)
Subject: Re: [rt.cpan.org #18011] ~/.cpan/CPAN/MyConfig.pm is ignored (!)
Date: Tue, 07 Mar 2006 00:15:34 +0100
To: bug-CPAN@rt.cpan.org
From: andreas.koenig.gmwojprw@franz.ak.mind.de (Andreas J. Koenig)
Show quoted text
>>>>> On Mon, 6 Mar 2006 10:14:17 -0500 (EST), "Guest via RT" <bug-CPAN@rt.cpan.org> said:
Show quoted text
> Mon Mar 06 10:14:13 2006: Request 18011 was acted upon. > Transaction: Ticket created by guest > Queue: CPAN > Subject: ~/.cpan/CPAN/MyConfig.pm is ignored (!) > Owner: Nobody > Requestors: sjn+cpan@pvv.org > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=18011 >
Show quoted text
> When trying to run the cpan script (interactively) as a non-root user, I > get the usual error message:
Show quoted text
> =====================8<------------------------ > CPAN: File::HomeDir loaded ok
Show quoted text
> Your configuration suggests "/var/root/.cpan" as your > CPAN.pm working directory. I could not create this directory due > to this error: mkdir /var/root/.cpan: Permission denied at > /System/Library/Perl/5.8.6/CPAN.pm line 636
Show quoted text
> Please make sure the directory exists and is writable.
-------------------> 8=========================== My version now says % /home/src/perl/repoperls/installed-perls/perl/p4pqpmS/perl-5.8.0@27350/bin/perl -Ilib -MCPAN -eshell CPAN: File::HomeDir loaded ok Your configuration suggests "/var/root/.cpan" as your CPAN.pm working directory. I could not create this directory due to this error: mkdir /var/root: Permission denied at lib/CPAN.pm line 636 Please make sure the directory exists and is writable. You don't seem to have a user configuration (MyConfig.pm) yet. Do you want to create a user configuration now? (Y/n) [yes] Seems much better to me.
Show quoted text
> Usually, I fix this by creating an almost-empty ~/.cpan/CPAN/MyConfig.pm > and run again throuh the config init process.
Show quoted text
> $ echo '$CPAN::Config={};' > ~/.cpan/CPAN/MyConfig.pm
Show quoted text
> ...after which the cpan script usually works fine.
Show quoted text
> BUT
Show quoted text
> This doesn't work anymore!
You will probably like to use this workaround for now: perl -MCPAN -e mkmyconfig But apart from that advice, I must confess that I do not know why it does not work for you. Your idiom seems to work for me.
Show quoted text
> Thanks for your time! :)
Thanks for your report! -- andreas
Subject: same problem at earlier versions: perl 5.6.1/CPAN 1.59_54
From: Vassilii Khachaturov <vassilii@tarunz.org>
I have discovered similar problem as early as perl 5.6.1/CPAN 1.59_54: nlpproj-lvs-rs1 [11:47] ~/parse-eval>perl -MCPAN -le'print $CPAN::VERSION' 1.59_54 nlpproj-lvs-rs1 [11:47] ~/parse-eval>perl --version This is perl, v5.6.1 built for i386-linux Vassilii
From: nothingmuch@woobling.org
If you add: die "Error while requiring CPAN::MyConfig:\n$@" if $@ and $@ !~ m#^Can't locate CPAN/MyConfig\.pm in \@INC#; To CPAN::HandleConfig::load then the semantics of CPAN::MyConfig loading are cleaner. Additionally it should be documented that that CPAN::MyConfig should *change* $CPAN::Config, and not replace it for better "style".
On Sun Mar 12 04:58:21 2006, NUFFIN wrote:
Show quoted text
> If you add:
...
Show quoted text
> To CPAN::HandleConfig::load then the semantics of CPAN::MyConfig > loading are cleaner.
I forgot to say where: line 248 in my version (bundled with 5.8.6), just after eval { require CPAN::MyConfig }.
Subject: Re: [rt.cpan.org #18011] ~/.cpan/CPAN/MyConfig.pm is ignored (!)
Date: Sun, 12 Mar 2006 14:55:38 +0100
To: bug-CPAN@rt.cpan.org
From: andreas.koenig.gmwojprw@franz.ak.mind.de (Andreas J. Koenig)
Show quoted text
>>>>> On Sun, 12 Mar 2006 04:59:38 -0500 (EST), "יובל קוג'מן via RT" <bug-CPAN@rt.cpan.org> said:
Show quoted text
> Queue: CPAN > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=18011 >
Show quoted text
> On Sun Mar 12 04:58:21 2006, NUFFIN wrote:
>> If you add:
> ...
>> To CPAN::HandleConfig::load then the semantics of CPAN::MyConfig >> loading are cleaner.
Show quoted text
> I forgot to say where:
Show quoted text
> line 248 in my version (bundled with 5.8.6), just after eval { require CPAN::MyConfig }.
Thanks Vassilii, it appears to me that you have missed my answer of 'Mon Mar 06 18:15:54 2006' according to rt.cpan.org. I have now patched the trunk of my repositoy with a paraphrase of your suggestion in rev. 712 (untested). I can most probably _not_ make a release this weekend. So if you have svn, maybe you can try the trunk from my subversion repo: http://pause.perl.org:5459/svn/cpanpm/trunk or https://pause.perl.org:5460/svn/cpanpm/trunk ? Thanks, -- andreas
Fixed in 1.87_52 and _53 which were release yesterday


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.