mirror of
https://github.com/NixOS/nix
synced 2025-06-26 11:41:15 +02:00
* toFile: added an additional argument to specify the store path
suffix, e.g., `builtins.toFile "builder.sh" "..."'. * toFile: handle references to other files correctly.
This commit is contained in:
parent
84e6c43e85
commit
d20c3011a0
4 changed files with 41 additions and 5 deletions
|
@ -2,6 +2,7 @@
|
|||
#include "parser.hh"
|
||||
#include "hash.hh"
|
||||
#include "util.hh"
|
||||
#include "store.hh"
|
||||
#include "nixexpr-ast.hh"
|
||||
|
||||
|
||||
|
@ -256,7 +257,11 @@ string coerceToStringWithContext(EvalState & state,
|
|||
|
||||
if (matchPath(e, s)) {
|
||||
isPath = true;
|
||||
return aterm2String(s);
|
||||
Path path = aterm2String(s);
|
||||
if (isInStore(path)) {
|
||||
context = ATinsert(context, makePath(toATerm(toStorePath(path))));
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
if (matchAttrs(e, es)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue