X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcopy.cpp;h=bdcd0a94a8006ec108c31ecfbea5e3ce7d4d97bc;hb=4d0d003b022943d8a0e39ba19078bab8d32d8857;hp=eea40fcdae6eda6f63dc30f09988736fa88a7fbc;hpb=0ac8d6708b8c758fb89d97a0049d4a329990b83b;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 "<