Jim Meyering [Thu, 8 Mar 2007 21:01:05 +0000 (22:01 +0100)]
TODO: printf: support %a even when the native *printf(3) is deficient
Jim Meyering [Thu, 8 Mar 2007 09:00:55 +0000 (10:00 +0100)]
rm without -f: give a better diagnostic when euidaccess fails.
* src/remove.c (write_protected_non_symlink): Return int, not bool,
so that we can indicate failure too (as a postive error number).
(prompt): If write_protected_non_symlink fails, report that error
number and fail rather than charging ahead and removing the dubious
entry. Redo the logic of printing a diagnostic so that we need to
invoke quote (full_filename (...)) only once. More details at:
<http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/9952/focus=9996>
Jim Meyering [Thu, 8 Mar 2007 08:14:18 +0000 (09:14 +0100)]
Generalize a few more cvs-isms.
* bootstrap (checkout_only_file): Rename from CVS_only_file.
Change comments and diagnostics not to say "CVS".
Jim Meyering [Thu, 8 Mar 2007 00:06:41 +0000 (01:06 +0100)]
* bootstrap: Run libtool, if necessary.
Jim Meyering [Wed, 7 Mar 2007 23:23:00 +0000 (00:23 +0100)]
Make bootstrap a little more general.
* bootstrap (build_aux): Factor out/use this definition.
Formally require a "AC_CONFIG_AUX_DIR($build_aux)" line in configure.ac.
(insert_sorted_if_absent): Move function definition "up", to
precede new first use.
If $build_aux/ doesn't exist initially, create it, and
mark it as ignored.
Jim Meyering [Sun, 4 Mar 2007 12:03:59 +0000 (13:03 +0100)]
* vasnprintf.c (VASNPRINTF): Add missing semicolon.
Andrew Church [Sat, 3 Mar 2007 22:00:18 +0000 (23:00 +0100)]
Fix a bug: cp -x would fail to set mount point permissions.
* NEWS: mention cp -x bug fix
* src/copy.c (copy_internal): Don't return immediately after
copying a mount point that we do not intend to recurse under.
Based on a patch by Andrew Church.
Jim Meyering [Sat, 3 Mar 2007 20:38:16 +0000 (21:38 +0100)]
pwd-unreadable-parent: Skip test on ia64/Linux, too.
* tests/misc/pwd-unreadable-parent: Also skip when $REPLACE_GETCWD.
Reported by Bob Proulx.
Jim Meyering [Fri, 2 Mar 2007 13:54:52 +0000 (14:54 +0100)]
Add to .cvsignore and .gitignore files.
Jim Meyering [Fri, 2 Mar 2007 13:33:12 +0000 (14:33 +0100)]
* vasnprintf.c (VASNPRINTF): Remove cast of alloca return value.
Jim Meyering [Fri, 2 Mar 2007 13:25:48 +0000 (14:25 +0100)]
pwd-unreadable-parent: Skip test on non-Linux/GNU systems.
* tests/misc/pwd-unreadable-parent: Rather than trying to decide
whether this test has a chance of succeeding, run it only when
$(host_os) is linux-gnu. It was failing on powerpc-apple-darwin8.8.0
* tests/misc/Makefile.am (TESTS_ENVIRONMENT): Add host_os=$(host_os).
Jim Meyering [Fri, 2 Mar 2007 12:18:43 +0000 (13:18 +0100)]
* tests/misc/pwd-long: Also allow "+" in $PWD.
Jim Meyering [Fri, 2 Mar 2007 10:13:54 +0000 (11:13 +0100)]
* Makefile.maint (my-distcheck): Skip the c99/c89 check if there's no such .diff file.
Jim Meyering [Fri, 2 Mar 2007 09:57:08 +0000 (10:57 +0100)]
Remove another coreutils-ism. Formatting cleanup.
* Makefile.maint (my-distcheck): Update an outdated comment.
(emit_upload_commands): Use $(PACKAGE) rather than "coreutils".
Jim Meyering [Thu, 1 Mar 2007 10:06:58 +0000 (11:06 +0100)]
* Makefile.maint (warn_cflags): Hoist, adding "-Dlint -O".
(my-distcheck): Use the new variable, instead of too-long literal.
Jim Meyering [Thu, 1 Mar 2007 10:05:35 +0000 (11:05 +0100)]
Make "make syntax-check" rules less coreutils-specific.
* Makefile.maint (sc_cast_of_x_alloc_return_value): Use CVS_LIST_EXCEPT.
(sc_cast_of_alloca_return_value): Likewise.
(sc_root_tests): Do nothing if there is no check-root target
in tests/Makefile.am.
Jim Meyering [Thu, 1 Mar 2007 10:02:25 +0000 (11:02 +0100)]
Run the writable-files check only for release-building targets.
* Makefile.maint (local-checks-available): Remove writable-files.
(alpha beta major): Put it here, instead.
Jim Meyering [Thu, 1 Mar 2007 10:00:12 +0000 (11:00 +0100)]
"make syntax-check" now runs only Makefile.cfg-selected tests
* Makefile.maint (syntax-check-rules): Hoist this definition so that
it precedes the indirect use in the definition of $(local-check).
(local-check): Use :=, not just "=".
(syntax-check): Depend on $(local-check), not $(syntax-check-rules).
Jim Meyering [Thu, 1 Mar 2007 09:41:48 +0000 (10:41 +0100)]
Merge in changes from gnulib:
* vasnprintf.c: Add a comment explaining why coreutils has its own
version of this file.
Include <stdint.h>.
(SIZE_MAX): Remove definition (now, stdint.h covers that).
(EOVERFLOW): Remove definition (now done via the eoverflow module).
Update some #ifdef to #if.
Use HAVE_LONG_LONG_INT, not HAVE_LONG_LONG.
* printf-parse.c: Likewise.
Bruno Haible [Thu, 1 Mar 2007 07:06:24 +0000 (08:06 +0100)]
* bootstrap.conf (gnulib_modules): Replace xreadlink with
xreadlink-with-size. Add xreadlink.
* src/copy.c (copy_internal): Update.
* src/ls.c (is_directory): Update.
* src/stat.c (print_stat): Update.
* src/readlink.c (main): Use the one-argument xreadlink function.
Paul Eggert [Wed, 28 Feb 2007 21:25:53 +0000 (22:25 +0100)]
* doc/coreutils.texi (Common options): --si outputs "M", not "MB".
Problem reported by Philip Rowlands in
<http://lists.gnu.org/archive/html/bug-coreutils/2007-02/msg00283.html>.
Jim Meyering [Wed, 28 Feb 2007 20:50:14 +0000 (21:50 +0100)]
* tsearch.c: Remove unused file.
Jim Meyering [Wed, 28 Feb 2007 12:52:20 +0000 (13:52 +0100)]
* .x-sc_file_system: Add the new test, tests/misc/df-P, to this
list of exceptions, for the "make distcheck" sc_file_system rule.
Jim Meyering [Wed, 28 Feb 2007 09:27:31 +0000 (10:27 +0100)]
* Makefile.maint (gnulib_snapshot_date): Remove now-unused definition.
Jim Meyering [Wed, 28 Feb 2007 07:11:41 +0000 (08:11 +0100)]
* tests/misc/df-P: This script *is* executable.
Jim Meyering [Tue, 27 Feb 2007 18:34:51 +0000 (19:34 +0100)]
Add a test for today's df -P fix.
* tests/misc/df-P: New file.
* tests/misc/Makefile.am (TESTS): Add df-P.
Paul Eggert [Tue, 27 Feb 2007 18:12:08 +0000 (19:12 +0100)]
Make df -P immune to effects of e.g., the BLOCK_SIZE envvar.
* NEWS: With -P, the default block size and output format is not
affected by DF_BLOCK_SIZE, BLOCK_SIZE, or BLOCKSIZE.
* src/df.c (main): Implement this.
* doc/coreutils.texi (df invocation): With -P, the default block size
and output format is not affected by DF_BLOCK_SIZE, BLOCK_SIZE, or
BLOCKSIZE.
Jim Meyering [Sun, 25 Feb 2007 00:11:32 +0000 (01:11 +0100)]
* Makefile.maint (announcement): Adjust so that it works with
announce-gen's --gnulib-snapshot-time-stamp option.
Indent one of the command lines using TAB, not 8 spaces.
Jim Meyering [Sun, 25 Feb 2007 00:10:07 +0000 (01:10 +0100)]
Post-release version change.
* NEWS: Add a line for 6.8+.
* configure.ac (AC_INIT): Set new version string.
Jim Meyering [Sat, 24 Feb 2007 20:16:52 +0000 (21:16 +0100)]
Version 6.8.
* NEWS: Record release date and new version number.
* configure.ac (AC_INIT): New version number.
Jim Meyering [Sat, 24 Feb 2007 19:57:14 +0000 (20:57 +0100)]
Don't skip this test on new-enough Linux/GNU systems.
* tests/misc/pwd-unreadable-parent: Test $REPLACE_GETCWD = 0,
rather than for __GETCWD_PREFIX in config.h (the latter is no
longer defined, ever, due to gnulib changes).
* tests/misc/Makefile.am (TESTS_ENVIRONMENT): Define REPLACE_GETCWD.
Jim Meyering [Sat, 24 Feb 2007 12:57:51 +0000 (13:57 +0100)]
Remove the "gnits" option; it prohibits my using "+" as a version
string suffix, and all it does (beyond the default "gnu" option)
is to _require_ the THANKS file.
* configure.ac (AM_INIT_AUTOMAKE): Remove it.
Remove all AUTOMAKE_OPTIONS settings in Makefile.am files.
* tests/chgrp/Makefile.am, tests/chmod/Makefile.am:
* tests/chown/Makefile.am, tests/cp/Makefile.am:
* tests/du/Makefile.am, tests/expr/Makefile.am:
* tests/factor/Makefile.am, tests/general/Makefile.am:
* tests/install/Makefile.am, tests/ln/Makefile.am:
* tests/ls/Makefile.am, tests/mkdir/Makefile.am:
* tests/mv/Makefile.am, tests/readlink/Makefile.am:
* tests/rm/Makefile.am, tests/rmdir/Makefile.am:
* tests/seq/Makefile.am, tests/stty/Makefile.am:
* tests/tee/Makefile.am, tests/touch/Makefile.am:
Jim Meyering [Sat, 24 Feb 2007 12:49:20 +0000 (13:49 +0100)]
* README: Document the OSF/1 4.0d build failure and work-around.
Reported by Bruno Haible.
Jim Meyering [Sat, 24 Feb 2007 12:11:25 +0000 (13:11 +0100)]
* NEWS: Use a simple "+" suffix to denote pre-release, not "-dirty".
Nicer connotations.
* configure.ac: Use 6.7+, not 6.7-dirty.
Paul Eggert [Sat, 24 Feb 2007 11:24:27 +0000 (12:24 +0100)]
* NEWS: sort no longer compresses temporaries by default.
* bootstrap.conf: Remove findprog.
* doc/coreutils.texi (sort invocation): The default is to not
compress. Don't treat "" specially.
* src/sort.c: Don't include findprog.h.
(create_temp): Compress only if the user specified --compress-program.
* tests/misc/sort-compress: Adjusts tests to match new behavior.
Jim Meyering [Sat, 24 Feb 2007 08:26:56 +0000 (09:26 +0100)]
Avoid a shell syntax error, when building with an inadequate Perl.
* man/Makefile.am (.x.1): Add quotes around $(PERL) in case, since
it can expand to "/.../missing perl".
Jim Meyering [Sat, 24 Feb 2007 08:14:56 +0000 (09:14 +0100)]
* man/Makefile.am (.x.1): Warn when unable to update a man page.
Suggestion from Bruno Haible.
Bruno Haible [Sat, 24 Feb 2007 07:51:19 +0000 (08:51 +0100)]
Handle better the combination of old Perl and a pre-c99 compiler.
* man/Makefile.am (.x.1): If the autoconf test has determined that
perl is missing or not a sufficient version, do nothing.
Bruno Haible [Sat, 24 Feb 2007 07:22:08 +0000 (08:22 +0100)]
* tests/readlink/can-e: Put the closing double-quote at the end of a
backquoted word, not in the middle. Works around a bug in sh on
OSF/1 4.0d.
* tests/readlink/can-f: Likewise.
* tests/readlink/can-m: Likewise.
Bruno Haible [Sat, 24 Feb 2007 07:20:37 +0000 (08:20 +0100)]
* tests/du/slink: Skip the test if executing on an nfsv3 file system.
This avoids a test failure at least on OSF/1 4.0d.
Jim Meyering [Fri, 23 Feb 2007 21:16:12 +0000 (22:16 +0100)]
* randperm.c (randperm_new): Comment: say that this function
returns a pointer to malloc'd storage.
Jim Meyering [Fri, 23 Feb 2007 16:50:40 +0000 (17:50 +0100)]
* src/date.c (usage): Split a diagnostic that had grown to be
longer than the C89 maximum of 509 bytes.
Ed Santiago [Fri, 23 Feb 2007 15:11:01 +0000 (16:11 +0100)]
* src/date.c (usage): Mention that --rfc-3339 uses space, not 'T',
for a separator. Include sample RFC 2822 and 3339 output.
Jim Meyering [Fri, 23 Feb 2007 14:18:16 +0000 (15:18 +0100)]
With -Dlint, make shuf free all heap-allocated storage.
* src/shuf.c (main): Move declaration of input_lines to
function scope, and initialize to NULL, so we can free it.
[lint]: Free all malloc'd memory.
* tests/misc/shuf: Also test shuf's -e and -i options.
Jim Meyering [Thu, 22 Feb 2007 22:51:43 +0000 (23:51 +0100)]
Correct typo in ChangeLog entry.
Jim Meyering [Thu, 22 Feb 2007 22:37:19 +0000 (23:37 +0100)]
Merge in a change from some other incarnation of this file (gzip?)
* bootstrap (gnulib_tool): Skip get_translations if there is no po/ dir.
Paul Eggert [Thu, 22 Feb 2007 18:09:35 +0000 (19:09 +0100)]
Honor dd's noatime flag if possible, even if not supported on build fs
* doc/coreutils.texi (dd invocation): Warn that noatime might not be
reliable.
* src/dd.c (flags, usage): Look at O_NOATIME, not
HAVE_WORKING_O_NOATIME, to decide whether to support the noatime
flag, so that dd attempts O_NOATIME even if the build file system
does not support it. Problem reported by Jim Meyering today in
bug-coreutils.
* tests/dd/misc: Generate a warning, not a failure, if noatime
exists but fails.
Jim Meyering [Thu, 22 Feb 2007 15:32:45 +0000 (16:32 +0100)]
Adjust preceding change not to perform an unaligned access.
* src/copy.c (copy_reg): Undo previous change. Instead, make
it clearer that we're using a single-byte sentinel, and
[lint]: Initialize uintptr_t-1 bytes after the sentinel.
Reported by Andreas Schwab.
Jim Meyering [Thu, 22 Feb 2007 11:50:36 +0000 (12:50 +0100)]
Placate valgrind, wrt ./cp --sparse=always
* src/copy.c (copy_reg): Place the sentinel by setting a
full word's worth of bits, not just a single byte's worth.
This avoids a harmless (but distracting) case of memory being
used-uninitialized.
Jim Meyering [Wed, 21 Feb 2007 21:45:09 +0000 (22:45 +0100)]
Add to .cvsignore and .gitignore files.
Jim Meyering [Wed, 21 Feb 2007 16:26:32 +0000 (17:26 +0100)]
* tests/misc/date: Remove vestigial use of Data::Dumper.
Paul Eggert [Wed, 21 Feb 2007 16:23:05 +0000 (17:23 +0100)]
* src/copy.c (cached_umask): Cast -1 to mode_t to avoid a warning
about out-of-range initializer with Sun C 5.8.
Jim Meyering [Tue, 20 Feb 2007 21:44:15 +0000 (22:44 +0100)]
* bootstrap (CVS_only_file): Use README-hacking.
Jim Meyering [Tue, 20 Feb 2007 21:42:56 +0000 (22:42 +0100)]
* README-hacking: Update to reflect that we now use git.
Jim Meyering [Tue, 20 Feb 2007 21:37:18 +0000 (22:37 +0100)]
Now that we use GIT, not cvs, rename README-cvs.
* README-hacking: Renamed from...
* README-cvs: ...this.
Jim Meyering [Tue, 20 Feb 2007 16:23:51 +0000 (17:23 +0100)]
* src/env.c (main): When invoked with no arguments (i.e. when printing
the environment), use a local variable to iterate through the global
"environ" array, rather than "environ" itself. This is solely to
avoid changing the environment for an LD_PRELOAD-substituted "puts"
or "exit" function. Tiny patch by Harvey Eneman. See
<http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/9735>.
* THANKS: Update.
Jim Meyering [Tue, 20 Feb 2007 16:20:22 +0000 (17:20 +0100)]
* bootstrap: Move definitions of temporary directory names and the
new bt_regex "up" to precede all uses, so it's clearer what their
scope is. Also, use [.], rather than \\., since the former works
even if eval'd.
Jim Meyering [Tue, 20 Feb 2007 16:08:10 +0000 (17:08 +0100)]
* bootstrap: Remove occurrences of $bt (._bootmp) from lib/Makefile.
Based on the bison 2007-02-19 change by Joel E. Denny.
Paul Eggert [Mon, 19 Feb 2007 21:11:18 +0000 (22:11 +0100)]
* NEWS: sort now uses a --compress-program option rather than
an environment variable.
* doc/coreutils.texi (sort invocation): Document this.
* src/sort.c (usage): Likewise.
(COMPRESS_PROGRAM_OPTION): New const.
(long_options, create_temp, main): Support new option.
* tests/misc/sort-compress: Test it.
Jim Meyering [Mon, 19 Feb 2007 17:44:21 +0000 (18:44 +0100)]
* bootstrap: Fix typo s/dowloading/downloading/ in --help output.
Jim Meyering [Sun, 18 Feb 2007 21:40:52 +0000 (22:40 +0100)]
Add to .cvsignore and .gitignore files.
Jim Meyering [Sun, 18 Feb 2007 21:34:37 +0000 (22:34 +0100)]
Rely on gnulib-generated stdlib.h, not exit.h.
* src/system.h: Don't include exit.h, now that it's subsumed
by the gnulib-generated stdlib.h.
* lib/xfts.c: Include <stdlib.h> rather than exit.h, now that stdlib.h
Jim Meyering [Sun, 18 Feb 2007 16:40:06 +0000 (17:40 +0100)]
* tests/rm/fail-eacces: Skip this test when running as root.
Reported by Matthew Woehlke.
Jim Meyering [Sun, 18 Feb 2007 11:06:01 +0000 (12:06 +0100)]
* bootstrap: Use "._bootmp" as the temporary directory name,
not ".#bootmp". The latter's "#" caused trouble with the new,
gnulib-added "LINK_WARNING_H = $(top_srcdir)/.#bootmp/..." line.
Paul Eggert [Thu, 15 Feb 2007 07:16:30 +0000 (08:16 +0100)]
* bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
* src/dircolors.c: Include c-strcase.h.
(dc_parse_stream): Use c_strcasecmp rather than
strcasecmp to avoid unreliable results in locales like Turkish
where strcasecmp is incompatible with the C locale.
Jim Meyering [Tue, 13 Feb 2007 21:27:27 +0000 (22:27 +0100)]
Also check for and print stderr output, in case a program fails.
* tests/misc/tty-eof: Occasionally (not reproducible), this
test would fail, with one or more programs exiting nonzero, e.g.,
tty-eof: sha224sum exited with status 1 (expected 0)
Now, maybe we'll get a clue, the next time that happens.
Jim Meyering [Mon, 12 Feb 2007 19:09:12 +0000 (20:09 +0100)]
* .x-sc_useless_cpp_parens: Ignore a false-positive in a shell script.
Jim Meyering [Mon, 12 Feb 2007 00:20:20 +0000 (01:20 +0100)]
* tests/misc/pwd-unreadable-parent: Skip the test if we're
definitely using the replacement.
* tests/misc/Makefile.am (TESTS_ENVIRONMENT): Define CONFIG_HEADER.
Jim Meyering [Sat, 10 Feb 2007 21:30:18 +0000 (22:30 +0100)]
Remove excess leading spaces that would make help2man misbehave.
* src/printf.c (usage): Remove excess spaces on 2nd line of %b desc.
* src/nl.c (usage): Remove excess spaces on 2nd line of pBRE desc.
* src/dd.c (usage): Remove excess spaces on 2nd line of sync desc.
* src/date.c (usage): Use two spaces after each optional flag, not one.
Reported by Thomas Huriaux in <http://bugs.debian.org/410407>.
Jim Meyering [Sat, 10 Feb 2007 15:17:41 +0000 (16:17 +0100)]
* Makefile.maint (longopt_re): Relax the regexp, making square
brackets optional, so it matches the newly reported violations, too.
Jim Meyering [Sat, 10 Feb 2007 15:15:34 +0000 (16:15 +0100)]
* src/csplit.c (usage): Use two spaces (not one) to separate
each option string from its description, so help2man formats
the derived man page properly. Reported by Thomas Huriaux in
<http://bugs.debian.org/410407>.
* src/df.c (usage): Likewise.
* src/du.c (usage): Likewise.
* src/install.c (usage): Likewise.
* src/ls.c (usage): Likewise.
Jim Meyering [Sat, 3 Feb 2007 19:02:48 +0000 (20:02 +0100)]
Test for today's gnulib/lib/getcwd.c fix affecting pwd and readlink
* NEWS: Mention the bug fix.
* tests/misc/pwd-unreadable-parent: New file.
* tests/misc/Makefile.am (TESTS): Ad pwd-unreadable-parent.
Paul Eggert [Sat, 3 Feb 2007 17:45:46 +0000 (18:45 +0100)]
* NEWS: Document fix for cp --preserve=mode.
* src/copy.c (copy_internal): Omit the group- or other-writeable
permissions when creating a directory, to avoid a race condition
if the special mode bits aren't right just after the directory is
created.
* src/cp.c (make_dir_parents_private): Likewise.
* tests/cp/parent-perm-race: Test for the "cp --preserve=mode"
race fix in copy.c.
Paul Eggert [Sat, 3 Feb 2007 17:12:11 +0000 (18:12 +0100)]
* NEWS: Document fix for cp --parents.
* src/cp.c (make_dir_parents_private): Report the error sooner with
"cp --parents DIR/FILE DEST" when DIR is a non-directory, thus not
creating the directory, DEST/DIR.
* tests/cp/cp-parents: Test for the non-race-condition bug fixed
by the above change.
Jim Meyering [Fri, 2 Feb 2007 07:57:47 +0000 (08:57 +0100)]
* src/nl.c (proc_text): Use "NULL", not "(struct re_registers *) 0".
Jim Meyering [Fri, 2 Feb 2007 00:22:58 +0000 (01:22 +0100)]
* src/c99-to-c89.diff: Make shred.c Index: and a/b prefixes
consistent, so this can be applied with patch -p0.
Reported by Matthew Woehlke.
* Makefile.maint (patch-check): Use patch with its -p2 option,
since that makes this check slightly more strict.
Jim Meyering [Tue, 30 Jan 2007 22:07:38 +0000 (23:07 +0100)]
* vc-list-files: Select column 2, not 3 (hg-0.9.3's manifest format
now has only two columns).
Paul Eggert [Tue, 30 Jan 2007 21:56:48 +0000 (22:56 +0100)]
* coreutils.texi: @item -> @itemx to fix some typos.
Paul Eggert [Tue, 30 Jan 2007 21:54:34 +0000 (22:54 +0100)]
* coreutils.texi (mkdir invocation): Say how to set the file
permission bits of a parent directory with mkdir -p.
Jim Meyering [Mon, 29 Jan 2007 17:09:57 +0000 (18:09 +0100)]
Document new syntax: "chown +0:+287 file", "chgrp +99 file"
* coreutils.texi (Disambiguating names and IDs): New section.
(chown invocation, chgrp invocation): Mention the new syntax
with an xref to the new section.
Jim Meyering [Mon, 29 Jan 2007 14:38:50 +0000 (15:38 +0100)]
Regenerate .cvsignore and .gitignore files.
Jim Meyering [Mon, 29 Jan 2007 13:18:28 +0000 (14:18 +0100)]
Plug a leak in ls.
* src/ls.c (print_dir): Don't leak a "DIR"+fd upon failure to
determine dev/inode or upon detecting a symlink loop.
Jim Meyering [Mon, 29 Jan 2007 13:06:45 +0000 (14:06 +0100)]
* src/ls.c: Rename three global variables.
(cwd_file): Rename from 'files'.
(cwd_n_alloc): Rename from 'nfiles'.
(cwd_n_used): Rename from 'files_index'.
Jim Meyering [Mon, 29 Jan 2007 11:25:01 +0000 (12:25 +0100)]
Shave 8 bytes off the size of "struct fileinfo".
* src/ls.c (fileinfo): Put all members of type "bool" together.
Paul Eggert [Mon, 29 Jan 2007 11:08:52 +0000 (12:08 +0100)]
Modify "ls" to sort its data faster, using the new gnulib mpsort
module rather than qsort. This is particularly a win in
environments where strcoll is slow, since mpsort typically calls
strcoll less often than qsort does.
* bootstrap.conf (gnulib_modules): Add mpsort.
* src/ls.c: Include mpsort.h.
(sorted_file, sorted_file_alloc): New vars, for a new vector of
pointers to the file info, for speed.
(clear_files, extract_dirs_from_files, sort_files, print_current_files):
(print_many_per_line, print_horizontal, print_with_commas):
(calculate_columns): Set and use new vector.
(initialize_ordering_vector): New function.
Jim Meyering [Fri, 26 Jan 2007 23:08:36 +0000 (00:08 +0100)]
Regenerate .cvsignore and .gitignore files, and reflect recent removal
of string.h-related lib/*.h files
Paul Eggert [Fri, 26 Jan 2007 22:58:37 +0000 (23:58 +0100)]
Adjust to today's change to gnulib, which added a module for
string.h to replace the little include files like strcase.h.
* src/dircolors.c: Don't include strcase.h.
* src/system.h: Don't include mempcpy.h, memrchr.h, stpcpy.h, strpbrk.h.
Jim Meyering [Fri, 26 Jan 2007 15:37:37 +0000 (16:37 +0100)]
* src/dd.c (advance_input_after_read_error): Change diagnostic to
say "invalid file offset" rather than "screwy file offset".
Jim Meyering [Fri, 26 Jan 2007 10:11:15 +0000 (11:11 +0100)]
* .x-sc_cast_of_argument_to_free: Remove this file.
* Makefile.am (EXTRA_DIST): Likewise.
Dan Hipschman [Thu, 25 Jan 2007 20:56:32 +0000 (21:56 +0100)]
* src/sort.c (create_temp): Remove superfluous access-X_OK
check. find_in_path does this for us.
Jim Meyering [Wed, 24 Jan 2007 09:34:45 +0000 (10:34 +0100)]
Remove usually-skipped test.
* tests/cp/open-perm-race: Remove this file. It is subsumed
by parent-perm-race.
* tests/cp/Makefile.am (TESTS): Remove open-perm-race.
* tests/sort/Makefile.am: Regenerate.
Jim Meyering [Wed, 24 Jan 2007 08:32:56 +0000 (09:32 +0100)]
Pass "make distcheck" again.
* src/sort.c (usage): Split a diagnostic that had grown to be
longer than the C89 maximum of 509 bytes.
* .x-sc_cast_of_argument_to_free: New file. Allow a cast in sort.c.
FIXME: this is just temporary, while we wait to remove the offending
access-calling code.
* Makefile.am (EXTRA_DIST): Add .x-sc_cast_of_argument_to_free.
* Makefile.maint (sc_cast_of_argument_to_free): Use the
canonical, $$($(CVS_LIST_EXCEPT)).
* m4/.gitignore, m4/.cvsignore, lib/.gitignore, lib/.cvsignore: Update.
Paul Eggert [Wed, 24 Jan 2007 08:06:57 +0000 (09:06 +0100)]
* NEWS: New option sort -C, proposed by XCU ERN 127, which looks
like it will be approved. Also add --check=quiet, --check=silent
as long aliases, and --check=diagnose-first as an alias for -c.
* doc/coreutils.texi (sort invocation): Document this.
Also, mention that sort -c can take at most one file.
* src/sort.c: Implement this.
Include argmatch.h.
(usage): Document the change.
(CHECK_OPTION): New constant.
(long_options): --check now takes an optional argument, and is now
treated differently from 'c'.
(check_args, check_types): New constant arrays.
(check): New arg CHECKONLY, which suppresses diagnostic if -C.
(main): Parse the new options.
* tests/sort/Test.pm (02d, 02d, incompat5, incompat6):
New tests for -C.
Jim Meyering [Wed, 24 Jan 2007 07:54:51 +0000 (08:54 +0100)]
Fix a typo.
* tests/misc/sort-compress: Use $abs_top_builddir, not $top_builddir.
* tests/misc/Makefile.am (TESTS_ENVIRONMENT): Likewise.
Jim Meyering [Tue, 23 Jan 2007 23:34:54 +0000 (00:34 +0100)]
Don't depend on "which".
* tests/misc/sort-compress (SORT): Use $abs_builddir, now which.
* tests/misc/Makefile.am (TESTS_ENVIRONMENT): Export top_builddir.
Dan Hipschman [Tue, 23 Jan 2007 23:27:01 +0000 (00:27 +0100)]
Test sort compression.
* tests/misc/Makefile.am: Add the test.
* tests/misc/sort-compress: New file containing the tests.
Jim Meyering [Tue, 23 Jan 2007 23:22:45 +0000 (00:22 +0100)]
* NEWS: sort temp file compression: tweak wording.
* src/sort.c (struct sortfile) [name]: Declare member to be const.
Dan Hipschman [Tue, 23 Jan 2007 23:00:21 +0000 (00:00 +0100)]
* src/sort.c (MAX_FORK_RETRIES_COMPRESS, MAX_FORK_RETRIES_DECOMPRESS):
In pipe_fork callers, use these named constants, not "2" and "8".
(proctab, nprocs): Declare to be "static".
(pipe_fork) [lint]: Initialize local, pid,
to avoid unwarranted may-be-used-uninitialized warning.
(create_temp): Use the active voice. Describe parameters, too.
2007-01-21 James Youngman <jay@gnu.org>
Centralize all the uses of sigprocmask(). Don't restore an invalid
saved mask.
* src/sort.c (enter_cs, leave_cs): New functions for protecting
code sequences against signal delivery.
* (exit_cleanup): Use enter_cs and leave_cs instead of
calling sigprocmask directly.
(create_temp_file, pipe_fork, zaptemp): Likewise
2007-01-21 Dan Hipschman <dsh@linux.ucla.edu>
Add compression of temp files to sort.
* NEWS: Mention this.
* bootstrap.conf: Import findprog.
* configure.ac: Add AC_FUNC_FORK.
* doc/coreutils.texi: Document GNUSORT_COMPRESSOR environment
variable.
* src/sort.c (compress_program): New global, holds the name of the
external compression program.
(struct sortfile): New type used by mergepfs and friends instead
of filenames to hold PIDs of compressor processes.
(proctab): New global, holds compressor PIDs on which to wait.
(enum procstate, struct procnode): New types used by proctab.
(proctab_hasher, proctab_comparator): New functions for proctab.
(nprocs): New global, number of forked but unreaped children.
(reap, reap_some): New function, wait for/cleanup forked processes.
(register_proc, update_proc, wait_proc): New functions for adding,
modifying and removing proctab entries.
(create_temp_file): Change parameter type to pointer to file
descriptor, and return type to pointer to struct tempnode.
(dup2_or_die): New function used in create_temp and open_temp.
(pipe_fork): New function, creates a pipe and child process.
(create_temp): Creates a temp file and possibly a compression
program to which we filter output.
(open_temp): Opens a compressed temp file and creates a
decompression process through which to filter the input.
(mergefps): Change FILES parameter type to struct sortfile array
and update access accordingly. Use open_temp and reap_some.
(avoid_trashing_input, merge): Change FILES parameter like
mergefps and call create_temp instead of create_temp_file.
(sort): Call create_temp instead of create_temp_file.
Use reap_some.
(avoid_trashing_input, merge, sort, main): Adapt to mergefps.
Jim Meyering [Sat, 20 Jan 2007 20:58:31 +0000 (21:58 +0100)]
* tests/misc/pwd-long: Work properly even when run from the
wrong one of two or more bind-mounted sibling directories.
Suggestion from Mike Stone in <http://bugs.debian.org/380552>.
Paul Eggert [Sat, 20 Jan 2007 08:54:20 +0000 (09:54 +0100)]
Standardize on list of signals when an app catches signals.
* src/csplit.c (main): Also catch SIGALRM, SIGPIPE, SIGPOLL,
SIGPROF, SIGVTALRM, SIGXCPU, SIGXFSZ.
* src/ls.c (main): Likewise (except SIGPIPE was already caught).
Note that ls.c is special, as it also catches SIGTSTP.
* src/sort.c (main): Likewise. Also catch SIGQUIT. More details in
<http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/9510>.