mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 22:16:16 +02:00
* Ensure that derivation names and sources don't end in `.drv'.
This commit is contained in:
parent
05f0430de1
commit
6bb5efadec
1 changed files with 8 additions and 16 deletions
|
@ -16,21 +16,6 @@ static Expr primImport(EvalState & state, const ATermVector & args)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
static PathSet storeExprRootsCached(EvalState & state, const Path & nePath)
|
|
||||||
{
|
|
||||||
DrvRoots::iterator i = state.drvRoots.find(nePath);
|
|
||||||
if (i != state.drvRoots.end())
|
|
||||||
return i->second;
|
|
||||||
else {
|
|
||||||
PathSet paths = storeExprRoots(nePath);
|
|
||||||
state.drvRoots[nePath] = paths;
|
|
||||||
return paths;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* Returns the hash of a derivation modulo fixed-output
|
/* Returns the hash of a derivation modulo fixed-output
|
||||||
subderivations. A fixed-output derivation is a derivation with one
|
subderivations. A fixed-output derivation is a derivation with one
|
||||||
output (`out') for which an expected hash and hash algorithm are
|
output (`out') for which an expected hash and hash algorithm are
|
||||||
|
@ -128,7 +113,10 @@ static void processBinding(EvalState & state, Expr e, Derivation & drv,
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (matchPath(e, s)) {
|
else if (matchPath(e, s)) {
|
||||||
Path srcPath(aterm2String(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));
|
Path dstPath(addToStore(srcPath));
|
||||||
printMsg(lvlChatty, format("copied source `%1%' -> `%2%'")
|
printMsg(lvlChatty, format("copied source `%1%' -> `%2%'")
|
||||||
% srcPath % dstPath);
|
% srcPath % dstPath);
|
||||||
|
@ -272,6 +260,10 @@ static Expr primDerivation(EvalState & state, const ATermVector & _args)
|
||||||
% *i % drvName);
|
% *i % drvName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isDerivation(drvName))
|
||||||
|
throw Error(format("derivation names are not allowed to end in `%1%'")
|
||||||
|
% drvExtension);
|
||||||
|
|
||||||
/* !!! the name should not end in the derivation extension (.drv).
|
/* !!! the name should not end in the derivation extension (.drv).
|
||||||
Likewise for sources. */
|
Likewise for sources. */
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue