xbps: restore default repodata compression format (gzip/zlib).

Any compression format from that list is supported without
additional changes: gzip, bzip2, lz4, xz, zstd.

This is for repository data and binary packages.

Close #122
This commit is contained in:
Juan RP
2019-06-18 18:22:20 +02:00
parent 3677986c7e
commit b6a13945e0
5 changed files with 8 additions and 11 deletions

View File

@@ -59,10 +59,7 @@ repodata_flush(struct xbps_handle *xhp, const char *repodir,
ar = archive_write_new();
assert(ar);
if (compression == NULL || strcmp(compression, "zstd") == 0) {
archive_write_add_filter_zstd(ar);
archive_write_set_options(ar, "compression-level=19");
} else if (strcmp(compression, "gzip") == 0) {
if (compression == NULL || strcmp(compression, "gzip") == 0) {
archive_write_add_filter_gzip(ar);
archive_write_set_options(ar, "compression-level=9");
} else if (strcmp(compression, "bzip2") == 0) {
@@ -73,6 +70,9 @@ repodata_flush(struct xbps_handle *xhp, const char *repodir,
archive_write_set_options(ar, "compression-level=9");
} else if (strcmp(compression, "xz") == 0) {
archive_write_add_filter_xz(ar);
} else if (strcmp(compression, "zstd") == 0) {
archive_write_add_filter_zstd(ar);
archive_write_set_options(ar, "compression-level=19");
} else if (strcmp(compression, "none") == 0) {
/* empty */
} else {