1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-27 04:30:59 +01:00

Merged trunk R.10943 back in

This commit is contained in:
Wouter den Breejen 2008-03-04 12:15:55 +00:00
parent bffb03eae1
commit ab649814fc
5 changed files with 84 additions and 13 deletions

View file

@ -215,7 +215,11 @@ static void checkVarDefs2(set<Expr> & done, const ATermMap & defs, Expr e)
ATerm with, body;
ATermList rbnds, nrbnds;
if (matchVar(e, name)) {
/* Closed terms don't have free variables, so we don't have to
check by definition. */
if (matchClosed(e, value)) return;
else if (matchVar(e, name)) {
if (!defs.get(name))
throw EvalError(format("undefined variable `%1%'")
% aterm2String(name));

View file

@ -1136,11 +1136,8 @@ void LocalStore::exportPath(const Path & path, bool sign,
{
assertStorePath(path);
/* Wrap all of this in a transaction to make sure that we export
consistent metadata. */
Transaction txn(nixDB);
addTempRoot(path);
if (!isValidPathTxn(txn, path))
if (!isValidPath(path))
throw Error(format("path `%1%' is not valid") % path);
HashAndWriteSink hashAndWriteSink(sink);
@ -1152,10 +1149,10 @@ void LocalStore::exportPath(const Path & path, bool sign,
writeString(path, hashAndWriteSink);
PathSet references;
nix::queryXReferencesTxn(txn, path, references, true, 0); //TODO we can only now export the final revision //TODO also export the state references ???
queryXReferencesTxn(noTxn, path, references, true, 0); //TODO we can export the inital or latest revision //TODO also export the state references ???
writeStringSet(references, hashAndWriteSink);
Path deriver = nix::queryDeriver(txn, path);
Path deriver = queryDeriver(path);
writeString(deriver, hashAndWriteSink);
if (sign) {
@ -1185,8 +1182,6 @@ void LocalStore::exportPath(const Path & path, bool sign,
} else
writeInt(0, hashAndWriteSink);
txn.commit();
}