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

Improve 'cannot read file from tarball' error

It now says e.g.

  error: cannot read file from tarball: Truncated tar archive detected while reading data
This commit is contained in:
Eelco Dolstra 2025-05-12 22:08:17 +02:00
parent f2214a5da5
commit da4efbd2fe

View file

@ -219,7 +219,7 @@ time_t unpackTarfileToSink(TarArchive & archive, ExtendedFileSystemObjectSink &
std::vector<unsigned char> buf(128 * 1024);
auto n = archive_read_data(archive.archive, buf.data(), buf.size());
if (n < 0)
throw Error("cannot read file '%s' from tarball", path);
checkLibArchive(archive.archive, n, "cannot read file from tarball: %s");
if (n == 0)
break;
crf(std::string_view{