xbps-rindex: added --compression option and set zstd by default.

Multiple compression formats are now supported for repodata,
none, gzip, bzip2, xz, lz4 and zstd.
This commit is contained in:
Juan RP
2019-06-17 07:24:05 +02:00
parent 7f75910054
commit 6c1759862e
7 changed files with 63 additions and 29 deletions

View File

@@ -1,5 +1,5 @@
/*-
* Copyright (c) 2013-2015 Juan Romero Pardines.
* Copyright (c) 2013-2019 Juan Romero Pardines.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -152,7 +152,7 @@ ssl_init(void)
int
sign_repo(struct xbps_handle *xhp, const char *repodir,
const char *privkey, const char *signedby)
const char *privkey, const char *signedby, const char *compression)
{
struct xbps_repo *repo = NULL;
xbps_dictionary_t meta = NULL;
@@ -231,7 +231,7 @@ sign_repo(struct xbps_handle *xhp, const char *repodir,
_XBPS_RINDEX, strerror(errno));
goto out;
}
flush_failed = repodata_flush(xhp, repodir, "repodata", repo->idx, meta);
flush_failed = repodata_flush(xhp, repodir, "repodata", repo->idx, meta, compression);
xbps_repo_unlock(rlockfd, rlockfname);
if (!flush_failed) {
fprintf(stderr, "failed to write repodata: %s\n", strerror(errno));