diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc index 672c6a0d4..66cf29835 100644 --- a/src/libmain/shared.cc +++ b/src/libmain/shared.cc @@ -138,23 +138,29 @@ static void initAndRun(int argc, char * * argv) while (argc--) args.push_back(*argv++); args.erase(args.begin()); - /* Expand compound dash options (i.e., `-qlf' -> `-q -l -f'), and - ignore options for the ATerm library. */ - for (Strings::iterator i = args.begin(); i != args.end(); ++i) { - string arg = *i; - if (string(arg, 0, 4) == "-at-") ; - else if (arg.length() > 2 && arg[0] == '-' && arg[1] != '-') { - for (unsigned int j = 1; j < arg.length(); j++) - if (isalpha(arg[j])) - remaining.push_back((string) "-" + arg[j]); - else { - remaining.push_back(string(arg, j)); - break; - } - } else remaining.push_back(arg); + /* We dont expand for nix-state since we need to pass arguments to other + * programs that can decide for themselves if they want expansion or not + */ + if(programId != "nix-state") + { + /* Expand compound dash options (i.e., `-qlf' -> `-q -l -f'), and + ignore options for the ATerm library. */ + for (Strings::iterator i = args.begin(); i != args.end(); ++i) { + string arg = *i; + if (string(arg, 0, 4) == "-at-") ; + else if (arg.length() > 2 && arg[0] == '-' && arg[1] != '-') { + for (unsigned int j = 1; j < arg.length(); j++) + if (isalpha(arg[j])) + remaining.push_back((string) "-" + arg[j]); + else { + remaining.push_back(string(arg, j)); + break; + } + } else remaining.push_back(arg); + } + args = remaining; + remaining.clear(); } - args = remaining; - remaining.clear(); /* Process default options. */ for (Strings::iterator i = args.begin(); i != args.end(); ++i) { diff --git a/src/libstore/build.cc b/src/libstore/build.cc index 5100f9c46..70797656f 100644 --- a/src/libstore/build.cc +++ b/src/libstore/build.cc @@ -1914,7 +1914,8 @@ void DerivationGoal::deleteTmpDir(bool force) getOwnership(tmpDir); } else - deletePathWrapped(tmpDir); + deletePathWrapped(tmpDir); + tmpDir = ""; } } diff --git a/src/nix-env/nix-env.cc b/src/nix-env/nix-env.cc index 4ad2f74e9..a7915b48e 100644 --- a/src/nix-env/nix-env.cc +++ b/src/nix-env/nix-env.cc @@ -650,6 +650,7 @@ static void installDerivations(Globals & globals, externalState_p.erase(externalState_p.length(),1); externalState_p = externalState_p.substr(0,externalState_p.find_last_of('/')); ensureDirExists(externalState_p); + //printMsg(lvlError, format("EnsureDir: '%1%'") % externalState_p); } //Now we create a symlink externalState --> statePath diff --git a/src/nix-state/nix-state.cc b/src/nix-state/nix-state.cc index 5ed6444f6..387231dd3 100644 --- a/src/nix-state/nix-state.cc +++ b/src/nix-state/nix-state.cc @@ -594,8 +594,10 @@ void run(Strings args) username = arg.substr(7,arg.length()); - else + else{ opArgs.push_back(arg); + //printMsg(lvlInfo, format("ARG: %1%") % arg); + } //in the startscript u can have --run, but could do showrevisions if (oldOp && oldOp != op && oldOp != opRunComponent)