Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Load modules from %CUSTOM_LIB<home> before <site>
This way a user can install a local module that will override a
system-installed one
  • Loading branch information
retupmoca committed Apr 5, 2014
1 parent aab600f commit 2de2c9f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/core/terms.pm
Expand Up @@ -100,19 +100,19 @@ sub term:<time>() { nqp::p6box_i(nqp::time_i()) }
~ '/languages/perl6';

my %CUSTOM_LIB;
try {
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');
}
%CUSTOM_LIB<perl> = $prefix;
%CUSTOM_LIB<vendor> = $prefix ~ '/vendor';
%CUSTOM_LIB<site> = $prefix ~ '/site';
@INC.push(%CUSTOM_LIB<site> ~ '/lib');
@INC.push(%CUSTOM_LIB<vendor> ~ '/lib');
@INC.push(%CUSTOM_LIB<perl> ~ '/lib');

try {
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');
}
nqp::bindkey(nqp::who(PROCESS), '%CUSTOM_LIB', %CUSTOM_LIB);

my $I := nqp::atkey(nqp::atkey(%*COMPILING, '%?OPTIONS'), 'I');
Expand Down

0 comments on commit 2de2c9f

Please sign in to comment.