From: Mikko Rasa Date: Thu, 13 Sep 2012 07:53:03 +0000 (+0300) Subject: Don't try to create links with the same name as the file itself X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=98ad5711a0c56d9783a0d22b932e9b55ddd30ba2;p=builder.git Don't try to create links with the same name as the file itself --- diff --git a/source/gnulinker.cpp b/source/gnulinker.cpp index 114bf09..cd40a85 100644 --- a/source/gnulinker.cpp +++ b/source/gnulinker.cpp @@ -99,7 +99,9 @@ Target *GnuLinker::create_install(Target &target) const 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; } diff --git a/source/installedfile.cpp b/source/installedfile.cpp index 35742bb..723d776 100644 --- a/source/installedfile.cpp +++ b/source/installedfile.cpp @@ -36,6 +36,9 @@ FS::Path InstalledFile::generate_target_path(const FS::Path &prefix, const FileT 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); }