]> git.ipfire.org Git - pakfire.git/commitdiff
libpakfire: archive: Re-enable logging of extraction process
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 10 Jun 2019 17:42:23 +0000 (18:42 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 10 Jun 2019 17:42:23 +0000 (18:42 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/archive.c

index 5f90c33db21823f7a1c0141c9e8a6b162e88296b..f6b7d9e8b56946b1f929929a084033b7f380d96d 100644 (file)
@@ -560,14 +560,10 @@ static int archive_copy_data(struct archive* in, struct archive* out) {
        return 0;
 }
 
-static int archive_extract(struct archive* a, const char* prefix) {
+static int archive_extract(Pakfire pakfire, struct archive* a, const char* prefix) {
        struct archive_entry* entry;
        int r;
 
-#if 0
-       DEBUG("Extracting archive to %s\n", prefix);
-#endif
-
        struct archive* ext = archive_write_disk_new();
 
        // Set flags for extracting contents.
@@ -600,9 +596,7 @@ static int archive_extract(struct archive* a, const char* prefix) {
                char* pathname = pakfire_path_join(prefix, archive_pathname);
                archive_entry_set_pathname(entry, pathname);
 
-#if 0
-               DEBUG("Extracting /%s (%zu bytes)\n", pathname, size);
-#endif
+               DEBUG(pakfire, "Extracting %s (%zu bytes)\n", pathname, size);
                pakfire_free(pathname);
 
                r = archive_write_header(ext, entry);
@@ -779,7 +773,7 @@ PAKFIRE_EXPORT int pakfire_archive_extract(PakfireArchive archive, const char* p
        if (use_payload)
                pa = archive_open_payload(a);
 
-       r = archive_extract(use_payload ? pa : a,
+       r = archive_extract(archive->pakfire, use_payload ? pa : a,
                prefix ? prefix : pakfire_get_path(archive->pakfire));
 
        if (pa)