diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2003-12-08 15:13:17 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2003-12-08 15:13:17 +0000 |
commit | eeddd27e53b9865502f683bb9a6679962a8a7817 (patch) | |
tree | 2bfc7e018995232c7a7a46f547174018cd560890 /move/make_live_tree_boot | |
parent | a5056d7d4cfbb9c3e043cbda85369716297a3528 (diff) | |
download | drakx-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)
Diffstat (limited to 'move/make_live_tree_boot')
-rwxr-xr-x | move/make_live_tree_boot | 14 |
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"; } } |