X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Funlink.cpp;h=76445f6c6bf289ca761d8258c4c8c5cec8ab8548;hb=463a3521e27870294455373f9c69279069611975;hp=4bb9f667a5ded154876364b229c63c53854043ad;hpb=445edbc3c42bbd7880cc414cf153ddfd196bfc1c;p=builder.git diff --git a/source/unlink.cpp b/source/unlink.cpp index 4bb9f66..76445f6 100644 --- a/source/unlink.cpp +++ b/source/unlink.cpp @@ -1,16 +1,22 @@ -#include -#include "package.h" -#include "target.h" +#include +#include +#include "filetarget.h" +#include "sourcepackage.h" #include "unlink.h" -Unlink::Unlink(Builder &b, const Target &t): +Unlink::Unlink(Builder &b, const FileTarget &t): Action(b) { - const Package &pkg=*t.get_package(); + const SourcePackage &spkg = *static_cast(t.get_package()); - announce(pkg.get_name(), "RM", relative(t.get_name(), pkg.get_source()).str()); + announce(spkg.get_name(), "RM", relative(t.get_path(), spkg.get_source()).str()); - unlink(t.get_name().c_str()); + try + { + unlink(t.get_path()); + } + catch(const Msp::system_error &) + { } } int Unlink::check()