Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make panda work on windows. szabgab++ for supplying a windows machine

  • Loading branch information...
commit 1d9a80a82ed74fad43607df5cf97da4b99a607bc 1 parent 9c4e4cf
@tadzik authored
View
5 bootstrap.pl
@@ -6,6 +6,11 @@
mkdir "$home/.panda" unless "$home/.panda".IO.d;
my $projects = slurp 'projects.json.bootstrap';
$projects ~~ s:g/_BASEDIR_/{cwd}\/ext/;
+
+if $*OS eq 'MSWin32' {
+ $projects.=subst('\\', '/', :g);
+}
+
given open "$home/.panda/projects.json", :w {
.say: $projects;
.close;
View
2  lib/Panda/Installer.pm
@@ -26,7 +26,7 @@ class Panda::Installer does Pies::Installer {
for find(dir => 'bin', type => 'file').list -> $bin {
mkpath "$!destdir/{$bin.dir}";
$bin.IO.copy("$!destdir/$bin");
- "$!destdir/$bin".IO.chmod(0o755);
+ "$!destdir/$bin".IO.chmod(0o755) unless $*OS eq 'MSWin32';
}
}
if 'doc'.IO ~~ :d {
View
10 rebootstrap.pl
@@ -1,5 +1,7 @@
#!/usr/bin/env perl6
use v6;
+use lib 'ext/File__Tools/lib';
+use Shell::Command;
# Find old state file
my $home = $*OS eq 'MSWin32' ?? %*ENV<HOMEDRIVE> ~ %*ENV<HOMEPATH> !! %*ENV<HOME>;
@@ -7,7 +9,8 @@
if not $state-file.IO.e {
say "No need to rebootstrap, running normal bootstrap";
- run 'perl6 bootstrap.pl';
+ shell 'perl6 bootstrap.pl';
+ exit 0;
}
# Save a copy of the old state file to be written *after* bootstrapping again
@@ -29,9 +32,8 @@
# Clean old directories, boostrap a fresh panda,
# and reinstall all manually-installed modules
-# TODO: Make me cross-platform
-shell 'rm -rf ~/.perl6/lib';
-shell 'rm -rf ~/.panda';
+rm_rf "$home/.perl6/lib";
+rm_rf "$home/.panda";
shell 'perl6 bootstrap.pl';
shell "panda install @modules[]";
View
3  t/panda/builder.t
@@ -1,6 +1,7 @@
use Test;
use Panda::Builder;
use Panda::Resources;
+use Shell::Command;
plan 5;
@@ -19,6 +20,6 @@ ok "$srcdir/dummymodule/blib/lib/foo.pm".IO ~~ :f, 'and opied to blib';
ok "$srcdir/dummymodule/blib/lib/manual.pod".IO ~~ :f, 'pod copied too';
ok "$srcdir/dummymodule/blib/lib/bar.pir".IO !~~ :f, 'pod not compiled';
-shell "rm -rf $srcdir/dummymodule/blib";
+rm_rf "$srcdir/dummymodule/blib";
# vim: ft=perl6
View
4 t/panda/ecosystem.t
@@ -4,7 +4,7 @@ plan 10;
't/panda/fakestate'.IO.copy('REMOVEME');
my $a = Panda::Ecosystem.new(
- statefile => 'REMOVEME',
+ statefile => "{cwd}/REMOVEME",
projectsfile => 't/panda/fakeprojects'
) but role {
method flush-states { }
@@ -31,6 +31,6 @@ is $b.dependencies[0], 'some', 'dependencies 1';
is $b.dependencies[1], 'thing', 'dependencies 2';
is $b.dependencies[2], 'else', 'dependencies 3';
-unlink 'REMOVEME';
+unlink "{cwd}/REMOVEME";
# vim: ft=perl6
View
3  t/panda/fetcher.t
@@ -1,6 +1,7 @@
use Test;
use Panda::Fetcher;
use Panda::Resources;
+use Shell::Command;
plan 4;
@@ -30,6 +31,6 @@ $p.metainfo<source-url> = 'testmodules/dummymodule';
lives_ok { $f.fetch($p) }, 'can fetch a local project';
ok "$srcdir/foobar/lib/foo.pm".IO ~~ :f, 'fetch ok';
-shell "rm -r $srcdir";
+rm_rf $srcdir;
# vim: ft=perl6
View
3  t/panda/installer.t
@@ -1,6 +1,7 @@
use Test;
use Panda::Installer;
use Panda::Resources;
+use Shell::Command;
plan 7;
@@ -27,6 +28,6 @@ file_exists_ok "$destdir/compiled/module/doc/foofile",
file_exists_ok "$destdir/compiled/module/doc/bardir/barfile",
'docs installed 2';
-shell "rm -rf $destdir";
+rm_rf $destdir;
# vim: ft=perl6
Please sign in to comment.
Something went wrong with that request. Please try again.