From 8d62aeaecb36bb178a35d882cc43acd2a5d9ab33 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Fri, 7 Feb 2025 23:03:30 +0000 Subject: [PATCH] compress: Add the option to make gzipped archives Signed-off-by: Michael Tremer --- src/pakfire/compress.c | 11 +++++++++++ src/pakfire/compress.h | 1 + 2 files changed, 12 insertions(+) diff --git a/src/pakfire/compress.c b/src/pakfire/compress.c index 245b0aea..f51134a9 100644 --- a/src/pakfire/compress.c +++ b/src/pakfire/compress.c @@ -1001,6 +1001,17 @@ int pakfire_compress_create_archive(struct pakfire* pakfire, struct archive** ar } } #endif + break; + + case PAKFIRE_COMPRESS_GZIP: + // Enable gzip + r = archive_write_add_filter_gzip(a); + if (r) { + ERROR(ctx, "Could not enable gzip compression: %s\n", + archive_error_string(a)); + goto ERROR; + } + break; } // Write archive to f diff --git a/src/pakfire/compress.h b/src/pakfire/compress.h index d12d86bd..60a0839c 100644 --- a/src/pakfire/compress.h +++ b/src/pakfire/compress.h @@ -43,6 +43,7 @@ FILE* pakfire_zstdfopen(FILE* f, const char* mode); // Algorithms enum pakfire_compressions { PAKFIRE_COMPRESS_ZSTD, + PAKFIRE_COMPRESS_GZIP, }; // Compress -- 2.39.5