else
{
const Pattern &pattern = architecture->get_shared_library_patterns().front();
- inst_tgt->set_symlink(pattern.apply(shlib->get_libname()));
+ string link_name = pattern.apply(shlib->get_libname());
+ if(link_name!=FS::basename(inst_tgt->get_path()))
+ inst_tgt->set_symlink(link_name);
}
return inst_tgt;
}
void InstalledFile::set_symlink(const FS::Path &l)
{
+ FS::Path al = FS::dirname(path)/l;
+ if(al==path)
+ throw invalid_argument("InstalledFile::set_symlink");
link = FS::dirname(path)/l;
builder.get_vfs().register_path(link, this);
}