]> git.tdb.fi Git - builder.git/blobdiff - source/copy.cpp
Refactor transitive dependencies to work on all targets
[builder.git] / source / copy.cpp
diff --git a/source/copy.cpp b/source/copy.cpp
deleted file mode 100644 (file)
index 23cd6f1..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#include <fstream>
-#include <msp/path/utils.h>
-#include "copy.h"
-#include "package.h"
-
-using namespace std;
-using namespace Msp;
-
-Copy::Copy(Builder &b, const Package &pkg, const Path::Path &s, const Path::Path &d):
-       Action(b),
-       src(s),
-       dest(d),
-       worker(*this)
-{
-       announce(pkg.get_name(), "INST", dest[-1]);
-}
-
-int Copy::check()
-{
-       if(worker.get_done())
-       {
-               signal_done.emit();
-               worker.join();
-               return 0;
-       }
-       return -1;
-}
-
-void Copy::Worker::main()
-{
-       Path::mkpath(copy.src.subpath(0, copy.src.size()-1), 0755);
-       unlink(copy.dest.str().c_str());
-       ifstream in(copy.src.str().c_str());
-       ofstream out(copy.dest.str().c_str());
-
-       char buf[16384];
-       while(!in.eof())
-       {
-               in.read(buf, sizeof(buf));
-               out.write(buf, in.gcount());
-       }
-
-       struct stat st;
-       Path::stat(copy.src, st);
-       chmod(copy.dest.str().c_str(), st.st_mode&0777);
-
-       done=true;
-}