mirror of
https://github.com/NixOS/nix.git
synced 2025-11-26 12:10:59 +01:00
Changed the [solid-state-dependencies] list in the derivation to a single variable 'externalState' (since we also have a single state path) which can, for instance, be set to ~/.mozilla-test in the case of firefox (not bugfree yet)
This commit is contained in:
parent
68cb244c90
commit
89ab441fd2
10 changed files with 118 additions and 56 deletions
|
|
@ -1271,14 +1271,37 @@ string padd(const string & s, char c , unsigned int size, bool front)
|
|||
return ss;
|
||||
}
|
||||
|
||||
void sharePath(const Path & fromExisting, const Path & toNew)
|
||||
void symlinkPath(const Path & fromExisting, const Path & toNew)
|
||||
{
|
||||
//Symlink link to the share path
|
||||
//Usage: ln [OPTION]... [-T] TARGET LINK_NAME (1st form)
|
||||
Strings p_args;
|
||||
p_args.push_back("-sf");
|
||||
p_args.push_back(fromExisting);
|
||||
p_args.push_back(fromExisting);
|
||||
p_args.push_back(toNew);
|
||||
runProgram_AndPrintOutput("ln", true, p_args, "ln"); //run
|
||||
runProgram_AndPrintOutput("ln", true, p_args, "ln");
|
||||
|
||||
printMsg(lvlError, format("ln -sf %1% %2%") % fromExisting % toNew);
|
||||
}
|
||||
|
||||
void sharePath(const Path & fromExisting, const Path & toNew)
|
||||
{
|
||||
symlinkPath(fromExisting, toNew);
|
||||
}
|
||||
|
||||
void copyContents(const Path & from, const Path & to)
|
||||
{
|
||||
Strings p_args;
|
||||
p_args.push_back("-R");
|
||||
p_args.push_back(from + "/*");
|
||||
p_args.push_back(to);
|
||||
runProgram_AndPrintOutput("cp", true, p_args, "cp");
|
||||
|
||||
p_args.clear();
|
||||
p_args.push_back("-R");
|
||||
p_args.push_back(from + "/.*"); //Also copy the hidden files
|
||||
p_args.push_back(to);
|
||||
runProgram_AndPrintOutput("cp", true, p_args, "cp");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue