* If store paths are specified as sources in Nix expressions, don't

copy them, but use them directly.
This commit is contained in:
Eelco Dolstra 2005-04-07 14:35:01 +00:00
parent f9848d4f31
commit 10c429c757

View file

@ -125,6 +125,15 @@ static void processBinding(EvalState & state, Expr e, Derivation & drv,
else if (matchPath(e, s)) { else if (matchPath(e, s)) {
Path srcPath(canonPath(aterm2String(s))); Path srcPath(canonPath(aterm2String(s)));
if (isStorePath(srcPath)) {
printMsg(lvlChatty, format("using store path `%1%' as source")
% srcPath);
drv.inputSrcs.insert(srcPath);
ss.push_back(srcPath);
}
else {
if (isDerivation(srcPath)) if (isDerivation(srcPath))
throw Error(format("file names are not allowed to end in `%1%'") throw Error(format("file names are not allowed to end in `%1%'")
% drvExtension); % drvExtension);
@ -134,6 +143,7 @@ static void processBinding(EvalState & state, Expr e, Derivation & drv,
drv.inputSrcs.insert(dstPath); drv.inputSrcs.insert(dstPath);
ss.push_back(dstPath); ss.push_back(dstPath);
} }
}
else if (matchList(e, es)) { else if (matchList(e, es)) {
for (ATermIterator i(es); i; ++i) { for (ATermIterator i(es); i; ++i) {