]> git.tdb.fi Git - builder.git/blob - source/unlink.cpp
Improve file target naming
[builder.git] / source / unlink.cpp
1 #include <msp/core/systemerror.h>
2 #include <msp/fs/utils.h>
3 #include "filetarget.h"
4 #include "sourcepackage.h"
5 #include "unlink.h"
6
7 Unlink::Unlink(Builder &b, const FileTarget &t):
8         Action(b)
9 {
10         const SourcePackage &spkg = *static_cast<const SourcePackage *>(t.get_package());
11
12         announce(spkg.get_name(), "RM", relative(t.get_path(), spkg.get_source()).str());
13
14         try
15         {
16                 unlink(t.get_path());
17         }
18         catch(const Msp::system_error &)
19         { }
20 }
21
22 int Unlink::check()
23 {
24         signal_done.emit();
25         return 0;
26 }