- Path::mkpath(copy.src.subpath(0, copy.src.size()-1), 0755);
- if(unlink(copy.dest.str().c_str())<0 && errno!=ENOENT)
+ const FileTarget &source = target.get_source();
+ const FS::Path &src_path = source.get_path();
+ const FS::Path &dst_path = target.get_path();
+ FS::mkpath(FS::dirname(dst_path), 0755);
+
+ // Remove old file. Not doing this would cause Bad Stuff when installing libraries.
+ if(FS::exists(dst_path))