summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2000-07-21 11:20:05 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2000-07-21 11:20:05 +0000
commit2197aaf1394ec644924607aacda0450438a85e31 (patch)
tree919990bbfc36e83b6ef7cdf082bc064613f1b811 /usr.bin
parentcfb4c85341969e422dd36ff1fec679cfdd685a79 (diff)
Notes
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/fetch/fetch.111
-rw-r--r--usr.bin/fetch/fetch.c15
2 files changed, 11 insertions, 15 deletions
diff --git a/usr.bin/fetch/fetch.1 b/usr.bin/fetch/fetch.1
index 09436a5b60d1..c285d2337bc9 100644
--- a/usr.bin/fetch/fetch.1
+++ b/usr.bin/fetch/fetch.1
@@ -145,9 +145,6 @@ Try this flag if
seems to hang when retrieving FTP URLs.
.It Fl q
Quiet mode.
-This works by setting the verbosity level to zero; see the
-.Fl v
-option.
.It Fl R
The output files are precious, and should not be deleted under any
circumstances, even if the transfer failed or was incomplete.
@@ -175,13 +172,7 @@ for FTP transfers or
.Ev HTTP_TIMEOUT
for HTTP transfers if set.
.It Fl v
-Each instance of this flag increases the verbosity level by one.
-Level one (the default) only gives a summary after each file; level
-two show a running count during the transfer, provided that the
-standard output goes to a terminal; level three enables messages from
-the
-.Xr fetch 3
-library.
+Increase verbosity level.
.It Fl w Ar seconds
When the
.Fl a
diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c
index 987bc06b845b..fd97d5c1c681 100644
--- a/usr.bin/fetch/fetch.c
+++ b/usr.bin/fetch/fetch.c
@@ -113,7 +113,7 @@ stat_display(struct xferstat *xs, int force)
{
struct timeval now;
- if (!v_tty)
+ if (!v_tty || !v_level)
return;
gettimeofday(&now, NULL);
@@ -199,7 +199,7 @@ fetch(char *URL, char *path)
count = 0;
/* common flags */
- if (v_level > 2)
+ if (v_level > 1)
strcat(flags, "v");
switch (family) {
case PF_INET:
@@ -290,6 +290,12 @@ fetch(char *URL, char *path)
goto success;
}
+ if (v_level > 1) {
+ if (sb.st_size)
+ warnx("local: %lld / %ld", sb.st_size, sb.st_mtime);
+ warnx("remote: %lld / %ld", us.size, us.mtime);
+ }
+
/* open output file */
if (o_stdout) {
/* output to stdout */
@@ -307,7 +313,6 @@ fetch(char *URL, char *path)
if (sigint)
goto signal;
} else {
- us.size += url->offset;
if (us.size == sb.st_size)
/* nothing to do */
goto success;
@@ -684,12 +689,12 @@ main(int argc, char *argv[])
&& fetchLastErrCode != FETCH_UNKNOWN)) {
if (w_secs) {
if (v_level)
- fprintf(stderr, "Waiting %d seconds before retrying\n", w_secs);
+ fprintf(stderr, "Waiting %d seconds before retrying\n",
+ w_secs);
sleep(w_secs);
}
if (a_flag)
continue;
- fprintf(stderr, "Skipping %s\n", *argv);
}
}