X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Finstalledfile.cpp;h=4638cc40d6cec73cdb4b9af420c3d947da385523;hb=a0868300fc26496b5a7551d1b732925c11350fdd;hp=f4b8a939832efc0aa150c5bc10196bba9c3f42c2;hpb=fb964901e923bd6bde80c64dde21020fae88bf77;p=builder.git diff --git a/source/installedfile.cpp b/source/installedfile.cpp index f4b8a93..4638cc4 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()) @@ -54,4 +55,13 @@ 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"); +} + +void InstalledFile::clean() +{ + if(!link.empty() && mtime) + FS::unlink(link); + FileTarget::clean(); }