]> git.tdb.fi Git - builder.git/blobdiff - source/unlink.cpp
Further changes for library compatibility
[builder.git] / source / unlink.cpp
index 208fcf9ff17b739307c38a1c8f39faebe5e7df99..d047dbdc629fcb45a863a81975ba33449450f216 100644 (file)
@@ -5,19 +5,25 @@ Copyright © 2007-2009  Mikko Rasa, Mikkosoft Productions
 Distributed under the LGPL
 */
 
+#include <msp/core/systemerror.h>
 #include <msp/fs/utils.h>
+#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<const SourcePackage *>(t.get_package());
+       const SourcePackage &spkg = *static_cast<const SourcePackage *>(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()