DIEY5USNXFN6O2ARZ5IPBS2VX4OH7KE4RMX2JWAWTVMMSYA6GREAC
RSISSEU6WXFBDCN75A5Z3OIPC5TZFEROBU4K5MGV76BMXNKPFAYQC
UVNTWTWGQOFKDAJ2ROJYT4U2N4EUXKNWZWPHOM42WPLUL4ALXRJQC
5AIYUMTBY6TFQTBRP3MJ2PYWUMRF57I77NIVWYE74UMEVQMBWZVQC
CNLNT3T4IXU42GAC64CU5CEDTDLM2SHSJZEVHTMOCWYFXSQNC76QC
OCZ4LSGGSCMSLGC3C32D5JUYYHS5CIPOKOAMADEFAFZOFXJ3YY3AC
A2GL5FOZ3UJ2NM5RPRWTNPFTKLBA54B2UC6UIYO4M3N3RFNC4BTAC
73YR46NJNYZQKHA3QDJCAZYAKC2CGEF5LIS44NOIPDZU6FX6BDPQC
NAYQT2GTCJPBFRSK7CBFX655F2NGTBPICJSCYG2CSCQ5NRDHZG6QC
FITVNQ2SVM6KSOF5P3HHWJYQ3WMQYDJGAONCBIZ7OF7CPXGMA36QC
24BMQDZAWDQ7VNIA7TIROXSOYLOJBNZ2E4264WHWNJAEN6ZB3UOAC
static void copyClosureFrom(ref<Store> destStore,
FdSource & from, FdSink & to, const PathSet & paths, counter & bytesReceived,
std::shared_ptr<FSAccessor> accessor)
{
to << cmdExportPaths << 0 << paths;
to.flush();
destStore->importPaths(false, from, accessor);
for (auto & p : paths)
bytesReceived += destStore->queryPathInfo(p).narSize;
}
#pragma once
/* A trivial class to run a function at the end of a scope. */
class Finally
{
private:
std::function<void()> fun;
public:
Finally(std::function<void()> fun) : fun(fun) { }
~Finally() { fun(); }
};