git-svn-id: http://svn.calculate.ru/calculate/trunk@2191 c91db197-33c1-4113-bf15-f8a5c547ca64

master
atratsevskiy 15 years ago
parent 8b9ddddf14
commit c068009b1a

@ -3715,6 +3715,7 @@ sub profile{
#уберем ссылки на несуществующие файлы
`$data{path} file "$_"`=~m/\`([^']+)'/;
my $dest = $1;
#проверим абсолютный путь с наличием ссылаемого файла
if($dest=~m/^[\/]/ && !-e "$data{'chroot'}$data{scratch}$dest"){next;}
#выделим путь из профиля
my $allocation = $data{'chroot'}.$data{scratch}.substr($_, length($profile));
@ -3724,6 +3725,9 @@ sub profile{
if(-e $allocation){`$data{path} rm $allocation`}
if($dest=~m/^[\/]/){
system "$data{path} cp -a \"$_\" \"$allocation\"";
}elsif($dest=~m/^[\~]/){
#вырежем ~ и создадим относительную ссылку
system "$data{path} ln -sf \"$dest\" \"".substr(length($allocation),1)."\"";
}else{
#преобразуем относительную ссылку в абсолютную
system "$data{path} ln -sf \"/$dest\" \"$allocation\"";

Loading…
Cancel
Save