Skip Menu |

This queue is for tickets about the CPAN-Site CPAN distribution.

Report information
The Basics
Id: 34869
Status: resolved
Priority: 0/
Queue: CPAN-Site

People
Owner: Nobody in particular
Requestors: alexander [...] bitcard.contacting.de
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.20
Fixed in: (no value)



I encountered problems when trying to extend CPAN.pm's urllist configuration parameter with a local url by exporting it as an environment variable under the name CPANSITE as described in this module's documentation. Though I am not too familiar with CPAN.pm's internals I came up with a patch supplied as an attachment to this email. It seems like that CPAN::HandleConfig is wrapping CPAN.pm's config data structure rather than CPAN::Config. As this patch has been a quick fix, I would ask someone with deeper insight in the internals to verify it before applying.
Subject: Patch.txt
diff -Naur old/Site.pm new/Site.pm --- old/Site.pm 2008-04-11 10:49:36.000000000 +0200 +++ new/Site.pm 2008-04-11 10:49:16.000000000 +0200 @@ -10,6 +10,7 @@ use vars '$VERSION'; $VERSION = '0.20'; use base 'CPAN'; +use CPAN::HandleConfig; my $reload_orig; BEGIN { @@ -25,7 +26,7 @@ goto &$import; } -CPAN::Config->load if CPAN::Config->can('load'); +CPAN::HandleConfig->load if CPAN::HandleConfig->can('load'); if(my $urls = $ENV{CPANSITE}) { unshift @{$CPAN::Config->{urllist}}, split ' ', $urls;
Sorry, this report got burried with my spam. Could you explain which problems you saw? I know of a few people who use CPAN::Site without any problems, so i would like to know what is different in your case. -- MarkOv
Subject: Re: [rt.cpan.org #34869]
Date: Tue, 29 Apr 2008 17:21:28 +0200
To: bug-CPAN-Site [...] rt.cpan.org
From: alexanderk <alexander [...] bitcard.contacting.de>
Same happened to your reply ;) The problem simply was: the config parameter 'urllist' was not extended by the path stored in $ENV{CPANSITE}. As a wrote earlier it occurred to me, that CPAN::HandleConfig is wrapping CPAN.pm's config data structure rather than CPAN::Config. So at the time you unshift the value of $ENV{CPANSITE}into 'urllist' the config file has not been loaded, and thus gets overwritten as soon as it is actually loaded later on in the course of CPAN.pm's normal program flow. All of this shows up with CPAN.pm with version 1.9205. Might this behaviour be due to some internal reorganisation of CPAN.pm?! I don't know... Mark Overmeer via RT schrieb: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=34869 > > > Sorry, this report got burried with my spam. > > Could you explain which problems you saw? I know of a few people who > use CPAN::Site without any problems, so i would like to know what is > different in your case. > > -- MarkOv > > >
Subject: Re: [rt.cpan.org #34869]
Date: Wed, 7 May 2008 23:11:53 +0200
To: Alexander Kühne via RT <bug-CPAN-Site [...] rt.cpan.org>
From: Mark Overmeer <solutions [...] overmeer.net>
* Alexander Kühne via RT (bug-CPAN-Site@rt.cpan.org) [080429 15:22]: Show quoted text
> The problem simply was: the config parameter 'urllist' was not extended > by the path stored in $ENV{CPANSITE}.
I cannot find when HandleConfig was added, but somewhere in the last two years. Your patch have been reworked a little to autodetect whether the ::HandleConfig is available. Can you check whether the attached version is sane? -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Download CPAN-Site-0.21.tar.gz
application/x-gunzip 11.8k

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #34869]
Date: Thu, 08 May 2008 10:45:58 +0200
To: bug-CPAN-Site [...] rt.cpan.org
From: alexanderk <alexander [...] bitcard.contacting.de>
Works just fine and seems to preserve backwards compatibility. Thanks for maintaining this valuable module. Alex Mark Overmeer via RT schrieb: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=34869 > > > * Alexander Kühne via RT (bug-CPAN-Site@rt.cpan.org) [080429 15:22]: >
>> The problem simply was: the config parameter 'urllist' was not extended >> by the path stored in $ENV{CPANSITE}. >>
> > I cannot find when HandleConfig was added, but somewhere in the last > two years. Your patch have been reworked a little to autodetect > whether the ::HandleConfig is available. > > Can you check whether the attached version is sane? >
release to CPAN, thanks