develooper Front page | perl.module-authors | Postings from November 2005

Re: When CPAN shell cannot find a module

Thread Previous | Thread Next
From:
Randy Kobes
Date:
November 20, 2005 18:31
Subject:
Re: When CPAN shell cannot find a module
Message ID:
Pine.LNX.4.63.0511202007410.6936@theoryx5.uwinnipeg.ca
On Sun, 20 Nov 2005, James E Keenan wrote:

> I'm wondering if my diagnosis of the following annoying problem is correct.
>
> When I use the CPAN shell to install a distribution which does not include a 
> package with the name of the distribution, the shell immediately tells me to 
> use the 'i /distroname/' to find objects with matching identifiers.
>
> If information on the distribution is located, then I have to guess as to 
> which module within the distribution is one that I don't have up-to-date and 
> which will therefore trigger the shell to proceed with installation.
>
> Example:  Just now I saw on perl.cpan-testers that Ken Williams had uploaded 
> a distribution named PathTools.  I checked it out at search.cpan.org and 
> decided to install it.  Here is an edited transcript of my shell session:
>
> ##### START from CPAN shell session #####
>
> cpan> install PathTools
> CPAN: Storable loaded ok
> Going to read /Users/jimk/.cpan/Metadata
>  Database was generated on Fri, 18 Nov 2005 22:50:02 GMT
> Warning: Cannot install PathTools, don't know what it is.
> Try the command
>
>    i /PathTools/
>
> to find objects with matching identifiers.
>
> cpan> i /PathTools/
> Distribution id = K/KW/KWILLIAMS/PathTools-3.14.tar.gz
>    CPAN_USERID  P5P (The Perl5 Porters Mailing List 
> <perl5-porters@perl.org>)
>    CONTAINSMODS File::Spec::Win32 File::Spec::Epoc File::Spec 
> File::Spec::Unix File::Spec::OS2 File::Spec::VMS File::Spec::Functions 
> File::Spec::Cygwin File::Spec::Mac Cwd
>
> [1st guess:  File::Spec::VMS]
>
> cpan> install File::Spec::VMS
> File::Spec::VMS is up to date.
>
> [Oops, that didn't work! ]
[ .. ]
> [I noticed that File::Spec's version is the same as that of this new 
> PathTools -- 3.14 -- and decide to guess that. ]
>
> cpan> install File::Spec
>
> [Success at last! ]
>
> Running install for module File::Spec
> Running make for K/KW/KWILLIAMS/PathTools-3.14.tar.gz
[ ... ]
> ##### END from CPAN shell session #####
>
> So I eventually get the shell to work ... but I really don't see why it 
> couldn't handle 'install PathTools' right from the get-go?
>
> Anyone know why?  Is there a workaround?  Thanks.

One reason for this behaviour, I think, is that CPAN.pm,
and the CPAN/PAUSE indices, are designed so that module
names are unique, in that there is a single distribution
containing the most recent version of a given module.
So one can say
   cpan> install File::Spec
and CPAN.pm knows that KWILLIAMS/PathTools-3.14.tar.gz
is the relevant distribution to fetch. That's not the
same with distribution names - I believe it would be
possible (though certainly not recommended) for an
author other than KWILLIAMS to upload their own
distribtion called PathTools-x.yz.tar.gz, containing
a completely different set of modules. Then, as long
as that author had the proper permissions for this
set of modules, the CPAN/PAUSE indices would then
associate this other PathTools distribution with
this set of modules.

Although CPAN.pm I think can live with non-unique
distribution names across different authors, it would
probably cause problems with search.cpan.org; for
example, http://search.cpan.org/dist/PathTools
right now points to KWILLIAMS/PathTools-3.14.

Note that, if you know the distribtion you want to
install, CPAN.pm understands
   cpan> install KWILLIAMS/PathTools-3.14.tar.gz

-- 
best regards,
randy kobes

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About