Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

stop installing to ~/.perl6

requires a pretty new Rakudo with $*CUSTOM-LIB support
  • Loading branch information...
commit c181c9a76cd25d3885df47c9f516f7736308db0e 1 parent 2ef186a
@moritz moritz authored
Showing with 12 additions and 15 deletions.
  1. +2 −3 bin/panda
  2. +6 −7 bootstrap.pl
  3. +4 −5 rebootstrap.pl
View
5 bin/panda
@@ -87,11 +87,10 @@ if %*ENV<PANDA_DEFAULT_OPTS> {
# initialize the Panda object
my $panda;
{
- my $home = $*OS eq 'MSWin32' ?? %*ENV<HOMEDRIVE> ~ %*ENV<HOMEPATH> !! %*ENV<HOME>;
- my $pandadir = "$home/.panda";
+ my $pandadir = "$*CUSTOM-LIB/panda";
mkpath $pandadir unless $pandadir.IO ~~ :d;
- my $destdir = %*ENV<DESTDIR> || "$home/.perl6";
+ my $destdir = %*ENV<DESTDIR> || $*CUSTOM-LIB;
$destdir = "{cwd}/$destdir" if $*OS ne 'MSWin32' && $destdir !~~ /^ '/' /;
$panda = Panda.new(
View
13 bootstrap.pl
@@ -4,22 +4,21 @@
say '==> Bootstrapping Panda';
my $is_win = $*OS eq 'MSWin32';
-my $home = $is_win ?? %*ENV<HOMEDRIVE> ~ %*ENV<HOMEPATH> !! %*ENV<HOME>;
-
-mkdir $home unless $home.IO.d;
-mkdir "$home/.panda" unless "$home/.panda".IO.d;
+my $panda-base = "$*CUSTOM-LIB/panda";
+mkdir $*CUSTOM-LIB unless $*CUSTOM-LIB.path.d;
+mkdir $panda-base unless $panda-base.path.d;
my $projects = slurp 'projects.json.bootstrap';
$projects ~~ s:g/_BASEDIR_/{cwd}\/ext/;
$projects .= subst('\\', '/', :g) if $is_win;
-given open "$home/.panda/projects.json", :w {
+given open "$panda-base/projects.json", :w {
.say: $projects;
.close;
}
my $env_sep = $is_win ?? ';' !! ':';
-my $destdir = %*ENV<DESTDIR> || "$home/.perl6";
+my $destdir = %*ENV<DESTDIR> || $*CUSTOM-LIB;
$destdir = "{cwd}/$destdir" unless $destdir ~~ /^ '/' /
|| $is_win && $destdir ~~ /^ [ '\\' | <[a..zA..Z]> ':' ] /;
@@ -31,4 +30,4 @@
shell "perl6 bin/panda install File::Tools JSON::Tiny Test::Mock {cwd}";
-unlink "$home/.panda/projects.json";
+unlink "$panda-base/projects.json";
View
9 rebootstrap.pl
@@ -4,8 +4,7 @@
use Shell::Command;
# Find old state file
-my $home = $*OS eq 'MSWin32' ?? %*ENV<HOMEDRIVE> ~ %*ENV<HOMEPATH> !! %*ENV<HOME>;
-my $state-file = "$home/.panda/state";
+my $state-file = "$*CUSTOM-LIB/panda/state";
if not $state-file.IO.e {
say "No need to rebootstrap, running normal bootstrap";
@@ -32,11 +31,11 @@
# Clean old directories, boostrap a fresh panda,
# and reinstall all manually-installed modules
-rm_rf "$home/.perl6/lib";
-rm_rf "$home/.panda";
+rm_rf "$*CUSTOM-LIB/lib";
+rm_rf "$*CUSTOM-LIB/panda";
shell 'perl6 bootstrap.pl';
say "==> Reinstalling @modules[]";
shell "panda install @modules[]";
-# Save the backup state file back to ~/.panda/
+# Save the backup state file back to $*CUSTOM-LIB/panda/
spurt "$state-file.bak", $old-state if $old-state;
Please sign in to comment.
Something went wrong with that request. Please try again.