X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Funlink.cpp;h=76445f6c6bf289ca761d8258c4c8c5cec8ab8548;hb=dc00ddd224634c86f0a470f1f6f534be5d3e64a3;hp=208fcf9ff17b739307c38a1c8f39faebe5e7df99;hpb=242c55b17e6608b29a77ca17a5b677e202a3ca90;p=builder.git diff --git a/source/unlink.cpp b/source/unlink.cpp index 208fcf9..76445f6 100644 --- a/source/unlink.cpp +++ b/source/unlink.cpp @@ -1,23 +1,22 @@ -/* $Id$ - -This file is part of builder -Copyright © 2007-2009 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - +#include #include +#include "filetarget.h" #include "sourcepackage.h" -#include "target.h" #include "unlink.h" -Unlink::Unlink(Builder &b, const Target &t): +Unlink::Unlink(Builder &b, const FileTarget &t): Action(b) { - const SourcePackage &spkg=*static_cast(t.get_package()); + const SourcePackage &spkg = *static_cast(t.get_package()); - announce(spkg.get_name(), "RM", relative(t.get_name(), spkg.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()