diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2018-03-08 23:51:55 -0800 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2018-03-08 23:51:55 -0800 |
| commit | 965e99cf268b32cc32e0599d99e6c9a1991e95f4 (patch) | |
| tree | 9c2e9ae6789214f9f87e72f828ad4c47a9ff7dfc /toolsrc/src | |
| parent | a506559ba9ff9aab7a6176b43313a8ce26891269 (diff) | |
| download | vcpkg-965e99cf268b32cc32e0599d99e6c9a1991e95f4.tar.gz vcpkg-965e99cf268b32cc32e0599d99e6c9a1991e95f4.zip | |
[rttr] Fix executables. Fix read-only permissions.
Diffstat (limited to 'toolsrc/src')
| -rw-r--r-- | toolsrc/src/vcpkg/remove.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/toolsrc/src/vcpkg/remove.cpp b/toolsrc/src/vcpkg/remove.cpp index 3eaf991ce..32433b234 100644 --- a/toolsrc/src/vcpkg/remove.cpp +++ b/toolsrc/src/vcpkg/remove.cpp @@ -58,7 +58,7 @@ namespace vcpkg::Remove const auto status = fs.status(target, ec); if (ec) { - System::println(System::Color::error, "failed: %s", ec.message()); + System::println(System::Color::error, "failed: status(%s): %s", target.u8string(), ec.message()); continue; } @@ -71,12 +71,23 @@ namespace vcpkg::Remove fs.remove(target, ec); if (ec) { - System::println(System::Color::error, "failed: %s: %s", target.u8string(), ec.message()); +#if defined(_WIN32) + fs::stdfs::permissions(target, fs::stdfs::perms::owner_all | fs::stdfs::perms::group_all, ec); + fs.remove(target, ec); + if (ec) + { + System::println( + System::Color::error, "failed: remove(%s): %s", target.u8string(), ec.message()); + } +#else + System::println( + System::Color::error, "failed: remove(%s): %s", target.u8string(), ec.message()); +#endif } } - else if (!fs::status_known(status)) + else if (!fs::stdfs::exists(status)) { - System::println(System::Color::warning, "Warning: unknown status: %s", target.u8string()); + System::println(System::Color::warning, "Warning: %s: file not found", target.u8string()); } else { |
