aboutsummaryrefslogtreecommitdiff
path: root/src/nix-store/nix-store.cc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-05-04 13:36:54 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-05-04 16:15:54 +0200
commit538a64e8c314f23ba0c5d76201f1c20e71884a21 (patch)
tree34bdfda7346d53014619cbfa33bf1398bad4b5e2 /src/nix-store/nix-store.cc
parentb6c768fb6a341bf1c5fe4a2d2a929415e8519b25 (diff)
Add a Store::addToStore() variant that accepts a NAR
As a side effect, this ensures that signatures are propagated when copying paths between stores. Also refactored import/export to make use of this.
Diffstat (limited to 'src/nix-store/nix-store.cc')
-rw-r--r--src/nix-store/nix-store.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc
index d63adaff3..99fee5c65 100644
--- a/src/nix-store/nix-store.cc
+++ b/src/nix-store/nix-store.cc
@@ -503,7 +503,7 @@ static void opReadLog(Strings opFlags, Strings opArgs)
}
else if (pathExists(logBz2Path)) {
- std::cout << *decompress("bzip2", make_ref<std::string>(readFile(logBz2Path)));
+ std::cout << *decompress("bzip2", readFile(logBz2Path));
found = true;
break;
}
@@ -703,9 +703,7 @@ static void opExport(Strings opFlags, Strings opArgs)
throw UsageError(format("unknown flag ‘%1%’") % i);
FdSink sink(STDOUT_FILENO);
- Paths sorted = store->topoSortPaths(PathSet(opArgs.begin(), opArgs.end()));
- reverse(sorted.begin(), sorted.end());
- store->exportPaths(sorted, sink);
+ store->exportPaths(opArgs, sink);
}