Tarball fetcher: Fix handling of cached tarballs

Fixes a regression introduced in
5a9e1c0d20 where downloading a cached
file causes the error "Failed to open archive (Unrecognized archive
format)".
This commit is contained in:
Eelco Dolstra 2024-07-03 14:14:20 +02:00
parent f809edba4f
commit 79ed3df8f8

View file

@ -81,6 +81,7 @@ TarArchive::TarArchive(Source & source, bool raw, std::optional<std::string> com
if (!raw) {
archive_read_support_format_tar(archive);
archive_read_support_format_zip(archive);
archive_read_support_format_empty(archive);
} else {
archive_read_support_format_raw(archive);
archive_read_support_format_empty(archive);
@ -99,6 +100,7 @@ TarArchive::TarArchive(const Path & path)
archive_read_support_filter_all(archive);
archive_read_support_format_tar(archive);
archive_read_support_format_zip(archive);
archive_read_support_format_empty(archive);
archive_read_set_option(archive, NULL, "mac-ext", NULL);
check(archive_read_open_filename(archive, path.c_str(), 16384), "failed to open archive: %s");
}