X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Funlink.cpp;h=f1a548660e93da200102c255382e84853d0fe7bf;hb=04c316da6d5d90e43cba262f54d90ca231f703bf;hp=b9357e64e5af3889b23227d22a3432610d1a7556;hpb=7aeaa4ba965f596edad438c02e345a8843f7469a;p=builder.git diff --git a/source/unlink.cpp b/source/unlink.cpp index b9357e6..f1a5486 100644 --- a/source/unlink.cpp +++ b/source/unlink.cpp @@ -1,23 +1,28 @@ /* $Id$ This file is part of builder -Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions +Copyright © 2007-2009 Mikko Rasa, Mikkosoft Productions Distributed under the LGPL */ -#include -#include "package.h" -#include "target.h" +#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::SystemError &) + { } } int Unlink::check()