aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/build.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2008-01-29 18:17:36 +0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2008-01-29 18:17:36 +0000
commit66c51dc21558c6ac5149c5158df7e5b580029e84 (patch)
tree455b9e454c24e0c9d132f8881098e5d240250928 /src/libstore/build.cc
parent5b5a3af98372029f3a870cf18cc1442f1434be85 (diff)
* nix-store --dump-db / --load-db to dump/load the Nix DB.
* nix-store --register-validity: option to supply the content hash of each path. * Removed compatibility with Nix <= 0.7 stores.
Diffstat (limited to 'src/libstore/build.cc')
-rw-r--r--src/libstore/build.cc34
1 files changed, 3 insertions, 31 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index af54b161e..a4f9c469c 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -1263,34 +1263,6 @@ string showPaths(const PathSet & paths)
}
-/* Return a string accepted by `nix-store --register-validity' that
- registers the specified paths as valid. Note: it's the
- responsibility of the caller to provide a closure. */
-static string makeValidityRegistration(const PathSet & paths,
- bool showDerivers)
-{
- string s = "";
-
- for (PathSet::iterator i = paths.begin(); i != paths.end(); ++i) {
- s += *i + "\n";
-
- Path deriver = showDerivers ? store->queryDeriver(*i) : "";
- s += deriver + "\n";
-
- PathSet references;
- store->queryReferences(*i, references);
-
- s += (format("%1%\n") % references.size()).str();
-
- for (PathSet::iterator j = references.begin();
- j != references.end(); ++j)
- s += *j + "\n";
- }
-
- return s;
-}
-
-
DerivationGoal::HookReply DerivationGoal::tryBuildHook()
{
if (!useBuildHook) return rpDecline;
@@ -1417,7 +1389,7 @@ DerivationGoal::HookReply DerivationGoal::tryBuildHook()
/* The `references' file has exactly the format accepted by
`nix-store --register-validity'. */
writeStringToFile(referencesFN,
- makeValidityRegistration(allInputs, true));
+ makeValidityRegistration(allInputs, true, false));
/* Tell the hook to proceed. */
writeLine(toHook.writeSide, "okay");
@@ -1662,7 +1634,7 @@ void DerivationGoal::startBuilder()
/* !!! in secure Nix, the writing should be done on the
build uid for security (maybe). */
writeStringToFile(tmpDir + "/" + fileName,
- makeValidityRegistration(refs, false));
+ makeValidityRegistration(refs, false, false));
}
// The same for derivations
@@ -1701,7 +1673,7 @@ void DerivationGoal::startBuilder()
/* !!! in secure Nix, the writing should be done on the
build uid for security (maybe). */
writeStringToFile(tmpDir + "/" + fileName,
- makeValidityRegistration(refs, false));
+ makeValidityRegistration(refs, false, false));
}