Package: coreutils
Version: 6.10-6
Severity: wishlist
Tags: patch

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

there is another base64 program that performs the same purpose as
base64 in coreutils:

 http://www.fourmilab.ch/webtools/base64/

It accepts -e or --encode to mean the same thing that GNU base64
implies with no arguments.  It also accepts -n and --noerrcheck to
mean the same thing as GNU base64's -i and --ignore-garbage.

A friend just installed it from FreeBSD ports, and says that that
base64 also works the way GNU base64 does if no arguments are
supplied, though the man page [0] isn't clear on that.

If GNU base64 just accepted (and ignored) -e and --encode arguments,
and treated -n and --noerrcheck as synonyms for -i, then scripts
written to invoke fourmilab's base64 could use GNU's instead.

Attached is a patch that should handle it.  I didn't update the usage
output because it seems like a lot of noise, but i did get the info
docs.  It's not clear to me if the man pages need touching up too, or
if they'll get re-genned from info somehow.

Thanks for maintaining coreutils in debian!

        --dkg

[0] 
http://www.freebsd.org/cgi/man.cgi?query=base64&apropos=0&sektion=0&manpath=FreeBSD+7.0-RELEASE+and+Ports&format=html

- -- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing'), (200, 'unstable'), (101, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-1-686 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages coreutils depends on:
ii  libacl1                       2.2.47-2   Access control list shared library
ii  libc6                         2.7-13     GNU C Library: Shared libraries
ii  libselinux1                   2.0.65-4   SELinux shared libraries

coreutils recommends no packages.

coreutils suggests no packages.

- -- no debconf information

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iQIVAwUBSMB3rMzS7ZTSFznpAQI3ZA//TkzMpDtu/SCLDy23yQT/89mCJ6+2Tqkn
EAs9I2WQ8o8lkhvNTcTpv/3+zw15f53BzfBj9VvOhoRtAgBbEptl3Vswi+tKTXJh
j3y5aKIY7BPquVBfCJn/8B0sWLL7qKgdFmjMHUBjX5AhRJvXTv3Inbw7mB18bFg7
SjZR3Z3/9Wdqa7ARJzZyEbyg+rGSXGBHhz8+G+4PziyB0oCPqiXZXFu73z4xo53p
EDk2Zt7HwiHUDiH913bj6KuWrtC4oFhl8fwRUTsGfiEOe/nyBo02PSehEJNX//nL
IfxiAqgCyu2e6PMsbTmV60QqfiNUyKHE90k+H1BBLEbhJ5gKx5HTD+kWzqGA4XLw
FPtEhyz5hhyFu8abc2DLmugDjRE7pxtnCLOVZ7LAbIRnKeefsKs6RAcx6tCkDSrw
rBy3F0IbqnjzWVX3OJ6lRDO5oXfg/Zqi63+/H4pJP9bkK9YGvFJxZvLY4snw1p0x
VJ0BgvM/5CmoWsYEYESL6JC9aCAlxJ+6QvtkDdftQP7RMeiA1RTastEg9bfy+GXZ
eA3KkCMqVFgbXAYFROz+/z4IawLkz1M4JZolqxsuw7OBv5pHjmexuUkwwRog+4Xf
5niEkspvUl9my8tcJubcNZ9gFziLszc6BMxdygLo/7BUIZRm1gusUrQhwUX8qeuy
UFBj6SKALqU=
=XV4P
-----END PGP SIGNATURE-----
diff -ru coreutils-6.10.clean/doc/coreutils.info coreutils-6.10/doc/coreutils.info
--- coreutils-6.10.clean/doc/coreutils.info	2008-09-04 19:28:46.000000000 -0400
+++ coreutils-6.10/doc/coreutils.info	2008-09-04 19:55:47.000000000 -0400
@@ -1539,11 +1539,20 @@
      decoding data.  Input is expected to be base64 encoded data, and
      the output will be the original data.
 
+`-e'
+`--encode'
+     Encoding data is the default, so this flag does nothing.  It is
+     present for option-compatibility with base64 from
+     http://www.fourmilab.ch/webtools/base64/
+
 `-i'
 `--ignore-garbage'
+`-n'
+`--noerrcheck'
      When decoding, newlines are always accepted.  During decoding,
      ignore unrecognized bytes, to permit distorted data to be decoded.
-
+     `-n' and `--noerrcheck' are for drop-in compatibility with 
+     http://www.fourmilab.ch/webtools/base64/
 
    An exit status of zero indicates success, and a nonzero value
 indicates failure.
Only in coreutils-6.10/doc: coreutils.info~
diff -ru coreutils-6.10.clean/src/base64.c coreutils-6.10/src/base64.c
--- coreutils-6.10.clean/src/base64.c	2008-09-04 19:28:46.000000000 -0400
+++ coreutils-6.10/src/base64.c	2008-09-04 19:53:26.000000000 -0400
@@ -41,9 +41,11 @@
 char *program_name;
 
 static const struct option long_options[] = {
+  {"encode", no_argument, 0, 'e'},
   {"decode", no_argument, 0, 'd'},
   {"wrap", required_argument, 0, 'w'},
   {"ignore-garbage", no_argument, 0, 'i'},
+  {"noerrcheck", no_argument, 0, 'n'},
   {"help", no_argument, 0, GETOPT_HELP_CHAR},
   {"version", no_argument, 0, GETOPT_VERSION_CHAR},
 
@@ -257,13 +259,18 @@
 
   atexit (close_stdout);
 
-  while ((opt = getopt_long (argc, argv, "dqiw:", long_options, NULL)) != -1)
+  while ((opt = getopt_long (argc, argv, "edqniw:", long_options, NULL)) != -1)
     switch (opt)
       {
       case 'd':
 	decode = true;
 	break;
 
+      case 'e':
+	/* ignore, but accept for compatibility with 
+	   http://www.fourmilab.ch/webtools/base64/ */
+	break;
+
       case 'w':
 	if (xstrtoumax (optarg, NULL, 0, &wrap_column, NULL) != LONGINT_OK)
 	  error (EXIT_FAILURE, 0, _("invalid wrap size: %s"),
@@ -271,6 +278,7 @@
 	break;
 
       case 'i':
+      case 'n':
 	ignore_garbage = true;
 	break;
 
Only in coreutils-6.10/src: base64.c~

Reply via email to