Skip to content

Instantly share code, notes, and snippets.

@dagolden
Created January 5, 2011 11:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dagolden/766207 to your computer and use it in GitHub Desktop.
Save dagolden/766207 to your computer and use it in GitHub Desktop.
Demo of CPAN.pm with local::lib bootstrap
cleanroom@vulcan:~$ /opt/perl/v5.13.7-clean/bin/cpan
CPAN is the world-wide archive of perl resources. It consists of about
300 sites that all replicate the same contents around the globe. Many
countries have at least one CPAN site already. The resources found on
CPAN are easily accessible with the CPAN.pm module. If you want to use
CPAN.pm, lots of things have to be configured. Fortunately, most of
them can be determined automatically. If you prefer the automatic
configuration, answer 'yes' below.
If you prefer to enter a dialog instead, you can answer 'no' to this
question and I'll let you configure in small steps one thing after the
other. (Note: you can revisit this dialog anytime later by typing 'o
conf init' at the cpan prompt.)
Would you like me to configure as much as possible automatically? [yes]
<install_help>
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')
[local::lib]
Autoconfigured everything but 'urllist'.
Now you need to choose your CPAN mirror sites. You can let me
pick mirrors for you, you can select them from a list or you
can enter them by hand.
Would you like me to automatically choose some CPAN mirror
sites for you? (This means connecting to the Internet) [yes] n
Would you like to pick from the CPAN mirror list? [yes] n
Now you can enter your own CPAN URLs by hand. A local CPAN mirror can be
listed using a 'file:' URL like 'file:///path/to/cpan/'
CPAN.pm needs at least one URL where it can fetch CPAN files from.
Please enter your CPAN site: [] file:///srv/minicpan/
Enter another URL or ENTER to quit: []
New urllist
file:///srv/minicpan/
Autoconfiguration complete.
Attempting to boostrap local::lib...
Writing /home/cleanroom/.cpan/CPAN/MyConfig.pm for bootstrap...
commit: wrote '/home/cleanroom/.cpan/CPAN/MyConfig.pm'
Going to read '/srv/minicpan/authors/01mailrc.txt.gz'
............................................................................DONE
Going to read '/srv/minicpan/modules/02packages.details.txt.gz'
Database was generated on Sun, 02 Jan 2011 05:41:54 GMT
HTTP::Date not available
............................................................................DONE
Going to read '/srv/minicpan/modules/03modlist.data.gz'
............................................................................DONE
Going to write /home/cleanroom/.cpan/Metadata
Running make for A/AP/APEIRON/local-lib-1.007000.tar.gz
Checksum for /srv/minicpan/authors/id/A/AP/APEIRON/local-lib-1.007000.tar.gz ok
CPAN.pm: Going to build A/AP/APEIRON/local-lib-1.007000.tar.gz
Attempting to create directory /home/cleanroom/perl5
*** Module::AutoInstall version 1.03
*** Checking for Perl dependencies...
*** Since we're running under CPAN, I'll just let it take care
of the dependency's installation later.
[Core Features]
- ExtUtils::MakeMaker ...loaded. (6.57_05 >= 6.31)
- ExtUtils::Install ...loaded. (1.55 >= 1.43)
- Module::Build ...loaded. (0.3607 >= 0.36)
- CPAN ...loaded. (1.9463 >= 1.82)
*** Module::AutoInstall configuration finished.
Checking if your kit is complete...
Looks good
Writing Makefile for local::lib
Writing MYMETA.yml
cp lib/POD2/PT_BR/local/lib.pod blib/lib/POD2/PT_BR/local/lib.pod
cp lib/lib/core/only.pm blib/lib/lib/core/only.pm
cp lib/local/lib.pm blib/lib/local/lib.pm
cp lib/POD2/DE/local/lib.pod blib/lib/POD2/DE/local/lib.pod
Manifying blib/man3/POD2::PT_BR::local::lib.3
Manifying blib/man3/lib::core::only.3
Manifying blib/man3/local::lib.3
Manifying blib/man3/POD2::DE::local::lib.3
APEIRON/local-lib-1.007000.tar.gz
/usr/bin/make -- OK
'YAML' not installed, will not store persistent state
Running make test
PERL_DL_NONLAZY=1 /opt/perl/v5.13.7-clean/bin/perl -I/home/cleanroom/perl5/lib/perl5/x86_64-linux-ld -I/home/cleanroom/perl5/lib/perl5 "-MExtUtils::Command::MM" "-e" "test_harness(0, 'inc', 'blib/lib', 'blib/arch')" t/classmethod.t t/coderefs_in_inc.t t/de-dup.t t/install.t t/lib-core-only.t t/pipeline.t
t/classmethod.t ...... Name "File::Spec::rel2abs" used only once: possible typo at t/classmethod.t line 20.
t/classmethod.t ...... 1/? Attempting to create directory t/var/splat
t/classmethod.t ...... ok
t/coderefs_in_inc.t .. ok
t/de-dup.t ........... ok
t/install.t .......... skipped: Install Capture::Tiny to test installation
t/lib-core-only.t .... ok
t/pipeline.t ......... ok
All tests successful.
Files=6, Tests=10, 1 wallclock secs ( 0.04 usr 0.00 sys + 0.11 cusr 0.03 csys = 0.18 CPU)
Result: PASS
APEIRON/local-lib-1.007000.tar.gz
/usr/bin/make test -- OK
Running make install
Manifying blib/man3/POD2::PT_BR::local::lib.3
Manifying blib/man3/lib::core::only.3
Manifying blib/man3/local::lib.3
Manifying blib/man3/POD2::DE::local::lib.3
Installing /home/cleanroom/perl5/lib/perl5/local/lib.pm
Installing /home/cleanroom/perl5/lib/perl5/POD2/PT_BR/local/lib.pod
Installing /home/cleanroom/perl5/lib/perl5/POD2/DE/local/lib.pod
Installing /home/cleanroom/perl5/lib/perl5/lib/core/only.pm
Installing /home/cleanroom/perl5/man/man3/POD2::PT_BR::local::lib.3
Installing /home/cleanroom/perl5/man/man3/lib::core::only.3
Installing /home/cleanroom/perl5/man/man3/local::lib.3
Installing /home/cleanroom/perl5/man/man3/POD2::DE::local::lib.3
Appending installation info to /home/cleanroom/perl5/lib/perl5/x86_64-linux-ld/perllocal.pod
APEIRON/local-lib-1.007000.tar.gz
/usr/bin/make install -- OK
local::lib is installed. You must now add the following environment variables
to your shell configuration files (or registry, if you are on Windows) and
then restart your command line shell and CPAN before installing modules:
export PERL_LOCAL_LIB_ROOT="/home/cleanroom/perl5"
export PERL_MB_OPT="--install_base /home/cleanroom/perl5"
export PERL_MM_OPT="INSTALL_BASE=/home/cleanroom/perl5"
export PERL5LIB="/home/cleanroom/perl5/lib/perl5/x86_64-linux-ld:/home/cleanroom/perl5/lib/perl5:$PERL5LIB"
export PATH="/home/cleanroom/perl5/bin:$PATH"
Would you like me to append that to /home/cleanroom/.bashrc now? [yes]
commit: wrote '/home/cleanroom/.cpan/CPAN/MyConfig.pm'
Terminal does not support AddHistory.
cpan shell -- CPAN exploration and modules installation (v1.9463)
Enter 'h' for help.
cpan[1]> exit
Terminal does not support GetHistory.
Lockfile removed.
*** Remember to restart your shell before running cpan again ***
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment