More libarchive-2.x compat.

This commit is contained in:
Juan RP 2013-08-15 11:55:20 +02:00
parent 776b94e6bc
commit 84d14286a8
3 changed files with 13 additions and 2 deletions

View File

@ -55,7 +55,7 @@ repodata_flush(struct xbps_handle *xhp, const char *repodir,
/* Create and write our repository archive */
ar = archive_write_new();
assert(ar);
archive_write_add_filter_gzip(ar);
archive_write_support_compression_gzip(ar);
archive_write_set_format_pax_restricted(ar);
archive_write_set_options(ar, "compression-level=9");
archive_write_open_fd(ar, repofd);

View File

@ -74,6 +74,15 @@
#define archive_read_support_compression_xz(x) \
archive_read_support_filter_xz(x)
#define archive_write_support_compression_gzip(x) \
archive_write_add_filter_gzip(x)
#define archive_write_support_compression_bzip2(x) \
archive_write_add_filter_bzip2(x)
#define archive_write_support_compression_xz(x) \
archive_write_add_filter_xz(x)
#define archive_read_finish(x) \
archive_read_free(x)

View File

@ -80,7 +80,9 @@ xbps_repo_open(struct xbps_handle *xhp, const char *url)
repo->xhp = xhp;
repo->uri = url;
repo->ar = archive_read_new();
archive_read_support_filter_gzip(repo->ar);
archive_read_support_compression_gzip(repo->ar);
archive_read_support_compression_bzip2(repo->ar);
archive_read_support_compression_xz(repo->ar);
archive_read_support_format_tar(repo->ar);
if (archive_read_open_filename(repo->ar, repofile, ARCHIVE_READ_BLOCKSIZE)) {