about summary refs log tree commit diff
path: root/src/nix-copy-closure/nix-copy-closure.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-03-16T09·45+0100
committerEelco Dolstra <edolstra@gmail.com>2017-03-16T09·45+0100
commit43f158bb0885c2eb9180ef7ab24034b1b9353e8b (patch)
treef2db3f49e53d20cc7865ec46a922a967eff5aea1 /src/nix-copy-closure/nix-copy-closure.cc
parent3f35612c041ecc4e6a4f29f01d5a87fba983cf0f (diff)
nix-copy-closure: Fix assertion failure
  $ ./inst/bin/nix-copy-closure --to bla $(type -p firefox)
  nix-copy-closure: src/libstore/store-api.cc:80: std::__cxx11::string nix::storePathToHash(const Path&): Assertion `base.size() >= storePathHashLen' failed.
Diffstat (limited to 'src/nix-copy-closure/nix-copy-closure.cc')
-rwxr-xr-xsrc/nix-copy-closure/nix-copy-closure.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nix-copy-closure/nix-copy-closure.cc b/src/nix-copy-closure/nix-copy-closure.cc
index 4340443b5cc2..05a4deea3d55 100755
--- a/src/nix-copy-closure/nix-copy-closure.cc
+++ b/src/nix-copy-closure/nix-copy-closure.cc
@@ -51,8 +51,12 @@ int main(int argc, char ** argv)
         auto to = toMode ? openStore(remoteUri) : openStore();
         auto from = toMode ? openStore() : openStore(remoteUri);
 
+        PathSet storePaths2;
+        for (auto & path : storePaths)
+            storePaths2.insert(from->followLinksToStorePath(path));
+
         PathSet closure;
-        from->computeFSClosure(storePaths, closure, false, includeOutputs);
+        from->computeFSClosure(storePaths2, closure, false, includeOutputs);
 
         copyPaths(from, to, Paths(closure.begin(), closure.end()), useSubstitutes);
     });