aboutsummaryrefslogtreecommitdiff
path: root/src/nix
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2020-06-02 00:37:43 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2020-06-02 00:37:43 +0000
commitefcd30da891eccdb3518e9c07afc6f907e9ac5e6 (patch)
tree70b91a28476765350a9102a245d6a83da82af26f /src/nix
parent754c910953901ced4fbd27a8b86d36d57cb72996 (diff)
WIP
Diffstat (limited to 'src/nix')
-rw-r--r--src/nix/add-to-store.cc5
-rw-r--r--src/nix/make-content-addressable.cc5
-rw-r--r--src/nix/path-info.cc2
-rw-r--r--src/nix/verify.cc2
4 files changed, 10 insertions, 4 deletions
diff --git a/src/nix/add-to-store.cc b/src/nix/add-to-store.cc
index 39d49721a..dc34a83ca 100644
--- a/src/nix/add-to-store.cc
+++ b/src/nix/add-to-store.cc
@@ -48,7 +48,10 @@ struct CmdAddToStore : MixDryRun, StoreCommand
ValidPathInfo info(store->makeFixedOutputPath(FileIngestionMethod::Recursive, narHash, *namePart));
info.narHash = narHash;
info.narSize = sink.s->size();
- info.ca = makeFixedOutputCA(FileIngestionMethod::Recursive, info.narHash);
+ *info.ca = FileSystemHash {
+ .method = FileIngestionMethod::Recursive,
+ .hash = info.narHash
+ };
if (!dryRun)
store->addToStore(info, sink.s);
diff --git a/src/nix/make-content-addressable.cc b/src/nix/make-content-addressable.cc
index bd948a983..5003ff459 100644
--- a/src/nix/make-content-addressable.cc
+++ b/src/nix/make-content-addressable.cc
@@ -82,7 +82,10 @@ struct CmdMakeContentAddressable : StorePathsCommand, MixJSON
if (hasSelfReference) info.references.insert(info.path.clone());
info.narHash = narHash;
info.narSize = sink.s->size();
- info.ca = makeFixedOutputCA(FileIngestionMethod::Recursive, info.narHash);
+ info.ca = FileSystemHash {
+ .method = FileIngestionMethod::Recursive,
+ .hash = info.narHash,
+ };
if (!json)
printError("rewrote '%s' to '%s'", pathS, store->printStorePath(info.path));
diff --git a/src/nix/path-info.cc b/src/nix/path-info.cc
index ffe07a3ee..cda371129 100644
--- a/src/nix/path-info.cc
+++ b/src/nix/path-info.cc
@@ -115,7 +115,7 @@ struct CmdPathInfo : StorePathsCommand, MixJSON
std::cout << '\t';
Strings ss;
if (info->ultimate) ss.push_back("ultimate");
- if (info->ca != "") ss.push_back("ca:" + renderContentAddress(*info->ca));
+ if (info->ca) ss.push_back("ca:" + renderContentAddress(*info->ca));
for (auto & sig : info->sigs) ss.push_back(sig);
std::cout << concatStringsSep(" ", ss);
}
diff --git a/src/nix/verify.cc b/src/nix/verify.cc
index 0c3478ff5..d8636435c 100644
--- a/src/nix/verify.cc
+++ b/src/nix/verify.cc
@@ -87,7 +87,7 @@ struct CmdVerify : StorePathsCommand
if (!noContents) {
std::unique_ptr<AbstractHashSink> hashSink;
- if (info->ca == "")
+ if (info->ca)
hashSink = std::make_unique<HashSink>(info->narHash.type);
else
hashSink = std::make_unique<HashModuloSink>(info->narHash.type, storePathToHash(store->printStorePath(info->path)));