X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Finstalledfile.cpp;h=6960ccead45599ca62cbc0f1302076fe80bd7682;hb=0cf7bb122ef4c0fc46fbb2aaaf1a9d6d5ccec0f1;hp=a71bcba3c29adae803f357c1455ad3dc76bae2d5;hpb=6f76342d14c7b7ec7b9629fcfd40199bca1e5e0f;p=builder.git diff --git a/source/installedfile.cpp b/source/installedfile.cpp index a71bcba..6960cce 100644 --- a/source/installedfile.cpp +++ b/source/installedfile.cpp @@ -1,3 +1,4 @@ +#include #include #include "builder.h" #include "installedfile.h" @@ -10,7 +11,7 @@ InstalledFile::InstalledFile(Builder &b, const SourcePackage &p, FileTarget &s, FileTarget(b, p, generate_target_path(b.get_prefix(), s, loc)), source(s) { - add_depend(&source); + add_dependency(source); if(const SharedLibrary *shlib = dynamic_cast(&source)) if(!shlib->get_soname().empty()) @@ -28,10 +29,17 @@ FS::Path InstalledFile::generate_target_path(const FS::Path &prefix, const FileT FS::Path mid; if(!loc.empty()) mid = loc; + else if(const Component *comp = tgt.get_component()) + mid = comp->get_install_map().get_install_location(tgt); else mid = tgt.get_install_location(); - return prefix/mid/FS::basename(tgt.get_path()); + string fn = FS::basename(tgt.get_path()); + if(const SharedLibrary *shlib = dynamic_cast(&tgt)) + if(!shlib->get_soname().empty()) + fn = shlib->get_soname(); + + return prefix/mid/fn; } Target *InstalledFile::get_real_target() @@ -47,4 +55,6 @@ void InstalledFile::check_rebuild() mark_rebuild(source.get_name()+" has changed"); else if(source.needs_rebuild()) mark_rebuild(source.get_name()+" needs rebuilding"); + else if(!link.empty() && !FS::exists(link)) + mark_rebuild("Symlink does not exist"); }