Add a copyStorePath() utility function

This commit is contained in:
Eelco Dolstra 2016-05-03 14:45:50 +02:00
parent 80f739b571
commit dfebfc835f
5 changed files with 27 additions and 10 deletions

View file

@ -65,11 +65,7 @@ struct CmdCopy : StorePathsCommand
if (!dstStore->isValidPath(storePath)) {
Activity act(*logger, lvlInfo, format("copying %s...") % storePath);
StringSink sink;
srcStore->exportPaths({storePath}, false, sink);
StringSource source(*sink.s);
dstStore->importPaths(false, source, 0);
copyStorePath(srcStore, dstStore, storePath);
logger->incProgress(copiedLabel);
} else