]> git.pld-linux.org Git - packages/poldek.git/commitdiff
- obsolete
authorJakub Bogusz <qboosh@pld-linux.org>
Mon, 10 May 2004 19:40:02 +0000 (19:40 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    poldek-progress.patch -> 1.3

poldek-progress.patch [deleted file]

diff --git a/poldek-progress.patch b/poldek-progress.patch
deleted file mode 100644 (file)
index 19c73fd..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-diff -r -u poldek-0.18.3/vfile/vfile.h poldek-0.18.3-patrys/vfile/vfile.h
---- poldek-0.18.3/vfile/vfile.h        2004-03-21 13:58:18.172520008 +0100
-+++ poldek-0.18.3-patrys/vfile/vfile.h 2004-03-21 13:11:43.209418984 +0100
-@@ -20,6 +20,8 @@
- #include <zlib.h>
- #include <trurl/narray.h>
-+#include <time.h>
-+
- extern int *vfile_verbose;
- extern const char *vfile_anonftp_passwd;
- extern void (*vfile_msg_fn)(const char *fmt, ...);
-@@ -166,6 +168,7 @@
-     int     is_tty;
-     int     prev_n;
-     int     prev_perc;
-+    time_t     time_base;
- };
- void vfile_progress_init(struct vf_progress_bar *bar);
-diff -r -u poldek-0.18.3/vfile/vfprogress.c poldek-0.18.3-patrys/vfile/vfprogress.c
---- poldek-0.18.3/vfile/vfprogress.c   2002-11-11 22:22:10.000000000 +0100
-+++ poldek-0.18.3-patrys/vfile/vfprogress.c    2004-03-21 13:55:53.242552712 +0100
-@@ -27,7 +27,7 @@
- #define VFILE_INTERNAL
- #include "vfile.h"
--#define PROGRESSBAR_WIDTH 50
-+#define PROGRESSBAR_WIDTH 30
- void vfile_progress_init(struct vf_progress_bar *bar)
- {
-@@ -65,8 +65,9 @@
-     char                    line[256], outline[256], fmt[40];
-     float                   frac, percent;
-     long                    n;
--
--    
-+    time_t                current_time;
-+    float                 transfer_rate = 0.0;
-+    float                 eta = 0.0;
-     
-     if (bar->state == VF_PROGRESS_DISABLED)
-         return;
-@@ -87,7 +88,7 @@
-                 return;
-             }
-         }
--        
-+        bar->time_base = time(NULL);
-         bar->state = VF_PROGRESS_RUNNING;
-     }
-     
-@@ -130,18 +131,30 @@
-         }
-         
-     } else {
--        char unit_line[23], amount_str[16], total_str[16];
-+        char unit_line[43], amount_str[16], total_str[16];
-         int nn, unit_n;
-             
-+
-+        current_time = time(NULL);
-+      if (current_time != bar->time_base)
-+      {
-+          transfer_rate = amount / (current_time - bar->time_base) / 1024.0;
-+      }
-+      if (transfer_rate > 0)
-+      {
-+          eta = 0.5 + (total - amount) / (transfer_rate * 1024);
-+      }
-         
-         nbytes2str(total_str, sizeof(total_str), total);
-         nbytes2str(amount_str, sizeof(amount_str), amount);
-         if (total == amount)
--            nn = n_snprintf(unit_line, sizeof(unit_line), "[%s]", total_str);
-+            nn = n_snprintf(unit_line, sizeof(unit_line), "[%s] [%.1fK/s]",
-+                        total_str, transfer_rate);
-         else 
--            nn = n_snprintf(unit_line, sizeof(unit_line), "[%s of %s]",
--                          amount_str, total_str);
-+            nn = n_snprintf(unit_line, sizeof(unit_line), "[%s of %s] [%.1fK/s] [%dm%s%ds]",
-+                          amount_str, total_str, transfer_rate, (int)eta / 60, 
-+                        ((int)eta % 60 < 10 ? "0" : ""), (int)eta % 60);
-         unit_n = sizeof(unit_line) - nn - 1;
-         if (unit_n > 0)
This page took 0.119144 seconds and 4 git commands to generate.