Your message dated Wed, 23 Apr 2008 00:30:04 -0700
with message-id <[EMAIL PROTECTED]>
and subject line Functionality exists
has caused the Debian Bug report #208691,
regarding wget: patch to enable --progress=dots:10k
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [EMAIL PROTECTED]
immediately.)


-- 
208691: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=208691
Debian Bug Tracking System
Contact [EMAIL PROTECTED] with problems
--- Begin Message ---
Package: wget
Version: 1.8.2-11
Severity: wishlist
Tags: patch

Hi,

I just added the code to enable the command line option
    --progress=dots:<number>[kKmM]
to have a dot printed for whatever file size the user wishes.

The patch does not update any documentation -- it's just the code.

Roland

-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux schlafzimmer 2.4.21-3-k7 #1 Sun Jul 20 19:23:36 EST 2003 i686
Locale: LANG=C, LC_CTYPE=C (ignored: LC_ALL set to [EMAIL PROTECTED])

Versions of packages wget depends on:
ii  libc6                         2.3.2-4    GNU C Library: Shared libraries an
ii  libssl0.9.7                   0.9.7b-2   SSL shared libraries

-- no debconf information

--- src/progress.c.old  2002-05-24 16:58:17.000000000 +0200
+++ src/progress.c      2003-09-04 16:29:10.000000000 +0200
@@ -348,6 +348,42 @@
   xfree (dp);
 }
 
+/**
+ * Converts the string s to an unsigned long value. S is a
+ * decimal number which may have exactly one of the letters [kKmM]
+ * appended.
+ * Returns 1 if the conversion was successful, 0 if not. In the
+ * latter case the contents of l is left untouched.
+ */
+static int parse_with_units(const char *s, long *l)
+{
+  long result = 0L;
+  
+  while (ISDIGIT((int) *s)) {
+    result = 10 * result + (int) *s - '0';
+    s++;
+  }
+  switch (*s) {
+    case 'k':
+    case 'K':
+      result <<= 10;
+      break;
+
+    case 'm':
+    case 'M':
+      result <<= 20;
+      break;
+
+    case '\0':
+      break;
+
+    default:
+      return 0;
+  }
+  *l = result;
+  return 1;
+}
+
 /* This function interprets the progress "parameters".  For example,
    if Wget is invoked with --progress=dot:mega, it will set the
    "dot-style" to "mega".  Valid styles are default, binary, mega, and
@@ -396,6 +432,11 @@
       opt.dot_spacing = 8;
       opt.dots_in_line = 32;
     }
+  else if (parse_with_units(params, &opt.dot_bytes))
+    {
+      opt.dot_spacing = 10;
+      opt.dots_in_line = 50;
+    }
   else
     fprintf (stderr,
             _("Invalid dot style specification `%s'; leaving unchanged.\n"),

--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

It looks to me like this functionality already existed in 1.8.2, via the
"dotbytes" rc command ("-e dotbytes=10k").

Probably the user didn't know about it, since rc files are not found in
the manpage, but rather in the Texinfo docs only.

- --
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer,
and GNU Wget Project Maintainer.
http://micah.cowan.name/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIDuV77M8hyUobTrERAvrZAJ4rz2k/wqD6hPF8dmi/Y74Sp0ItnwCfeB4U
ityLon3QY6y/ZDBs9hSD3To=
=lrp/
-----END PGP SIGNATURE-----


--- End Message ---

Reply via email to