diff --git a/lix/libstore/local-store.cc b/lix/libstore/local-store.cc index 10b66a475..083169950 100644 --- a/lix/libstore/local-store.cc +++ b/lix/libstore/local-store.cc @@ -1214,16 +1214,6 @@ try { /* In case we are not interested in reading the NAR: discard it. */ bool narRead = false; - Finally cleanup = [&]() { - if (!narRead) { - try { - auto copy = copyNAR(source); - while (copy.next()) {} - } catch (...) { - ignoreExceptionExceptInterrupt(); - } - } - }; TRY_AWAIT(addTempRoot(info.path)); @@ -1286,6 +1276,11 @@ try { registerValidPath(info); } } + + if (!narRead) { + auto copy = copyNAR(source); + while (copy.next()) {} + } co_return result::success(); } catch (...) { co_return result::current_exception();