local::lib for CPAN.pm

I've got too much going on this week to do much blogging, but I'm happy to say that my experiments teaching CPAN.pm to bootstrap local::lib look promising. During CPAN auto-configuration, when CPAN recognizes that the user doesn't have write access to the Perl library directories, my experimental CPAN.pm offers to bootstrap local::lib after configuration is completed.

Once this is done and released as part of CPAN and core Perl (hopefully for 5.14 if I can get it done quickly), it will be possible to have a working CPAN setup for an ordinary user with a system Perl with about this much effort:

$ cpan
[... welcome blah blah ... do you want automatic configuration? ]
y
[... do you want local::lib? ]
y
[... auto config ... ]
[... auto mirror detection ... ]
[... bootstrapping local::lib ... ]
[... fixing up your shell config with PERL_* variables ... ]

cpan[1]> install Whatever::Module::You::Want

And done! A non-privileged user could have a working CPAN and local::lib with "cpan\n", "y\n", "y\n". Spiffy!

Keep your fingers crossed and I'll report back when I have it done.

This entry was posted in cpan, perl programming, toolchain and tagged , . Bookmark the permalink. Both comments and trackbacks are currently closed.

4 Comments

  1. Posted December 14, 2010 at 9:02 pm | Permalink

    This progress is appreciated-- improving the default experience with a CPAN client is valuable... I hope there can more progress in the direction of making it more like cpanm.

    • Posted December 14, 2010 at 9:45 pm | Permalink

      Absolutely. The two big things that cpanm does is use an online index instead of package files and it can operate nearly silently. Both are on my radar for ways to make CPAN.pm better.

      • Posted December 15, 2010 at 11:56 am | Permalink

        Regarding the online index, there is currently work being done on a CPAN web service which would deliver the sorts of info which would be helpful here. It's still early days, but we do already have a proof-of-concept site which uses the web service exclusively: http://search.metacpan.org/

        • Posted December 15, 2010 at 12:12 pm | Permalink

          My thought it to abstract the search mechanism in CPAN so that it can rely on 02packages files, a local SQLite database or rely in various web services. CPANIDX is another option. Unfortunately, the current approach depends on a lot on having the index loaded fully into memory in global variables *or* relying on CPAN::SQLite. The whole thing needs to be reworked to be more pluggable.

One Trackback

© 2009-2014 David Golden All Rights Reserved