xbps-{create,rindex}: use zstd by default.

Closes #35
This commit is contained in:
Juan RP
2020-02-21 22:56:22 +01:00
parent 0005b3ecc0
commit 0788cd1f42
5 changed files with 20 additions and 15 deletions

View File

@@ -43,7 +43,7 @@ usage(bool fail)
" -v --verbose Verbose messages\n"
" -V --version Show XBPS version\n"
" -C --hashcheck Consider file hashes for cleaning up packages\n"
" --compression <fmt> Compression format: none, gzip (default), bzip2, lz4, zstd, xz.\n"
" --compression <fmt> Compression format: none, gzip, bzip2, lz4, xz, zstd (default).\n"
" --privkey <key> Path to the private key for signing\n"
" --signedby <string> Signature details, i.e \"name <email>\"\n\n"
"MODE\n"

View File

@@ -63,7 +63,13 @@ repodata_flush(struct xbps_handle *xhp, const char *repodir,
if (ar == NULL)
return false;
if (compression == NULL || strcmp(compression, "gzip") == 0) {
/*
* Set compression format, zstd by default.
*/
if (compression == NULL || strcmp(compression, "zstd") == 0) {
archive_write_add_filter_zstd(ar);
archive_write_set_options(ar, "compression-level=9");
} else if (strcmp(compression, "gzip") == 0) {
archive_write_add_filter_gzip(ar);
archive_write_set_options(ar, "compression-level=9");
} else if (strcmp(compression, "bzip2") == 0) {
@@ -74,9 +80,7 @@ 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");
archive_write_set_options(ar, "compression-level=9");
} else if (strcmp(compression, "none") == 0) {
/* empty */
} else {

View File

@@ -1,4 +1,4 @@
.Dd June 20, 2019
.Dd February 21, 2020
.Dt XBPS-RINDEX 1
.Sh NAME
.Nm xbps-rindex
@@ -19,7 +19,7 @@ in local repositories.
Enables extra debugging shown to stderr.
.It Fl -compression Ar none | gzip | bzip2 | xz | lz4 | zstd
Set the repodata compression format. If unset, defaults to
.Ar gzip .
.Ar zstd .
.It Fl C -hashcheck
Check not only for file existence but for the correct file hash while cleaning.
This flag is only useful with the