]> git.pld-linux.org Git - packages/rpm.git/commitdiff
- fix progress bar (printed with -vh) displaying when output is not a tty
authormis <mis@pld-linux.org>
Thu, 11 Oct 2001 07:45:12 +0000 (07:45 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    rpm-progress-nontty.patch -> 1.1

rpm-progress-nontty.patch [new file with mode: 0644]

diff --git a/rpm-progress-nontty.patch b/rpm-progress-nontty.patch
new file mode 100644 (file)
index 0000000..fa0f1ae
--- /dev/null
@@ -0,0 +1,23 @@
+diff -Nur rpm-4.0.2.mis/lib/rpminstall.c rpm-4.0.2/lib/rpminstall.c
+--- rpm-4.0.2.mis/lib/rpminstall.c     Wed Oct 10 18:38:55 2001
++++ rpm-4.0.2/lib/rpminstall.c Wed Oct 10 18:39:43 2001
+@@ -61,7 +61,8 @@
+ #ifdef FANCY_HASH
+            int i;
+            progressCurrent++;
+-           for (i = 1; i < hashesPrinted; i++) putchar ('#');
++           if (isatty(STDOUT_FILENO))
++               for (i = 1; i < hashesPrinted; i++) putchar ('#');
+            printf (" [%3d%%]\n", (int)(100 * (progressTotal ?
+                (((float) progressCurrent) / progressTotal) : 1)));
+ #else
+@@ -113,7 +114,8 @@
+ #ifdef FANCY_HASH
+                if (isatty (STDOUT_FILENO))
+                    fprintf(stdout, "%4d:%-23.23s", progressCurrent + 1, s);
+-              else
++               else
++                   fprintf(stdout, "%-28s", s);
+ #else
+                    fprintf(stdout, "%-28s", s);
+ #endif
This page took 0.233385 seconds and 4 git commands to generate.