X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcopy.cpp;h=010d54113d74a859e9eb6e8416ca0e11e501790b;hb=5006279d7b92e578ecfa8a04186f675c6b9f1eea;hp=4cb42b707be686f59bd2725f089272f63b4e07d4;hpb=ac6240aac62cec1fa7d019747fc40281de28a3ed;p=builder.git diff --git a/source/copy.cpp b/source/copy.cpp index 4cb42b7..010d541 100644 --- a/source/copy.cpp +++ b/source/copy.cpp @@ -42,14 +42,14 @@ void Copy::Worker::main() { FS::mkpath(FS::dirname(copy.dest), 0755); - try - { - // Remove old file. Not doing this would cause Bad Stuff when installing libraries. - unlink(copy.dest); - } - catch(const SystemError &e) + // Remove old file. Not doing this would cause Bad Stuff when installing libraries. + if(FS::exists(copy.dest)) { - if(e.get_error_code()!=ENOENT) + try + { + unlink(copy.dest); + } + catch(const Exception &e) { IO::print(IO::cerr, "%s\n", e.what()); done=error=true;