Skip to content
This repository
Browse code

switch rebootstrap to %*CUSTOM_LIB

  • Loading branch information...
commit 109e54c77fc42ad5d96da02da19edaa0011d2957 1 parent 6dfed95
Moritz Lenz moritz authored

Showing 1 changed file with 11 additions and 5 deletions. Show diff stats Hide diff stats

  1. +11 5 rebootstrap.pl
16 rebootstrap.pl
@@ -4,9 +4,15 @@
4 4 use Shell::Command;
5 5
6 6 # Find old state file
7   -my $state-file = "$*CUSTOM-LIB/panda/state";
  7 +my ($prefix, $state-file);
  8 +for grep(*.defined, %*ENV<DESTDIR>, %*CUSTOM_LIB<site home>) {
  9 + if "$_/panda/state".path.e {
  10 + $prefix = $_;
  11 + $state-file = "$_/panda/state";
  12 + }
  13 +}
8 14
9   -if not $state-file.IO.e {
  15 +if not $state-file.defined {
10 16 say "No need to rebootstrap, running normal bootstrap";
11 17 shell 'perl6 bootstrap.pl';
12 18 exit 0;
@@ -31,11 +37,11 @@
31 37
32 38 # Clean old directories, boostrap a fresh panda,
33 39 # and reinstall all manually-installed modules
34   -rm_rf "$*CUSTOM-LIB/lib";
35   -rm_rf "$*CUSTOM-LIB/panda";
  40 +rm_rf "$prefix/lib";
  41 +rm_rf "$prefix/panda";
36 42 shell 'perl6 bootstrap.pl';
37 43 say "==> Reinstalling @modules[]";
38 44 shell "panda install @modules[]";
39 45
40   -# Save the backup state file back to $*CUSTOM-LIB/panda/
  46 +# Save the backup state file back to $prefix/panda/
41 47 spurt "$state-file.bak", $old-state if $old-state;

0 comments on commit 109e54c

Please sign in to comment.
Something went wrong with that request. Please try again.