1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-01 16:41:47 +02:00

Ensure that -I flags get included in nixPath

Also fixes #261.
This commit is contained in:
Eelco Dolstra 2014-05-26 16:50:36 +02:00
parent a8edf185a9
commit 39d72640c2
8 changed files with 33 additions and 18 deletions

View file

@ -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")