]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Add shuf, better random number generation, and fix sort -R in
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 8 Aug 2006 22:28:00 +0000 (22:28 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 8 Aug 2006 22:28:00 +0000 (22:28 +0000)
funny locales.

ChangeLog
doc/ChangeLog
lib/ChangeLog
m4/ChangeLog

index f3ce490bbf6f5cb16be9e52f94f10642ae6e32f5..c191e6b77056932007b5f3532b62381f6cbecbee 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,48 @@
+2006-08-08  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Add a command 'shuf', and modify shred and sort to use the new
+       random number generator library of 'shuf'.
+
+       * AUTHORS: Add shuf.
+       * README: Likewise.
+       * NEWS: Likewise.  Mention new --random-source option for shred
+       and sort.  Move "sort +1 -2" notice to the appropriate section,
+       and clarify its role with respect to POSIXLY_CORRECT.
+       * man/.cvsignore: Add shuf.1.
+       * man/Makefile.am (dist_man_MANS): Add shuf.1.
+       (shuf.1): New dependency.
+       * man/shuf.x: New file.
+       * src/Makefile.am (bin_PROGRAMS): Add shuf.
+       (EXTRA_DIST): Remove rand-isaac.c.
+       (shuf_LDADD): New macro.
+       * src/rand-isaac.c: Remove, moving most of its contents to
+       lib/rand-isaac.c.
+       * src/shuf.c: New file.
+       * src/shred.c: Use new random-number interface rather than rand-isaac.c.
+       Don't include rand-isaac.c; include randint.h and randread.h instead.
+       (RANDOM_SOURCE_OPTION): New enum.
+       (long_opts, usage, main): New option --random-source.
+       * src/sort.c: Likewise.
+       * src/shred.c (struct irand_state, irand_init, irand32, irand_mod): Remove.
+       All callers changed to use randint interface.
+       (fillrand): Remove.  All callers changed to use randread interface.
+       (dopass): Remove dependency on ISAAC buffer size.
+       (genpattern): Don't wipe the random state here.
+       (randint_source): New static var.
+       (clear_random_data): New function.
+       (main): Allocate random source, and arrange to wipe it on exit.
+       * src/sort.c: Include md5.h, randread.h, xmemxfrm.h.
+       (longopts, usage, main): Remove undocumented --seed option;
+       it's now replaced by --random-source.
+       (rand_state, get_hash): Remove.
+       (randread_source): New static var.
+       (random_state, cmp_hashes, compare_random): New functions; they guarantee
+       no collisions in the random hash function.
+       (keycompare): Use compare_random for -R; don't fall back on comparing
+       via memcoll, since compare_random does the right thing.
+       * tests/misc/Makefile.am (TESTS): Add shuf.
+       * tests/misc/shuf: New file.
+
 2006-07-29  Paul Eggert  <eggert@cs.ucla.edu>
 
        * src/copy.c (set_author): Preserve the st_author field via the
index 7ed09fb5dbed74055f8d972bb1a348b1b75f69c8..3f0f26a32f3e25b512f91cdc2854e95773a10c81 100644 (file)
@@ -1,3 +1,10 @@
+2006-08-08  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * coreutils.texi (shuf invocation, Random sources): New sections.
+       (Operating on sorted files): Add shuf.
+       (sort invocation, shred invocation): New option --random-source.
+       (sort invocation): Fix typo: -R -> -r.
+
 2006-07-28  Paul Eggert  <eggert@cs.ucla.edu>
 
        * coreutils.texi (install invocation, mkdir invocation):
index f9a59d8ce90603cf5033e6f33bbc9df800d43d8f..62d1ee3c6edb62a4a9bcb141a2c713b5dce040c3 100644 (file)
@@ -1,3 +1,11 @@
+2006-08-08  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * Makefile.am (libcoreutils_a_SOURCES): Add xmemxfrm.c, xmemxfrm.h.
+       * memxfrm.c, memxfrm.h, randint.c, randint.h, randperm.c, randperm.h: New files.
+       * randread.c, randread.h, xmemxfrm.c, xmemxfrm.h: New files.
+       * rand-isaac.h: New file.
+       * rand-isaac.c: New file, mostly taken from ../src/rand-isaac.c.
+
 2006-07-28  Paul Eggert  <eggert@cs.ucla.edu>
 
        * modechange.c (mode_compile): Numeric modes now affect setuid and
index 12f84d0cd6bf4e24149fb811be2c0a80255e3056..97c96666fdf5ef6ae2c30b699eeef2249315a27a 100644 (file)
@@ -1,3 +1,21 @@
+2006-08-08  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * memxfrm.m4, randint.m4, randperm.m4, randread.m4: New files.
+
+       * prereq.m4 (gl_PREREQ): Require gl_MEMXFRM, gl_RANDINT, gl_RANDPERM,
+       gl_RANDREAD.
+
+       * restrict.m4: Remove, since we no longer need gl_RESTRICT.
+       * getaddrinfo.m4 (gl_PREREQ_GETADDRINFO): Use AC_C_RESTRICT, not
+       gl_C_RESTRICT, since we assume recent Autoconf.
+       * regex.m4 (gl_PREREQ_REGEX): Likewise.
+       * time_r.m4 (gl_TIME_R): Likewise.
+
+2006-08-06  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * restrict.m4: Remove, now that we assume Autoconf 2.58 or later.
+       All uses of gl_C_RESTRICT changed to AC_C_RESTRICT.
+
 2006-07-22  Paul Eggert  <eggert@cs.ucla.edu>
 
        * close-stream.m4: New file.