]> git.ipfire.org Git - pakfire.git/commitdiff
compress: Add the option to make gzipped archives
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 7 Feb 2025 23:03:30 +0000 (23:03 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 7 Feb 2025 23:03:30 +0000 (23:03 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/compress.c
src/pakfire/compress.h

index 245b0aeaaf4c702dee438a678d0335a23a5b61e3..f51134a95f0fc2da7f7596153dee95231f9ddf66 100644 (file)
@@ -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
index d12d86bd14c08fa8423c19c34cc738df9ebab93c..60a0839ceadba13414bfe13dc901350c07446d12 100644 (file)
@@ -43,6 +43,7 @@ FILE* pakfire_zstdfopen(FILE* f, const char* mode);
 // Algorithms
 enum pakfire_compressions {
        PAKFIRE_COMPRESS_ZSTD,
+       PAKFIRE_COMPRESS_GZIP,
 };
 
 // Compress