Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use $*CWD instead of cwd()
  • Loading branch information
lizmat committed Oct 3, 2014
1 parent 29e0bcb commit 7398d28
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions bootstrap.pl
Expand Up @@ -14,7 +14,7 @@ BEGIN

my $panda-base;
my $destdir = %*ENV<DESTDIR>;
$destdir = "{cwd}/$destdir" if defined($destdir) && $*OS ne 'MSWin32' && $destdir !~~ /^ '/' /;
$destdir = "$*CWD/$destdir" if defined($destdir) && $*OS ne 'MSWin32' && $destdir !~~ /^ '/' /;
for grep(*.defined, $destdir, %*CUSTOM_LIB<site home>) -> $prefix {
$destdir = $prefix;
$panda-base = "$prefix/panda";
Expand All @@ -28,7 +28,7 @@ BEGIN
}

my $projects = slurp 'projects.json.bootstrap';
$projects ~~ s:g/_BASEDIR_/{cwd}\/ext/;
$projects ~~ s:g/_BASEDIR_/$*CWD\/ext/;
$projects .= subst('\\', '/', :g) if $is_win;

given open "$panda-base/projects.json", :w {
Expand All @@ -39,12 +39,12 @@ BEGIN
my $env_sep = $is_win ?? ';' !! ':';

%*ENV<PERL6LIB> ~= "{$env_sep}$destdir/lib";
%*ENV<PERL6LIB> ~= "{$env_sep}{cwd}/ext/File__Find/lib";
%*ENV<PERL6LIB> ~= "{$env_sep}{cwd}/ext/Shell__Command/lib";
%*ENV<PERL6LIB> ~= "{$env_sep}{cwd}/ext/JSON__Tiny/lib";
%*ENV<PERL6LIB> ~= "{$env_sep}{cwd}/lib";
%*ENV<PERL6LIB> ~= "{$env_sep}$*CWD/ext/File__Find/lib";
%*ENV<PERL6LIB> ~= "{$env_sep}$*CWD/ext/Shell__Command/lib";
%*ENV<PERL6LIB> ~= "{$env_sep}$*CWD/ext/JSON__Tiny/lib";
%*ENV<PERL6LIB> ~= "{$env_sep}$*CWD/lib";

shell "$*EXECUTABLE bin/panda install File::Find Shell::Command JSON::Tiny {cwd}";
shell "$*EXECUTABLE bin/panda install File::Find Shell::Command JSON::Tiny $*CWD";
if "$destdir/panda/src".IO ~~ :d {
rm_rf "$destdir/panda/src"; # XXX This shouldn't be necessary, I think
# that src should not be kept at all, but
Expand Down
2 changes: 1 addition & 1 deletion lib/Panda.pm
Expand Up @@ -79,7 +79,7 @@ class Panda {

method install(Panda::Project $bone, $nodeps,
$notests, $isdep as Bool) {
my $cwd = cwd;
my $cwd = $*CWD;
my $dir = tmpdir();
self.announce('fetching', $bone);
unless $bone.metainfo<source-url> {
Expand Down
4 changes: 2 additions & 2 deletions lib/Panda/Common.pm
Expand Up @@ -23,8 +23,8 @@ sub withp6lib(&what) is export {
}
my $sep = $*DISTRO.is-win ?? ';' !! ':';
%*ENV<PERL6LIB> = join $sep,
cwd() ~ '/blib/lib',
cwd() ~ '/lib',
$*CWD ~ '/blib/lib',
$*CWD ~ '/lib',
%*ENV<PERL6LIB> // '';
what();
}
Expand Down

0 comments on commit 7398d28

Please sign in to comment.