]> git.ipfire.org Git - pakfire.git/commitdiff
util: Drop unused function pakfire_archive_copy_data
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 3 Nov 2022 13:59:56 +0000 (13:59 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 3 Nov 2022 13:59:56 +0000 (13:59 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/include/pakfire/util.h
src/libpakfire/util.c

index 3d627d1e46f005ee85dd45e615973cd7caf362a0..38123eb9f74e0d3e613d9267b580fdc3d3d57d14 100644 (file)
@@ -76,8 +76,6 @@ int pakfire_tty_is_noninteractive(void);
 
 // Archive Stuff
 
-int pakfire_archive_copy_data(struct pakfire* pakfire,
-       struct archive* src, struct archive* dst);
 int pakfire_archive_copy_data_from_file(struct pakfire* pakfire,
        struct archive* archive, FILE* f);
 int pakfire_archive_copy_data_to_buffer(struct pakfire* pakfire, struct archive* a,
index 21bd2d49de0bf6f60297a594f0ecb9ecfd340be9..7ce4d1e0c2eff91fc59ad8af3d705de43f2b5022 100644 (file)
@@ -508,37 +508,6 @@ int pakfire_rmtree(const char* path, int flags) {
 
 // Archive Stuff
 
-int pakfire_archive_copy_data(struct pakfire* pakfire,
-               struct archive* src, struct archive* dst) {
-       const void* buffer = NULL;
-       size_t size = 0;
-       off_t offset = 0;
-
-       int r;
-
-       for (;;) {
-               // Read a block of data
-               r = archive_read_data_block(src, &buffer, &size, &offset);
-
-               // Exit if we have read everything from source
-               if (r == ARCHIVE_EOF)
-                       return ARCHIVE_OK;
-
-               // Catch any reading errors
-               else if (r) {
-                       ERROR(pakfire, "Read error: %s\n", archive_error_string(src));
-                       return r;
-               }
-
-               // Write the read block of data
-               r = archive_write_data(dst, buffer, size);
-               if (r < 0) {
-                       ERROR(pakfire, "Write error: %s\n", archive_error_string(dst));
-                       return r;
-               }
-       }
-}
-
 int pakfire_archive_copy_data_from_file(struct pakfire* pakfire,
                struct archive* archive, FILE* f) {
        char buffer[BUFFER_SIZE];