Permalink
Browse files

refactor CUSTOM_LIB, deprecated ~/.perl6/lib

now %CUSTOM_LIB is a hash with (perl, site, vendor, home)
installation dirs, and the one in the home directory depends
on the exact Rakudo version.

For backward compatibility, ~/.perl6/lib is still in @*INC
  • Loading branch information...
moritz committed Oct 18, 2012
1 parent 179b6c0 commit 27a6b841e3e19fef5ff10a49b822023523226f36
Showing with 25 additions and 5 deletions.
  1. +10 −0 docs/deprecations
  2. +15 −5 src/core/terms.pm
View
@@ -11,6 +11,16 @@ Deprecations in 2012.10
This will change to make them equivalent to a one-level map.
Planned for the 2012.11 release.
~/.perl6/lib will go away from the default include path (@*INC).
Instead %*CUSTOM_LIB now holds paths to four library locations:
perl Rakudo installs its core modules here
vendor OS-level package managers should install their modules here
site for local module installations (e.g. with panda or ufo)
home like site, but always under the user's home directory.
fallback if site isn't writable.
Removal of ~/.perl6/lib from @*INC planned for the 2012.11 release
Deprecations in 2012.09
Str.capitalize and &capitalize are deprecated in favor
View
@@ -67,13 +67,23 @@ sub term:<time>() { nqp::p6box_i(nqp::time_i()) }
my @INC;
@INC.push(%ENV<RAKUDOLIB>.split($VM<config><osname> eq 'MSWin32' ?? ';' !! ':')) if %ENV<RAKUDOLIB>;
@INC.push(%ENV<PERL6LIB>.split($VM<config><osname> eq 'MSWin32' ?? ';' !! ':')) if %ENV<PERL6LIB>;
my $prefix := $VM<config><libdir> ~ $VM<config><versiondir> ~ '/languages/perl6';
my %CUSTOM_LIB;
%CUSTOM_LIB<perl> = $prefix;
%CUSTOM_LIB<vendor> = $prefix ~ '/vendor';
%CUSTOM_LIB<site> = $prefix ~ '/site';
@INC.push(%CUSTOM_LIB<perl> ~ '/lib');
@INC.push(%CUSTOM_LIB<vendor> ~ '/lib');
@INC.push(%CUSTOM_LIB<site> ~ '/lib');
try {
@INC.push((%ENV<HOME> // %ENV<HOMEDRIVE> ~ %ENV<HOMEPATH>) ~ '/.perl6/lib');
my $home := %ENV<HOME> // %ENV<HOMEDRIVE> ~ %ENV<HOMEPATH>;
my $ver := nqp::p6box_s(nqp::atkey($compiler, 'version'));
%CUSTOM_LIB<home> = "$home/.perl6/$ver";
@INC.push(%CUSTOM_LIB<home> ~ '/lib');
@INC.push($home ~ '/.perl6/lib');
}
@INC.push($VM<config><libdir> ~ $VM<config><versiondir> ~ '/languages/perl6/lib');
my $CUSTOM-LIB = $VM<config><libdir> ~ $VM<config><versiondir> ~ '/languages/perl6/custom';
@INC.push($CUSTOM-LIB ~ '/lib');
nqp::bindkey(pir::get_who__PP(PROCESS), '$CUSTOM-LIB', $CUSTOM-LIB);
nqp::bindkey(pir::get_who__PP(PROCESS), '%CUSTOM_LIB', %CUSTOM_LIB);
my $I := nqp::atkey(nqp::atkey(%*COMPILING, '%?OPTIONS'), 'I');
if nqp::defined($I) {

0 comments on commit 27a6b84

Please sign in to comment.