1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 10:41:16 +02:00

Update src/nix/prefetch.cc

Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
(cherry picked from commit 05381c0b30)
This commit is contained in:
Jörg Thalheim 2024-07-05 19:45:03 +02:00 committed by github-actions[bot]
parent 73f3179954
commit d58592469d

View file

@ -117,7 +117,7 @@ std::tuple<StorePath, Hash> prefetchFile(
/* If the archive unpacks to a single file/directory, then use /* If the archive unpacks to a single file/directory, then use
that as the top-level. */ that as the top-level. */
tmpFile = entries->path(); tmpFile = entries->path();
unsigned fileCount = std::distance(entries, std::filesystem::directory_iterator{}); auto fileCount = std::distance(entries, std::filesystem::directory_iterator{});
if (fileCount != 1) { if (fileCount != 1) {
/* otherwise, use the directory itself */ /* otherwise, use the directory itself */
tmpFile = unpacked; tmpFile = unpacked;