diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-02-26T14·21+0100 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-02-26T14·21+0100 |
commit | f14ef84a51e211b3924f59333d98d838ab500740 (patch) | |
tree | 92499d194fcaaac9638ed77ddc610f362cd2285d /src/libexpr/parser.y | |
parent | 733214144a7a910001c1c82683db780853bac9b1 (diff) |
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).
Diffstat (limited to 'src/libexpr/parser.y')
-rw-r--r-- | src/libexpr/parser.y | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libexpr/parser.y b/src/libexpr/parser.y index 8a084fea0697..dc995db00d59 100644 --- a/src/libexpr/parser.y +++ b/src/libexpr/parser.y @@ -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); } |