From b824a1daeefd1611c8d84432dc0b2b38f24bbbfd Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 20 Feb 2007 23:17:20 +0000 Subject: * Start of `nix-store --export' operation for serialising a store path. This is like `nix-store --dump', only it also dumps the meta-information of the store path (references, deriver). Will add a `--sign' flag later to add a cryptographic signature, which we will use for exchanging store paths between build farm machines in a secure manner. --- src/libstore/local-store.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/libstore/local-store.cc') diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index cace5cb60b36..dcb430a0fcfd 100644 --- a/src/libstore/local-store.cc +++ b/src/libstore/local-store.cc @@ -696,6 +696,24 @@ Path LocalStore::addTextToStore(const string & suffix, const string & s, } +void LocalStore::exportPath(const Path & path, bool sign, + Sink & sink) +{ + assertStorePath(path); + + dumpPath(path, sink); + + writeString(path, sink); + + PathSet references; + queryReferences(path, references); + writeStringSet(references, sink); + + Path deriver = queryDeriver(noTxn, path); + writeString(deriver, sink); +} + + void deleteFromStore(const Path & _path, unsigned long long & bytesFreed) { bytesFreed = 0; -- cgit 1.4.1