From f14ef84a51e211b3924f59333d98d838ab500740 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 26 Feb 2014 15:21:56 +0100 Subject: 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). --- src/libexpr/parser.y | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/libexpr/parser.y') diff --git a/src/libexpr/parser.y b/src/libexpr/parser.y index 8a084fea0..dc995db00 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(prefix, path)); - } + } else if (warn) + printMsg(lvlError, format("warning: Nix search path entry `%1%' does not exist, ignoring") % path); } -- cgit v1.2.3