Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/ftp - when showing the final progress bar, replace "...



details:   https://anonhg.NetBSD.org/src/rev/9afce4cbc5fc
branches:  trunk
changeset: 532324:9afce4cbc5fc
user:      lukem <lukem%NetBSD.org@localhost>
date:      Wed Jun 05 10:20:46 2002 +0000

description:
- when showing the final progress bar, replace "00:00 ETA" with the
  elapsed time.  (suggested by simonb)
- actually display transfer stats after a URL fetch. (bug introduced a
  *long* time ago)
- update copyright & version

diffstat:

 usr.bin/ftp/cmds.c    |   6 +++---
 usr.bin/ftp/fetch.c   |   8 ++++----
 usr.bin/ftp/ftp.1     |   4 ++--
 usr.bin/ftp/ftp.c     |   6 +++---
 usr.bin/ftp/main.c    |   6 +++---
 usr.bin/ftp/util.c    |  15 ++++++++++++---
 usr.bin/ftp/version.h |   6 +++---
 7 files changed, 30 insertions(+), 21 deletions(-)

diffs (173 lines):

diff -r 7aadb89faac5 -r 9afce4cbc5fc usr.bin/ftp/cmds.c
--- a/usr.bin/ftp/cmds.c        Wed Jun 05 10:03:31 2002 +0000
+++ b/usr.bin/ftp/cmds.c        Wed Jun 05 10:20:46 2002 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: cmds.c,v 1.97 2002/05/07 02:04:09 lukem Exp $  */
+/*     $NetBSD: cmds.c,v 1.98 2002/06/05 10:20:46 lukem Exp $  */
 
 /*-
- * Copyright (c) 1996-2001 The NetBSD Foundation, Inc.
+ * Copyright (c) 1996-2002 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -107,7 +107,7 @@
 #if 0
 static char sccsid[] = "@(#)cmds.c     8.6 (Berkeley) 10/9/94";
 #else
-__RCSID("$NetBSD: cmds.c,v 1.97 2002/05/07 02:04:09 lukem Exp $");
+__RCSID("$NetBSD: cmds.c,v 1.98 2002/06/05 10:20:46 lukem Exp $");
 #endif
 #endif /* not lint */
 
diff -r 7aadb89faac5 -r 9afce4cbc5fc usr.bin/ftp/fetch.c
--- a/usr.bin/ftp/fetch.c       Wed Jun 05 10:03:31 2002 +0000
+++ b/usr.bin/ftp/fetch.c       Wed Jun 05 10:20:46 2002 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: fetch.c,v 1.135 2002/05/06 15:03:30 lukem Exp $        */
+/*     $NetBSD: fetch.c,v 1.136 2002/06/05 10:20:48 lukem Exp $        */
 
 /*-
- * Copyright (c) 1997-2001 The NetBSD Foundation, Inc.
+ * Copyright (c) 1997-2002 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -41,7 +41,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: fetch.c,v 1.135 2002/05/06 15:03:30 lukem Exp $");
+__RCSID("$NetBSD: fetch.c,v 1.136 2002/06/05 10:20:48 lukem Exp $");
 #endif /* not lint */
 
 /*
@@ -1206,7 +1206,6 @@
                goto cleanup_fetch_url;
        }
        progressmeter(1);
-       bytes = 0;
        (void)fflush(fout);
        if (closefunc == fclose && mtime != -1) {
                struct timeval tval[2];
@@ -1225,6 +1224,7 @@
        }
        if (bytes > 0)
                ptransfer(0);
+       bytes = 0;
 
        rval = 0;
        goto cleanup_fetch_url;
diff -r 7aadb89faac5 -r 9afce4cbc5fc usr.bin/ftp/ftp.1
--- a/usr.bin/ftp/ftp.1 Wed Jun 05 10:03:31 2002 +0000
+++ b/usr.bin/ftp/ftp.1 Wed Jun 05 10:20:46 2002 +0000
@@ -1,6 +1,6 @@
-.\"    $NetBSD: ftp.1,v 1.82 2002/05/18 03:00:13 lukem Exp $
+.\"    $NetBSD: ftp.1,v 1.83 2002/06/05 10:20:48 lukem Exp $
 .\"
-.\" Copyright (c) 1996-2001 The NetBSD Foundation, Inc.
+.\" Copyright (c) 1996-2002 The NetBSD Foundation, Inc.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to The NetBSD Foundation
diff -r 7aadb89faac5 -r 9afce4cbc5fc usr.bin/ftp/ftp.c
--- a/usr.bin/ftp/ftp.c Wed Jun 05 10:03:31 2002 +0000
+++ b/usr.bin/ftp/ftp.c Wed Jun 05 10:20:46 2002 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: ftp.c,v 1.119 2002/05/07 02:04:09 lukem Exp $  */
+/*     $NetBSD: ftp.c,v 1.120 2002/06/05 10:20:49 lukem Exp $  */
 
 /*-
- * Copyright (c) 1996-2001 The NetBSD Foundation, Inc.
+ * Copyright (c) 1996-2002 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -103,7 +103,7 @@
 #if 0
 static char sccsid[] = "@(#)ftp.c      8.6 (Berkeley) 10/27/94";
 #else
-__RCSID("$NetBSD: ftp.c,v 1.119 2002/05/07 02:04:09 lukem Exp $");
+__RCSID("$NetBSD: ftp.c,v 1.120 2002/06/05 10:20:49 lukem Exp $");
 #endif
 #endif /* not lint */
 
diff -r 7aadb89faac5 -r 9afce4cbc5fc usr.bin/ftp/main.c
--- a/usr.bin/ftp/main.c        Wed Jun 05 10:03:31 2002 +0000
+++ b/usr.bin/ftp/main.c        Wed Jun 05 10:20:46 2002 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: main.c,v 1.80 2002/03/18 20:14:03 thorpej Exp $        */
+/*     $NetBSD: main.c,v 1.81 2002/06/05 10:20:50 lukem Exp $  */
 
 /*-
- * Copyright (c) 1996-2001 The NetBSD Foundation, Inc.
+ * Copyright (c) 1996-2002 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -108,7 +108,7 @@
 #if 0
 static char sccsid[] = "@(#)main.c     8.6 (Berkeley) 10/9/94";
 #else
-__RCSID("$NetBSD: main.c,v 1.80 2002/03/18 20:14:03 thorpej Exp $");
+__RCSID("$NetBSD: main.c,v 1.81 2002/06/05 10:20:50 lukem Exp $");
 #endif
 #endif /* not lint */
 
diff -r 7aadb89faac5 -r 9afce4cbc5fc usr.bin/ftp/util.c
--- a/usr.bin/ftp/util.c        Wed Jun 05 10:03:31 2002 +0000
+++ b/usr.bin/ftp/util.c        Wed Jun 05 10:20:46 2002 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: util.c,v 1.106 2001/12/26 09:40:16 lukem Exp $ */
+/*     $NetBSD: util.c,v 1.107 2002/06/05 10:20:50 lukem Exp $ */
 
 /*-
- * Copyright (c) 1997-2001 The NetBSD Foundation, Inc.
+ * Copyright (c) 1997-2002 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -75,7 +75,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: util.c,v 1.106 2001/12/26 09:40:16 lukem Exp $");
+__RCSID("$NetBSD: util.c,v 1.107 2002/06/05 10:20:50 lukem Exp $");
 #endif /* not lint */
 
 /*
@@ -957,6 +957,15 @@
        if (filesize > 0) {
                if (bytes <= 0 || elapsed <= 0.0 || cursize > filesize) {
                        len += snprintf(buf + len, BUFLEFT, "   --:-- ETA");
+               } else if (flag == 1) {
+                       i = elapsed / SECSPERHOUR;
+                       if (i)
+                               len += snprintf(buf + len, BUFLEFT, "%2d:", i);
+                       else
+                               len += snprintf(buf + len, BUFLEFT, "   ");
+                       i = (int)elapsed % SECSPERHOUR;
+                       len += snprintf(buf + len, BUFLEFT,
+                           "%02d:%02d    ", i / 60, i % 60);
                } else if (wait.tv_sec >= STALLTIME) {
                        len += snprintf(buf + len, BUFLEFT, " - stalled -");
                } else {
diff -r 7aadb89faac5 -r 9afce4cbc5fc usr.bin/ftp/version.h
--- a/usr.bin/ftp/version.h     Wed Jun 05 10:03:31 2002 +0000
+++ b/usr.bin/ftp/version.h     Wed Jun 05 10:20:46 2002 +0000
@@ -1,6 +1,6 @@
-/*     $NetBSD: version.h,v 1.28 2002/05/06 14:36:41 lukem Exp $       */
+/*     $NetBSD: version.h,v 1.29 2002/06/05 10:20:51 lukem Exp $       */
 /*-
- * Copyright (c) 1999-2001 The NetBSD Foundation, Inc.
+ * Copyright (c) 1999-2002 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -40,5 +40,5 @@
 #endif
 
 #ifndef FTP_VERSION
-#define        FTP_VERSION     "20020507"
+#define        FTP_VERSION     "20020605"
 #endif



Home | Main Index | Thread Index | Old Index