mirror of
https://github.com/NixOS/nix.git
synced 2025-11-26 04:00:59 +01:00
merged executeAndPrintShellCommand to runProgram
This commit is contained in:
parent
b9fe3f00c1
commit
22473597ec
1 changed files with 11 additions and 11 deletions
|
|
@ -41,7 +41,7 @@ void printHelp()
|
||||||
|
|
||||||
//
|
//
|
||||||
Derivation getDerivation_andCheckArgs_(Strings opFlags, Strings opArgs, Path & componentPath, Path & statePath,
|
Derivation getDerivation_andCheckArgs_(Strings opFlags, Strings opArgs, Path & componentPath, Path & statePath,
|
||||||
string & binary, string & derivationPath, bool isStatePath, Strings & program_args,
|
string & binary, string & derivationPath, bool isStatePath, string & program_args,
|
||||||
bool getDerivers, PathSet & derivers) //optional
|
bool getDerivers, PathSet & derivers) //optional
|
||||||
{
|
{
|
||||||
if (!opFlags.empty()) throw UsageError("unknown flag");
|
if (!opFlags.empty()) throw UsageError("unknown flag");
|
||||||
|
|
@ -66,8 +66,10 @@ Derivation getDerivation_andCheckArgs_(Strings opFlags, Strings opArgs, Path & c
|
||||||
string allargs;
|
string allargs;
|
||||||
if(opArgs.size() > 1){
|
if(opArgs.size() > 1){
|
||||||
opArgs.pop_front();
|
opArgs.pop_front();
|
||||||
allargs = opArgs.front();
|
allArgs = opArgs.front();
|
||||||
Strings progam_args = tokenizeString(allargs, " ");
|
|
||||||
|
program_args = allArgs;
|
||||||
|
//Strings progam_args_strings = tokenizeString(allArgs, " ");
|
||||||
}
|
}
|
||||||
|
|
||||||
printMsg(lvlError, format("'%1%' - '%2%' - '%3%' - '%4%' - '%5%'") % componentPath % stateIdentifier % binary % username % allargs);
|
printMsg(lvlError, format("'%1%' - '%2%' - '%3%' - '%4%' - '%5%'") % componentPath % stateIdentifier % binary % username % allargs);
|
||||||
|
|
@ -103,7 +105,7 @@ Derivation getDerivation_andCheckArgs_(Strings opFlags, Strings opArgs, Path & c
|
||||||
|
|
||||||
//Wrapper
|
//Wrapper
|
||||||
Derivation getDerivation_andCheckArgs(Strings opFlags, Strings opArgs, Path & componentPath, Path & statePath,
|
Derivation getDerivation_andCheckArgs(Strings opFlags, Strings opArgs, Path & componentPath, Path & statePath,
|
||||||
string & binary, string & derivationPath, bool & isStatePath, Strings & program_args)
|
string & binary, string & derivationPath, bool & isStatePath, string & program_args)
|
||||||
{
|
{
|
||||||
PathSet empty;
|
PathSet empty;
|
||||||
return getDerivation_andCheckArgs_(opFlags, opArgs, componentPath, statePath, binary, derivationPath, isStatePath, program_args, false, empty);
|
return getDerivation_andCheckArgs_(opFlags, opArgs, componentPath, statePath, binary, derivationPath, isStatePath, program_args, false, empty);
|
||||||
|
|
@ -118,7 +120,7 @@ static void opShowDerivations(Strings opFlags, Strings opArgs)
|
||||||
PathSet derivers;
|
PathSet derivers;
|
||||||
string derivationPath;
|
string derivationPath;
|
||||||
bool isStatePath;
|
bool isStatePath;
|
||||||
Strings program_args;
|
string program_args;
|
||||||
Derivation drv = getDerivation_andCheckArgs_(opFlags, opArgs, componentPath, statePath, binary, derivationPath, isStatePath, program_args, true, derivers);
|
Derivation drv = getDerivation_andCheckArgs_(opFlags, opArgs, componentPath, statePath, binary, derivationPath, isStatePath, program_args, true, derivers);
|
||||||
|
|
||||||
if(!isStatePath)
|
if(!isStatePath)
|
||||||
|
|
@ -137,7 +139,7 @@ static void opShowStatePath(Strings opFlags, Strings opArgs)
|
||||||
string binary;
|
string binary;
|
||||||
string derivationPath;
|
string derivationPath;
|
||||||
bool isStatePath;
|
bool isStatePath;
|
||||||
Strings program_args;
|
string program_args;
|
||||||
Derivation drv = getDerivation_andCheckArgs(opFlags, opArgs, componentPath, statePath, binary, derivationPath, isStatePath, program_args);
|
Derivation drv = getDerivation_andCheckArgs(opFlags, opArgs, componentPath, statePath, binary, derivationPath, isStatePath, program_args);
|
||||||
|
|
||||||
if(!isStatePath)
|
if(!isStatePath)
|
||||||
|
|
@ -154,7 +156,7 @@ static void opShowStateReposRootPath(Strings opFlags, Strings opArgs)
|
||||||
string binary;
|
string binary;
|
||||||
string derivationPath;
|
string derivationPath;
|
||||||
bool isStatePath;
|
bool isStatePath;
|
||||||
Strings program_args;
|
string program_args;
|
||||||
Derivation drv = getDerivation_andCheckArgs(opFlags, opArgs, componentPath, statePath, binary, derivationPath, isStatePath, program_args);
|
Derivation drv = getDerivation_andCheckArgs(opFlags, opArgs, componentPath, statePath, binary, derivationPath, isStatePath, program_args);
|
||||||
|
|
||||||
if(!isStatePath)
|
if(!isStatePath)
|
||||||
|
|
@ -190,7 +192,7 @@ static void opRunComponent(Strings opFlags, Strings opArgs)
|
||||||
string binary;
|
string binary;
|
||||||
string derivationPath;
|
string derivationPath;
|
||||||
bool isStatePath;
|
bool isStatePath;
|
||||||
Strings program_args;
|
string program_args;
|
||||||
Derivation drv = getDerivation_andCheckArgs(opFlags, opArgs, componentPath, statePath, binary, derivationPath, isStatePath, program_args);
|
Derivation drv = getDerivation_andCheckArgs(opFlags, opArgs, componentPath, statePath, binary, derivationPath, isStatePath, program_args);
|
||||||
|
|
||||||
//Specifiy the SVN binarys
|
//Specifiy the SVN binarys
|
||||||
|
|
@ -403,8 +405,6 @@ void run(Strings args)
|
||||||
|
|
||||||
TODO update getDerivation in nix-store to handle state indentifiers
|
TODO update getDerivation in nix-store to handle state indentifiers
|
||||||
|
|
||||||
--update state drv
|
|
||||||
|
|
||||||
--revert-to-state (recursive revert...)
|
--revert-to-state (recursive revert...)
|
||||||
|
|
||||||
--delete state?
|
--delete state?
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue