X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcopy.cpp;h=bdcd0a94a8006ec108c31ecfbea5e3ce7d4d97bc;hb=4c11e2a041d2064f44b7eb3dbf1976c35fc8881c;hp=eea40fcdae6eda6f63dc30f09988736fa88a7fbc;hpb=ab25857fd626152bc9a2832de82b400c062857e6;p=builder.git diff --git a/source/copy.cpp b/source/copy.cpp index eea40fc..bdcd0a9 100644 --- a/source/copy.cpp +++ b/source/copy.cpp @@ -16,7 +16,7 @@ Distributed under the LGPL using namespace std; using namespace Msp; -Copy::Copy(Builder &b, const Package &pkg, const Path::Path &s, const Path::Path &d): +Copy::Copy(Builder &b, const Package &pkg, const Path &s, const Path &d): InternalAction(b), src(s), dest(d) @@ -38,15 +38,21 @@ Copy::Worker::Worker(Copy &c): void Copy::Worker::main() { - Path::mkpath(copy.dest.subpath(0, copy.dest.size()-1), 0755); + mkpath(copy.dest.subpath(0, copy.dest.size()-1), 0755); - // Remove old file. Not doing this would cause Bad Stuff when installing libraries. - if(unlink(copy.dest.str().c_str())<0 && errno!=ENOENT) + try { - int err=errno; - cerr<<"Can't unlink "<