]> git.ipfire.org Git - pakfire.git/commitdiff
snapshot: Show extraction speed again
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 17 Aug 2022 19:53:48 +0000 (19:53 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 17 Aug 2022 19:53:48 +0000 (19:53 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/compress.c
src/libpakfire/include/pakfire/compress.h
src/libpakfire/snapshot.c

index 3da28eab3d00d7fe60289eceb79badc595420d5f..0ed35fb4f509bbf1534802c7b79873059926df37 100644 (file)
@@ -556,6 +556,13 @@ static int pakfire_extract_progressbar_create(struct pakfire_progressbar** progr
        if (r)
                return r;
 
+       // Add throughput
+       if (flags & PAKFIRE_EXTRACT_SHOW_THROUGHPUT) {
+               r = pakfire_progressbar_add_transfer_speed(*progressbar);
+               if (r)
+                       return r;
+       }
+
        // Add percentage
        r = pakfire_progressbar_add_percentage(*progressbar);
        if (r)
index eef3fa219a8213ae4e134a35667ada957ee45b1e..1bb24679ee09e7fa58b3daef7b9765e6ddf42148 100644 (file)
@@ -37,6 +37,10 @@ FILE* pakfire_xzfopen(FILE* f, const char* mode);
 FILE* pakfire_zstdfopen(FILE* f, const char* mode);
 
 // Extract
+enum pakfire_extract_flags {
+       PAKFIRE_EXTRACT_SHOW_THROUGHPUT = (1 << 0),
+};
+
 int pakfire_extract(struct pakfire* pakfire, struct archive* archive,
        size_t size, const char* prefix, const char* message, int flags);
 
index 13fd4e4bc6f70e70dcfe4ac89e9764999c5bd9b9..2a66d71c78fb1598d92d7ba58f8ed6c320f20a6d 100644 (file)
@@ -232,7 +232,8 @@ static int pakfire_snapshot_extract(struct pakfire* pakfire, const char* path) {
        }
 
        // Extract snapshot
-       r = pakfire_extract(pakfire, archive, st.st_size, NULL, _("Extracting snapshot..."), 0);
+       r = pakfire_extract(pakfire, archive, st.st_size, NULL,
+                       _("Extracting snapshot..."), PAKFIRE_EXTRACT_SHOW_THROUGHPUT);
        if (r)
                goto ERROR;