nix/doctor: skip inaccessible PATH elems for duplicate nix
Inaccessible-but-extant PATH elements can't be executed anyway, so we can skip them as if they didn't exist, instead of erroring like before. Change-Id: I9288c3ecb6768171e62a3088122d98421558eb03
This commit is contained in:
+2
-1
@@ -79,7 +79,8 @@ struct CmdDoctor : StoreCommand
|
||||
PathSet dirs;
|
||||
|
||||
for (auto & dir : tokenizeString<Strings>(getEnv("PATH").value_or(""), ":"))
|
||||
if (pathExists(dir + "/nix-env"))
|
||||
// Inaccessible-but-extant PATH elements can't be executed anyway.
|
||||
if (pathAccessible(dir + "/nix-env"))
|
||||
dirs.insert(dirOf(canonPath(dir + "/nix-env", true)));
|
||||
|
||||
if (dirs.size() != 1) {
|
||||
|
||||
Reference in New Issue
Block a user