summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@novell.com>2011-04-08 13:11:46 +0100
committerMichael Meeks <michael.meeks@novell.com>2011-04-08 13:11:46 +0100
commit244c7ccf6abf47550be69aae4d9174f49b10a631 (patch)
treeb4fb4a5b62e35ba0d44eddc852a490eea9e937c1
parente2916fd66191982e8d959b5ff414e9e8d0312eb5 (diff)
make relocate cope with more corner cases: no solver & fixed links
-rwxr-xr-xsolenv/bin/relocate12
1 files changed, 8 insertions, 4 deletions
diff --git a/solenv/bin/relocate b/solenv/bin/relocate
index 09b395a7b7e4..4e9fe685b687 100755
--- a/solenv/bin/relocate
+++ b/solenv/bin/relocate
@@ -229,11 +229,13 @@ sub rewrite_symlinks($$)
my $target = readlink ($link);
my $newtarget = $target;
$newtarget =~ s/$old_root/$new_root/;
- print "Re-write link $target to $newtarget\n";
- if ($newtarget eq $target) {
+ if ($target =~ m/$new_root/) {
+ print STDERR "skip correct link $target\n";
+ } elsif ($newtarget eq $target) {
print STDERR "unusual - possibly stale link: $target\n";
if ($target =~ m/\/clone\//) { die "failed to rename link"; }
} else {
+ print "Re-write link $target to $newtarget\n";
unlink ($link);
symlink ($newtarget, $link);
}
@@ -288,8 +290,10 @@ rewrite_symlinks($OOO_BUILD, $OLD_ROOT);
print "re-writing dependencies:\n";
rewrite_dpcc($OOO_BUILD, $OLD_ROOT);
-print "re-writing new dependencies:\n";
-sed_no_touch_recursive ($OOO_BUILD, $OLD_ROOT, "$solver/workdir/Dep");
+if (-d "$solver/workdir/Dep") {
+ print "re-writing new dependencies:\n";
+ sed_no_touch_recursive ($OOO_BUILD, $OLD_ROOT, "$solver/workdir/Dep");
+}
print "re-writing environment:\n";
rewrite_set($OOO_BUILD, $OLD_ROOT, $set);