libxbps: added support for multiple compression formats in repodata.

Also don't use obsolete libarchive interfaces.
This commit is contained in:
Juan RP 2019-06-17 07:14:24 +02:00
parent ab9a587d34
commit 7f75910054
No known key found for this signature in database
GPG Key ID: AF19F6CB482F9368
3 changed files with 21 additions and 11 deletions

View File

@ -590,11 +590,13 @@ xbps_unpack_binary_pkg(struct xbps_handle *xhp, xbps_dictionary_t pkg_repod)
return ENOMEM;
}
/*
* Enable support for tar format and gzip/bzip2/lzma compression methods.
* Enable support for tar format and some compression methods.
*/
archive_read_support_compression_gzip(ar);
archive_read_support_compression_bzip2(ar);
archive_read_support_compression_xz(ar);
archive_read_support_filter_gzip(ar);
archive_read_support_filter_bzip2(ar);
archive_read_support_filter_xz(ar);
archive_read_support_filter_lz4(ar);
archive_read_support_filter_zstd(ar);
archive_read_support_format_tar(ar);
myumask = umask(022);

View File

@ -95,9 +95,11 @@ open_archive_by_url(struct url *url)
free(f);
return NULL;
}
archive_read_support_compression_gzip(a);
archive_read_support_compression_bzip2(a);
archive_read_support_compression_xz(a);
archive_read_support_filter_gzip(a);
archive_read_support_filter_bzip2(a);
archive_read_support_filter_xz(a);
archive_read_support_filter_lz4(a);
archive_read_support_filter_zstd(a);
archive_read_support_format_tar(a);
if (archive_read_open(a, f, fetch_archive_open, fetch_archive_read,
@ -119,9 +121,11 @@ open_archive(const char *url)
if ((a = archive_read_new()) == NULL)
return NULL;
archive_read_support_compression_gzip(a);
archive_read_support_compression_bzip2(a);
archive_read_support_compression_xz(a);
archive_read_support_filter_gzip(a);
archive_read_support_filter_bzip2(a);
archive_read_support_filter_xz(a);
archive_read_support_filter_lz4(a);
archive_read_support_filter_zstd(a);
archive_read_support_format_tar(a);
if (archive_read_open_filename(a, url, 32768)) {

View File

@ -144,7 +144,11 @@ repo_open_local(struct xbps_repo *repo, const char *repofile)
}
repo->ar = archive_read_new();
archive_read_support_compression_gzip(repo->ar);
archive_read_support_filter_gzip(repo->ar);
archive_read_support_filter_bzip2(repo->ar);
archive_read_support_filter_xz(repo->ar);
archive_read_support_filter_lz4(repo->ar);
archive_read_support_filter_zstd(repo->ar);
archive_read_support_format_tar(repo->ar);
if (archive_read_open_fd(repo->ar, repo->fd, st.st_blksize) == ARCHIVE_FATAL) {