mirror of
https://github.com/NixOS/nix
synced 2025-06-28 17:51:15 +02:00
Warn about missing -I paths
Fixes #121. Note that we don't warn about missing $NIX_PATH entries because it's intended that some may be missing (cf. the default $NIX_PATH on NixOS, which includes paths like /etc/nixos/nixpkgs for backward compatibility).
This commit is contained in:
parent
733214144a
commit
f14ef84a51
3 changed files with 6 additions and 5 deletions
|
@ -608,7 +608,7 @@ Expr * EvalState::parseExprFromString(const string & s, const Path & basePath)
|
|||
}
|
||||
|
||||
|
||||
void EvalState::addToSearchPath(const string & s)
|
||||
void EvalState::addToSearchPath(const string & s, bool warn)
|
||||
{
|
||||
size_t pos = s.find('=');
|
||||
string prefix;
|
||||
|
@ -624,7 +624,8 @@ void EvalState::addToSearchPath(const string & s)
|
|||
if (pathExists(path)) {
|
||||
debug(format("adding path `%1%' to the search path") % path);
|
||||
searchPath.insert(searchPathInsertionPoint, std::pair<string, Path>(prefix, path));
|
||||
}
|
||||
} else if (warn)
|
||||
printMsg(lvlError, format("warning: Nix search path entry `%1%' does not exist, ignoring") % path);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue