diff --git a/source/dub/dub.d b/source/dub/dub.d index 395c0af..1b0e0cc 100644 --- a/source/dub/dub.d +++ b/source/dub/dub.d @@ -443,8 +443,10 @@ try { remove(pack); logInfo("Removing %s, version %s.", package_id, pack.vers); + } catch (Exception e) { + logError("Failed to remove %s %s: %s", package_id, pack.vers, e.msg); + logInfo("Continuing with other packages (if any)."); } - catch logError("Failed to remove %s, version %s. Continuing with other packages (if any).", package_id, pack.vers); } } diff --git a/source/dub/packagemanager.d b/source/dub/packagemanager.d index bd6a47a..4c6fa06 100644 --- a/source/dub/packagemanager.d +++ b/source/dub/packagemanager.d @@ -344,8 +344,13 @@ sort!("a.length>b.length")(allPaths); // sort to erase deepest paths first foreach(Path p; allPaths) { logDebug("Deleting folder '%s'", p); - if( !existsFile(p) || !isDir(p.toNativeString()) || !isEmptyDir(p) ) { - logError("Alien files found, directory is not empty or is not a directory: '%s'", p); + if (!existsFile(p)) continue; + if (!isDir(p.toNativeString())) { + logError("%s expected to be a directory, skipping deletion.", p.toNativeString()); + continue; + } + if (!isEmptyDir(p)) { + logError("Found untracked files in %s, skipping deletion.", p.toNativeString()); continue; } rmdir(p.toNativeString());