Permalink
Browse files

switch rebootstrap to %*CUSTOM_LIB

  • Loading branch information...
1 parent 6dfed95 commit 109e54c77fc42ad5d96da02da19edaa0011d2957 @moritz moritz committed Oct 22, 2012
Showing with 11 additions and 5 deletions.
  1. +11 −5 rebootstrap.pl
View
@@ -4,9 +4,15 @@
use Shell::Command;
# Find old state file
-my $state-file = "$*CUSTOM-LIB/panda/state";
+my ($prefix, $state-file);
+for grep(*.defined, %*ENV<DESTDIR>, %*CUSTOM_LIB<site home>) {
+ if "$_/panda/state".path.e {
+ $prefix = $_;
+ $state-file = "$_/panda/state";
+ }
+}
-if not $state-file.IO.e {
+if not $state-file.defined {
say "No need to rebootstrap, running normal bootstrap";
shell 'perl6 bootstrap.pl';
exit 0;
@@ -31,11 +37,11 @@
# Clean old directories, boostrap a fresh panda,
# and reinstall all manually-installed modules
-rm_rf "$*CUSTOM-LIB/lib";
-rm_rf "$*CUSTOM-LIB/panda";
+rm_rf "$prefix/lib";
+rm_rf "$prefix/panda";
shell 'perl6 bootstrap.pl';
say "==> Reinstalling @modules[]";
shell "panda install @modules[]";
-# Save the backup state file back to $*CUSTOM-LIB/panda/
+# Save the backup state file back to $prefix/panda/
spurt "$state-file.bak", $old-state if $old-state;

0 comments on commit 109e54c

Please sign in to comment.