Relax libarchive version requirement to 2.8.0.

This commit is contained in:
Juan RP 2013-08-16 10:26:36 +02:00
parent 84d14286a8
commit 1999fbd771
4 changed files with 38 additions and 6 deletions

View File

@ -45,4 +45,36 @@ int remove_obsoletes(struct xbps_handle *, const char *);
int repodata_flush(struct xbps_handle *, const char *, int repodata_flush(struct xbps_handle *, const char *,
xbps_dictionary_t, xbps_dictionary_t); xbps_dictionary_t, xbps_dictionary_t);
/* libarchive compat */
#if ARCHIVE_VERSION_NUMBER >= 3000000
#define archive_read_support_compression_gzip(x) \
archive_read_support_filter_gzip(x)
#define archive_read_support_compression_bzip2(x) \
archive_read_support_filter_bzip2(x)
#define archive_read_support_compression_xz(x) \
archive_read_support_filter_xz(x)
#define archive_write_set_compression_gzip(x) \
archive_write_add_filter_gzip(x)
#define archive_write_set_compression_bzip2(x) \
archive_write_add_filter_bzip2(x)
#define archive_write_set_compression_xz(x) \
archive_write_add_filter_xz(x)
#define archive_read_finish(x) \
archive_read_free(x)
#define archive_write_finish(x) \
archive_write_free(x)
#define archive_compression_name(x) \
archive_filter_name(x, 0)
#endif
#endif /* !_XBPS_RINDEX_DEFS_H_ */ #endif /* !_XBPS_RINDEX_DEFS_H_ */

View File

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

4
configure vendored
View File

@ -577,8 +577,8 @@ fi
# #
# libarchive >= 2.8.0 with pkg-config support is required. # libarchive >= 2.8.0 with pkg-config support is required.
# #
printf "Checking for libarchive >= 3.0.2 via pkg-config ... " printf "Checking for libarchive >= 2.8.0 via pkg-config ... "
if ! $PKGCONFIG_BIN --atleast-version=3.0.2 libarchive; then if ! $PKGCONFIG_BIN --atleast-version=2.8.0 libarchive; then
echo "libarchive.pc file not found, exiting." echo "libarchive.pc file not found, exiting."
exit 1 exit 1
else else

View File

@ -74,13 +74,13 @@
#define archive_read_support_compression_xz(x) \ #define archive_read_support_compression_xz(x) \
archive_read_support_filter_xz(x) archive_read_support_filter_xz(x)
#define archive_write_support_compression_gzip(x) \ #define archive_write_set_compression_gzip(x) \
archive_write_add_filter_gzip(x) archive_write_add_filter_gzip(x)
#define archive_write_support_compression_bzip2(x) \ #define archive_write_set_compression_bzip2(x) \
archive_write_add_filter_bzip2(x) archive_write_add_filter_bzip2(x)
#define archive_write_support_compression_xz(x) \ #define archive_write_set_compression_xz(x) \
archive_write_add_filter_xz(x) archive_write_add_filter_xz(x)
#define archive_read_finish(x) \ #define archive_read_finish(x) \