summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-12-08 15:13:17 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-12-08 15:13:17 +0000
commiteeddd27e53b9865502f683bb9a6679962a8a7817 (patch)
tree2bfc7e018995232c7a7a46f547174018cd560890
parenta5056d7d4cfbb9c3e043cbda85369716297a3528 (diff)
downloaddrakx-eeddd27e53b9865502f683bb9a6679962a8a7817.tar
drakx-eeddd27e53b9865502f683bb9a6679962a8a7817.tar.gz
drakx-eeddd27e53b9865502f683bb9a6679962a8a7817.tar.bz2
drakx-eeddd27e53b9865502f683bb9a6679962a8a7817.tar.xz
drakx-eeddd27e53b9865502f683bb9a6679962a8a7817.zip
try to reduce then number of symlinks (to avoid ELOOP)
-rwxr-xr-xmove/make_live_tree_boot14
1 files changed, 12 insertions, 2 deletions
diff --git a/move/make_live_tree_boot b/move/make_live_tree_boot
index d023ab887..1af8d537e 100755
--- a/move/make_live_tree_boot
+++ b/move/make_live_tree_boot
@@ -49,8 +49,18 @@ sub create_totem_links {
foreach my $dir (chomp_(`cd $light_prefix ; find usr -type d`)) {
foreach my $f (all("$prefix/$dir")) {
- my $file = "$prefix/$dir/$f";
- my $link = readlink($file) =~ /^\w/ ? readlink($file) : "/image/$dir/$f";
+ my $link;
+ my $fl = $f;
+ while (my $l = readlink("$prefix/$dir/$fl")) {
+ if ($l =~ /^\w/) {
+ $fl = $l;
+ next;
+ } elsif ($l =~ m!^/!) {
+ $link = $l;
+ }
+ last;
+ }
+ $link ||= "/image/$dir/$fl";
symlink $link, "$light_prefix/$dir/$f";
}
}