X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Funlink.cpp;h=f1a548660e93da200102c255382e84853d0fe7bf;hb=8d7926359d2477a9928d7367678314bcbc1f6e81;hp=2860357475e455d9e650d28d6a163045c995be3b;hpb=654de39b62a9a58fd8e1b5a557361d628345788b;p=builder.git diff --git a/source/unlink.cpp b/source/unlink.cpp index 2860357..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 +#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::SystemError &) + { } } int Unlink::check()