From 39d72640c2459dc2fa689bfe8b756ee193f7b98a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 26 May 2014 16:50:36 +0200 Subject: Ensure that -I flags get included in nixPath Also fixes #261. --- src/nix-env/nix-env.cc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/nix-env') diff --git a/src/nix-env/nix-env.cc b/src/nix-env/nix-env.cc index 3db84ff5c7b5..2d38f2aea729 100644 --- a/src/nix-env/nix-env.cc +++ b/src/nix-env/nix-env.cc @@ -58,6 +58,7 @@ struct Globals bool removeAll; string forceName; bool prebuiltOnly; + Globals(const Strings & searchPath) : state(searchPath) { } }; @@ -1351,7 +1352,17 @@ void run(Strings args) Strings opFlags, opArgs, remaining; Operation op = 0; - Globals globals; + /* FIXME: hack. */ + Strings searchPath; + Strings args2; + for (Strings::iterator i = args.begin(); i != args.end(); ) { + string arg = *i++; + if (!parseSearchPathArg(arg, i, args.end(), searchPath)) + args2.push_back(arg); + } + args = args2; + + Globals globals(searchPath); globals.instSource.type = srcUnknown; globals.instSource.nixExprPath = getDefNixExprPath(); @@ -1372,8 +1383,6 @@ void run(Strings args) else if (parseOptionArg(arg, i, args.end(), globals.state, globals.instSource.autoArgs)) ; - else if (parseSearchPathArg(arg, i, args.end(), globals.state)) - ; else if (arg == "--force-name") // undocumented flag for nix-install-package globals.forceName = needArg(i, args, arg); else if (arg == "--uninstall" || arg == "-e") -- cgit 1.4.1