From 4a1b4181b4995c1ca6dec84c3bd59821a20af241 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 4 Sep 2016 14:25:15 +0200 Subject: Always use rm/rmdir utilities on Windows to delete stuff being used --- build2/install/rule.cxx | 10 ++++++++-- 1 file 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", -- cgit v1.1