Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
use $*DISTRO.is-win instead of $*OS
The usage of $*OS was buggy anyway because it gives "mswin32" instead "MSWin32" nowadays.
  • Loading branch information
FROGGS committed Sep 26, 2014
1 parent 26cb64f commit 2a0f08f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/Panda/App.pm
Expand Up @@ -7,7 +7,7 @@ use Panda::Project;
sub make-default-ecosystem is export {
my $pandadir;
my $destdir = %*ENV<DESTDIR>;
$destdir = "{cwd}/$destdir" if defined($destdir) && $*OS ne 'MSWin32' && $destdir !~~ /^ '/' /;
$destdir = "{cwd}/$destdir" if defined($destdir) && !$*DISTRO.is-win && $destdir !~~ /^ '/' /;
for grep(*.defined, $destdir, %*CUSTOM_LIB<site home>) -> $prefix {
$destdir = $prefix;
$pandadir = "$prefix/panda";
Expand Down
2 changes: 1 addition & 1 deletion lib/Panda/Common.pm
Expand Up @@ -21,7 +21,7 @@ sub withp6lib(&what) is export {
%*ENV<PERL6LIB>:delete;
}
}
my $sep = $*OS eq 'MSWin32' ?? ';' !! ':';
my $sep = $*DISTRO.is-win ?? ';' !! ':';
%*ENV<PERL6LIB> = join $sep,
cwd() ~ '/blib/lib',
cwd() ~ '/lib',
Expand Down
6 changes: 3 additions & 3 deletions lib/Panda/Installer.pm
Expand Up @@ -14,7 +14,7 @@ method sort-lib-contents(@lib) {
# default install location
method default-destdir {
my $ret = %*ENV<DESTDIR>;
if defined($ret) && $*OS ne 'MSWin32' && $ret !~~ /^ '/' / {
if defined($ret) && !$*DISTRO.is-win && $ret !~~ /^ '/' / {
$ret = "{cwd}/$ret" ;
}
for grep(*.defined, $ret, %*CUSTOM_LIB<site home>) -> $prefix {
Expand Down Expand Up @@ -46,10 +46,10 @@ method install($from, $to? is copy) {
if 'bin'.IO ~~ :d {
for find(dir => 'bin', type => 'file').list -> $bin {
next if $bin.basename.substr(0, 1) eq '.';
next if $*OS ne 'MSWin32' and $bin.basename ~~ /\.bat$/;
next if !$*DISTRO.is-win and $bin.basename ~~ /\.bat$/;
mkpath "$to/{$bin.directory}";
copy($bin, "$to/$bin");
"$to/$bin".IO.chmod(0o755) unless $*OS eq 'MSWin32';
"$to/$bin".IO.chmod(0o755) unless $*DISTRO.is-win;
}
}
1;
Expand Down

0 comments on commit 2a0f08f

Please sign in to comment.