diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-09-04 14:25:15 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-09-04 14:25:15 +0200 |
commit | 4a1b4181b4995c1ca6dec84c3bd59821a20af241 (patch) | |
tree | d404bc6e16e2b22301d68d656d51d82f09b89779 | |
parent | d6b350c8a09d7ba9622b94bff37900999f255c82 (diff) |
Always use rm/rmdir utilities on Windows to delete stuff being used
-rw-r--r-- | build2/install/rule.cxx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/build2/install/rule.cxx b/build2/install/rule.cxx index bef874a..d43ef14 100644 --- a/build2/install/rule.cxx +++ b/build2/install/rule.cxx @@ -660,9 +660,12 @@ namespace build2 // Normally when we need to remove a file or directory we do it // directly without calling rm/rmdir. This however, won't work if we - // have sudo. So we are going to do it both ways. Thankfully, no sudo - // on Windows. + // have sudo. So we are going to do it both ways. // + // While there is no sudo on Windows, deleting things that are being + // used can get complicated. So we will always use rm/rmdir there. + // +#ifndef _WIN32 if (base.sudo == nullptr) { if (verb >= 2) @@ -680,6 +683,7 @@ namespace build2 } } else +#endif { const char* args[] = {base.sudo->c_str (), "rmdir", @@ -758,6 +762,7 @@ namespace build2 // The same story as with uninstall -d. // +#ifndef _WIN32 if (base.sudo == nullptr) { if (verb >= 2) @@ -773,6 +778,7 @@ namespace build2 } } else +#endif { const char* args[] = {base.sudo->c_str (), "rm", |