]> git.ipfire.org Git - pakfire.git/commitdiff
archive writer: Never ever pad the last block
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 8 Feb 2025 17:45:36 +0000 (17:45 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 8 Feb 2025 17:45:36 +0000 (17:45 +0000)
Even for gzip, this seems to confuse some implementations.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/archive_writer.c

index c2b54dfa383f3d8dfee75e62868d68fab288c74d..b98a0ce87524b56f49e0d2a2723d83b46fe3c779 100644 (file)
@@ -197,9 +197,6 @@ static int pakfire_archive_writer_setup_archive(struct pakfire_archive_writer* s
                                return -ENOTSUP;
                        }
 
-                       // Do not pad the last block
-                       archive_write_set_bytes_in_last_block(self->archive, 1);
-
 #if ARCHIVE_VERSION_NUMBER >= 3007002
                        // Enable long mode (supported from libarchive >= 3.7.2)
                        r = archive_write_set_filter_option(self->archive, NULL, "long", "31");
@@ -247,6 +244,9 @@ static int pakfire_archive_writer_setup_archive(struct pakfire_archive_writer* s
                }
        }
 
+       // Do not pad the last block
+       archive_write_set_bytes_in_last_block(self->archive, 1);
+
        // Write archive to f
        r = archive_write_open_FILE(self->archive, self->f);
        if (r) {