* 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
1 changed files with 18 additions and 8 deletions

View File

@ -125,14 +125,24 @@ static void processBinding(EvalState & state, Expr e, Derivation & drv,
else if (matchPath(e, s)) {
Path srcPath(canonPath(aterm2String(s)));
if (isDerivation(srcPath))
throw Error(format("file names are not allowed to end in `%1%'")
% drvExtension);
Path dstPath(addToStore(srcPath));
printMsg(lvlChatty, format("copied source `%1%' -> `%2%'")
% srcPath % dstPath);
drv.inputSrcs.insert(dstPath);
ss.push_back(dstPath);
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))
throw Error(format("file names are not allowed to end in `%1%'")
% drvExtension);
Path dstPath(addToStore(srcPath));
printMsg(lvlChatty, format("copied source `%1%' -> `%2%'")
% srcPath % dstPath);
drv.inputSrcs.insert(dstPath);
ss.push_back(dstPath);
}
}
else if (matchList(e, es)) {