Jim Meyering [Thu, 11 Sep 2008 16:14:00 +0000 (18:14 +0200)]
tweak wording and check to avoid failure
* doc/coreutils.texi (printf invocation): Tweak wording.
* doc/Makefile.am (check-texinfo): Allow "search path".
Jim Meyering [Wed, 10 Sep 2008 11:05:57 +0000 (13:05 +0200)]
doc: mention which commands may be built-in functions
* doc/coreutils.texi (mayConflictWithShellBuiltIn): New macro.
(mknod invocation, stat invocation, echo invocation)
(printf invocation, test invocation, pwd invocation)
(nice invocation, kill invocation, sleep invocation): Use it.
(printf invocation): Invoke via "env" rather than using a
literal /usr/local/bin/ prefix in examples.
Ralf Wildenhues [Tue, 9 Sep 2008 17:53:14 +0000 (19:53 +0200)]
simplify installation rules, using new Automake
This relies on development Automake to provide multi-file
installation, and avoids relying on undocumented Automake
interfaces. It also removes special-casing for `['.
* configure.ac (AM_INIT_AUTOMAKE): Depend on 1.10a.
(CROSS_COMPILING): New Automake conditional.
* src/Makefile.am (install-exec-am, filtered_PROGS)
(d_bindir, cu-install-binPROGRAMS): Remove.
(INSTALL_PROGRAM) [!CROSS_COMPILING]: Set to `./ginstall'.
Ralf Wildenhues [Tue, 9 Sep 2008 17:45:25 +0000 (19:45 +0200)]
fix minor shell issues in test suite
* tests/misc/help-version: Fix bad quoting.
* tests/cp/same-file: Fix unportable shell quoting.
* tests/mv/part-symlink: Likewise.
Jim Meyering [Mon, 8 Sep 2008 06:23:37 +0000 (08:23 +0200)]
tests: don't use "local" in bourne shell scripts
* tests/test-lib.sh (remove_tmp_, skip_if_mcstransd_is_running_):
Avoid failure on Solaris 11, since their /bin/sh passes the tests
in posix-shell.m4, yet does not support "local" (which is not POSIX).
Jim Meyering [Sun, 7 Sep 2008 08:31:27 +0000 (10:31 +0200)]
tests: use "Exit $fail", not (exit $fail); exit $fail
* tests/test-lib.sh (Exit): New function by Ralf Wildenhues in automake
http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=
20594c08f63
* tests/**: Convert all uses:
This restrictive change converted the vast majority:
git grep -l '^(exit \$fail); exit \$fail$' \
| xargs perl -pi -e 's/'^\(exit \$fail\); exit \$fail$/Exit \$fail/'
And this did the rest, plus a few undesirable ones, so I manually
backed out the changes to ChangeLog-* and build-aux/check.mk:
git grep -l -E '\(exit [^)]+\); exit ' \
| xargs perl -pi -e 's/\(exit (.+?)\); exit \1/Exit $1/'
Jim Meyering [Sun, 7 Sep 2008 09:54:43 +0000 (11:54 +0200)]
tests: move input-tty into a test-lib.sh function
* tests/test-lib.sh (require_controlling_input_terminal_): New function, from
* tests/input-tty: ...here. Remove file.
* tests/Makefile.am (EXTRA_DIST): Remove input-tty.
* tests/mv/i-3: Use the function, not the file.
* tests/misc/stty: Likewise.
* tests/misc/stty-row-col: Likewise.
* tests/misc/stty-invalid: Likewise.
Jim Meyering [Sun, 7 Sep 2008 18:50:49 +0000 (20:50 +0200)]
tests: work around Solaris 11 bug
* tests/misc/printf-surprise: Accept bogus prefix on stderr output.
Jim Meyering [Sun, 7 Sep 2008 18:49:34 +0000 (20:49 +0200)]
tests: don't let rounding-to-1KB blocks provoke a failure
* tests/df/total-awk: Use df's --block-size=512 option.
Jim Meyering [Sun, 7 Sep 2008 17:16:42 +0000 (19:16 +0200)]
tests: don't fail due to built-in sleep from Solaris 11's /bin/sh
* tests/misc/help-version (id_args): Invoke via env to ensure we
run the just-built version of sleep.
Kamil Dudka [Fri, 5 Sep 2008 11:12:06 +0000 (13:12 +0200)]
install: new option: --strip-program,
...to specify the program used to strip binaries
* src/install.c (main): Handle new option --strip-program.
(strip): Use strip program from global variable strip_program.
(usage): Mention new option --strip-program in --help.
* tests/tests/strip-program: Test case for new option --strip-program.
* tests/Makefile.am: Add new test case to test set.
* doc/coreutils.texi: Mention new option --strip-program.
* NEWS: Mention the change.
* TODO: Remove completed task.
Kamil Dudka [Wed, 3 Sep 2008 08:33:06 +0000 (10:33 +0200)]
df: new option: --total to print grand totals
* src/df.c (add_uint_with_neg_flag): New function to add two integral
values with separate negation flag.
(show_dev): New parameter force_fsu to display numbers directly. Collect
summary statistics on each printed device.
(usage): Mention new option --total in --help.
(main): Initialize summary on program start. Handle new option --total.
* tests/df/total: Dummy test case for new --total option.
* tests/df/total-awk: Better test case for new --total option (requires
awk).
* doc/coreutils.texi: Mention new parameter --total.
* NEWS: Mention the change.
* TODO: Removed completed task.
Jim Meyering [Wed, 3 Sep 2008 06:32:36 +0000 (08:32 +0200)]
TODO: add an item for a chmod optimization
Jerry Snitselaar [Sun, 31 Aug 2008 13:58:27 +0000 (15:58 +0200)]
env, groups: remove duplicate inclusion of <getopt.h>
* src/env.c: Remove redundant #include.
* src/groups.c: Likewise.
Tiny change.
Jim Meyering [Thu, 14 Aug 2008 19:17:27 +0000 (21:17 +0200)]
generate version.c and version.h
* src/Makefile.am (version.c, version.h): New rules. Generate.
(nodist_libver_a_SOURCES): Define
* .gitignore: Add src/version.c and src/version.h.
(DISTCLEANFILES): Add version.c and version.h.
Jim Meyering [Wed, 13 Aug 2008 20:30:14 +0000 (22:30 +0200)]
use new global, "Version", rather than macro, VERSION
With this change, a version-string update no longer
forces recompilation of 100+ src/*.o files.
* src/version.c (Version): New global. New file.
* src/version.h: Declare it.
* src/Makefile.am: Put it in a library that everyone links to.
(noinst_LIBRARIES, libver_a_SOURCES): Define.
(LDADD): Add libver.a.
(sc_tight_scope): Use perl (was sed), and a more relaxed regexp
to build the global-variable-name-recognizing regexp list.
* src/system.h: Include "version.h".
(case_GETOPT_VERSION_CHAR): Use Version rather than VERSION.
* src/basename.c (main): Use Version rather than VERSION.
* src/chroot.c (main): Likewise.
* src/cksum.c (main): Likewise.
* src/dd.c (main): Likewise.
* src/dirname.c (main): Likewise.
* src/echo.c (main): Likewise.
* src/hostid.c (main): Likewise.
* src/hostname.c (main): Likewise.
* src/link.c (main): Likewise.
* src/logname.c (main): Likewise.
* src/nice.c (main): Likewise.
* src/nohup.c (main): Likewise.
* src/printenv.c (main): Likewise.
* src/printf.c (main): Likewise.
* src/pwd.c (main): Likewise.
* src/setuidgid.c (main): Likewise.
* src/sleep.c (main): Likewise.
* src/sync.c (main): Likewise.
* src/test.c (main): Likewise.
* src/timeout.c (main): Likewise.
* src/true.c (main): Likewise.
* src/tsort.c (main): Likewise.
* src/unlink.c (main): Likewise.
* src/uptime.c (main): Likewise.
* src/users.c (main): Likewise.
* src/whoami.c (main): Likewise.
* src/yes.c (main): Likewise.
Jim Meyering [Tue, 26 Aug 2008 16:43:52 +0000 (18:43 +0200)]
bootstrap: preserve permissions of more copied files
* bootstrap (cp_mark_as_generated): Preserve perms of copied files.
Remove a kludge, now that this is fixed.
Bruno Haible [Sat, 23 Aug 2008 13:50:17 +0000 (15:50 +0200)]
doc: clarify wc -L documentation
* doc/coreutils.texi (wc invocation): Explain what the -L option
measures.
Eric Blake [Tue, 19 Aug 2008 15:58:34 +0000 (09:58 -0600)]
ls: adjust to gnulib change
* src/ls.c (includes): "strverscmp.h" no longer exists.
Eric Blake [Tue, 19 Aug 2008 16:00:38 +0000 (10:00 -0600)]
.gitignore: ignore more files
* .gitignore: Ignore directories created by gnulib.
Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake [Tue, 19 Aug 2008 06:55:51 +0000 (08:55 +0200)]
.gitattributes: generalize
* .gitattributes: Relax the glob pattern, so it matches *.texinfo, too.
Suggest a POSIX BRE, rather than one that uses the GNU extension, \\+.
Eric Blake [Tue, 19 Aug 2008 03:50:27 +0000 (21:50 -0600)]
sort: improve usage wording
* src/sort.c (usage): Mention that -k defaults to end of line if
POS2 omitted.
* THANKS: Update.
Reported by Tim Ryan.
Signed-off-by: Eric Blake <ebb9@byu.net>
Jim Meyering [Fri, 15 Aug 2008 07:48:43 +0000 (09:48 +0200)]
adjust
Bruce Korb [Thu, 14 Aug 2008 13:24:59 +0000 (06:24 -0700)]
sort: new option, --sort=version, for version number ordering
* src/sort.c [struct keyfield] (version): New member.
(usage): Describe --version-sort.
(sort_options): Add 'V'.
(long_options): Add "version-sort".
(CHECK_TABLE, _ct_, SORT_TABLE, _st_): Define new macros.
(check_args, sort_args, sort_types): Use these new macros in declarations.
(ARGMATCH_VERIFY): Remove use. No longer needed.
(compare_version): New function.
(key_compare): Add a case.
(check_ordering_compatibility): Handle new type.
(main): Likewise. Reformat two expressions for readability.
* tests/misc/sort-version: new test file
* tests/Makefile.am: add it to the list
* doc/coreutils.texi (sort invocation): Document it.
* NEWS: Mention the new feature.
Jim Meyering [Wed, 13 Aug 2008 08:40:58 +0000 (10:40 +0200)]
set envvars via "env" to avoid spurious set -x output from bad shells
* tests/dd/misc: Set LC_ALL=C via env.
* tests/cp/thru-dangling: Set POSIXLY_CORRECT via env.
This is necessary at least on AIX 5.3.
Reported by Jeph Cowan and Ralf Wildenhues. Details here:
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/14235/focus=14257
Jim Meyering [Wed, 13 Aug 2008 07:58:47 +0000 (09:58 +0200)]
"expr --bignum 1" now fails when expr is built without libgmp
* src/expr.c (main): When --bignum is requested, yet expr was built
without libgmp, exit nonzero (3) in addition to giving a diagnostic.
Jim Meyering [Wed, 13 Aug 2008 18:53:12 +0000 (20:53 +0200)]
mktemp, sort, tac: don't use undefined after mkstemp failure
When mkstemp fails, the template buffer may have undefined
contents, so we must not print it.
* src/sort.c (create_temp_file): Use temp_dir, not "file"
when diagnosing failed mkstemp, because "file" may be undefined.
* tests/misc/sort-merge: Adjust for new expected output.
Jeph Cowan and Ralf Wildenhues reported the test failure:
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/14235/focus=14257
* src/tac.c (copy_to_temp): Don't use template buffer after
failed mkstemp call, since its contents may be undefined.
* tests/misc/tac (pipe-bad-tmpdir): New test for the above.
* src/mktemp.c (main): Save a copy of the template string,
solely for use in case mkstemp fails.
* tests/misc/mktemp (pipe-bad-tmpdir): New test for the above.
Benno Schulenberg [Sun, 10 Aug 2008 18:04:40 +0000 (20:04 +0200)]
kill: micro grammar nit in description of SIGNAL
Benno Schulenberg [Sun, 10 Aug 2008 17:39:38 +0000 (19:39 +0200)]
groups: let synopsis show that the command allows multiple usernames
Also make the docstring say so.
Benno Schulenberg [Sat, 9 Aug 2008 20:44:16 +0000 (22:44 +0200)]
id: remove superfluous condition test; it is caught at -Z above
Benno Schulenberg [Sat, 9 Aug 2008 21:01:12 +0000 (23:01 +0200)]
id: gettextize a few missed tiny strings
Benno Schulenberg [Sat, 9 Aug 2008 13:43:32 +0000 (15:43 +0200)]
fmt: remove the 'no file' sentence; the standard phrase is given below
Replace the sentence with a more useful explanation of -DIGITS.
Benno Schulenberg [Fri, 8 Aug 2008 21:15:52 +0000 (23:15 +0200)]
echo: correct description of \c
* src/echo.c (usage): Correct description of \c.
* coreutils.texi (echo invocation): Likewise.
* src/echo.c: Remove --help-duplicating comment.
Benno Schulenberg [Sat, 9 Aug 2008 12:31:32 +0000 (14:31 +0200)]
doc: the quote operator for expr is '+', not 'quote'
Benno Schulenberg [Sat, 9 Aug 2008 12:52:54 +0000 (14:52 +0200)]
factor: remove duplicate docstring; use the more detailed one
Benno Schulenberg [Fri, 8 Aug 2008 20:58:51 +0000 (22:58 +0200)]
echo: gettextize the alternative option description too
Benno Schulenberg [Fri, 8 Aug 2008 11:33:20 +0000 (13:33 +0200)]
dd: clarify meaning of multiplication factors; put xM in order
Benno Schulenberg [Wed, 6 Aug 2008 22:37:27 +0000 (00:37 +0200)]
doc: remove stray word from date's field width description
Benno Schulenberg [Wed, 6 Aug 2008 22:01:16 +0000 (00:01 +0200)]
date: remove confusing and unneeded sentence from --help
It makes it unclear what 'sequences' refers to,
and the -u option already says enough.
Benno Schulenberg [Mon, 4 Aug 2008 20:57:07 +0000 (22:57 +0200)]
printenv: say what it does when variables are specified
Benno Schulenberg [Mon, 4 Aug 2008 21:21:35 +0000 (23:21 +0200)]
doc: put the exitstatus paragraph in a better place
* doc/coreutils.texi (tsort invocation): move two lines
Benno Schulenberg [Mon, 4 Aug 2008 20:40:48 +0000 (22:40 +0200)]
cp: move a newline to make second message identical to others
Benno Schulenberg [Mon, 4 Aug 2008 20:11:47 +0000 (22:11 +0200)]
who: Gettextize two forgotten strings
Jim Meyering [Sun, 10 Aug 2008 14:15:00 +0000 (16:15 +0200)]
sort: remove unnecessary declaration of strtod
* src/sort.c (STDC_HEADERS): Remove declaration of strtod.
Jim Meyering [Sun, 10 Aug 2008 14:13:14 +0000 (16:13 +0200)]
sort: avoid erroneous cast
* src/sort.c (OPEN_MAX): Define if not already defined.
(MAX_NMERGE): Remove definition.
(specify_nmerge): Don't cast MAX_NMERGE (of type size_t) to unsigned int.
Instead, use OPEN_MAX as the fall-back value.
Jim Meyering [Sun, 10 Aug 2008 08:51:03 +0000 (10:51 +0200)]
sort: don't print uninitialized in diagnostic
* src/sort.c (specify_nmerge): Do use uinttostr value.
Provoke with e.g., sort -m --batch-size=
18446744073709551617
Omit quotes around known-numeric value in diagnostic.
* tests/misc/sort-merge [nmerge-big]: Tighten ERR_SUBST regexp
to require a numeric value in that diagnostic, so this particular
failure cannot reappear.
Jim Meyering [Fri, 8 Aug 2008 10:47:34 +0000 (12:47 +0200)]
* .gitattributes: Better diff output for texinfo sources.
Jim Meyering [Thu, 7 Aug 2008 21:01:16 +0000 (23:01 +0200)]
dd.c: reduce duplication in new O_FULLBLOCK-defining code
* src/dd.c (MULTIPLE_BITS_SET): New macro, extracted from...
(multiple_bits_set): ...this function.
Use a single-line, and far simpler expression (no need to list all
O_* symbols again) to validate the derived O_FULLBLOCK value.
Jim Meyering [Fri, 8 Aug 2008 10:48:31 +0000 (12:48 +0200)]
* coreutils.texi (factor invocation, expr invocation): Adjust wording.
Jim Meyering [Fri, 8 Aug 2008 08:06:54 +0000 (10:06 +0200)]
expr: avoid compiler warnings
* src/expr.c (die): New "noreturn" function to wrap one-arg use of
error
(string_too_long): Use die rather than error.
(toint): Remove definition of now-unused function.
(eval6): Remove a little duplication.
Use die rather than error.
(dodivide): Remove declaration of now-unused variable.
Jim Meyering [Fri, 8 Aug 2008 08:02:34 +0000 (10:02 +0200)]
* tests/misc/expr: Add tests of the new GMP-based code.
James Youngman [Sat, 2 Aug 2008 20:49:46 +0000 (21:49 +0100)]
expr: support arbitrary-precision arithmetic
* src/Makefile.am (expr_LDADD): Link expr against GNU MP.
* doc/coreutils.texi (expr invocation): Describe --bignum,
--no-bignum. Explain the new arbitrary-precision functionality.
* NEWS: Indicate that arbitrary-precision arithmetic is now
supported in expr.
* src/expr.c (enum valtype): Added mp_integer, signifying a GNU MP
number.
(usage): Document the new options --bignum and --no-bignum which
force and prohibit the use of arbitrary-precision arithmetic,
respectively.
(long_options): data structure for getopt_long, which we need to
use to parse the options mentioned above.
(main): parse these options with getopt_long instead of
parse_long_options.
(valinfo): Downgrade the numeric member of the union from
intmax_t to signed long, since MP lacks functions for promoting an
intmax_t to an arbitrary-precision quantity.
(enum arithmetic_mode): Represents the current choice between
--bignum, --no-bignum and the default (automatically switch from
one to the other if needed).
(integer_overflow): issue a more explicit error message indicating
that MP is not available.
(string_too_long): new function, emits a fatal error message for
the case where an argument to the 'index' expression is too long
for a string offset to be represented.
(int_value): With --bignum, create the value as mp_integer rather
than plain integer.
(substr_value): factored out of eval6; implements "substr".
(freev): also destroy mp_integer values. Check that no mp_integer
values exist if --no-bignum was specified.
(printv, null, tostring): support mp_integer.
(toint): new funtion for converting from string or mp_integer to
integer.
(getsize): extracts a size_t value from a VALUE object; used to
implement substr.
(promote): promotes a value from integer to mp_integer.
(domult, dodivide): functions for multiplication and division,
factored out of eval4.
(doadd): addition/subraction function, factpred out of eval3.
(eval3): support mp_integer types; call doadd.
(eval4): support mp_integer types; call domult, dodivide.
(eval6): support mp_integer offsets and lengths for "substr" and
"index".
* TODO: Mention that expr supports arbitrary-precision arithmetic,
and suggest that this might also be a good idea for seq.
* AUTHORS (expr): Add James Youngman.
James Youngman [Tue, 5 Aug 2008 23:57:50 +0000 (00:57 +0100)]
doc: mv,cp: undocument the --reply option
* doc/coreutils.texi (mv invocation): Remove documentation for mv --reply.
(cp invocation): Likewise.
* NEWS: mention this.
James Youngman [Wed, 6 Aug 2008 00:16:14 +0000 (01:16 +0100)]
document the supported baud rates beyond 38400
* doc/coreutils.texi (Special): Document the supported baud rates
beyond 38400.
John David Anglin [Mon, 4 Aug 2008 12:04:44 +0000 (14:04 +0200)]
ls: ignore spurious getfilecon failure due to lack of SELinux support
* src/ls.c (gobble_file): Upon failed getfilecon, treat an errno value
of EOPNOTSUPP just like ENOTSUP. See <http://bugs.debian.org/488549>.
James Youngman [Mon, 4 Aug 2008 17:51:21 +0000 (18:51 +0100)]
Document uptime.
* doc/coreutils.texi (uptime invocation): document uptime.
* TODO: uptime is documented now.
* src/uptime.c (print_uptime): Use fprintftime to print the time, rather
than printf. This should make the situation better for translations.
Benno Schulenberg [Mon, 4 Aug 2008 08:44:47 +0000 (10:44 +0200)]
doc: correct and normalize --help output of several tools
* src/chroot.c (usage): Add "[ARG]" to synopsis.
* src/cut.c (usage): Remove an inconsistent period in an option
description.
* src/du.c (usage): Remove superfluous argument after short option -X.
Also remove inconsistent uppercase and final period.
Use a single indent level for prettiness.
* src/shred.c (usage): Normalize the synopsis.
* src/stty.c (usage): Options -F and --file are alternatives, cannot
both be used.
* src/sum.c (usage): -r does not overrule -s; the last one counts.
* src/uptime.c (usage): Remove inconsistent space from the synopsis.
* src/users.c: Likewise.
Jim Meyering [Mon, 4 Aug 2008 08:12:47 +0000 (10:12 +0200)]
false: mark "false" description for translation
* src/true.c (usage): Mark both strings with N_, so that
the one for "false" is also extracted for translation.
For consistency, mark both, although only the latter one needed it.
Inspired by a patch from Benno Schulenberg.
James Youngman [Sun, 3 Aug 2008 23:16:06 +0000 (00:16 +0100)]
factor: credit Torbjörn Granlund
* src/factor.c: Credit Torbjörn Granlund as the author of the
arbitrary-precision factorization code.
Jim Meyering [Sun, 3 Aug 2008 06:53:30 +0000 (08:53 +0200)]
doc: make it clear we're talking about the Linux kernel
* doc/coreutils.texi (mv invocation): tweak wording
Ralf Wildenhues [Sat, 2 Aug 2008 11:22:32 +0000 (13:22 +0200)]
tests: fix build-aux/check.mk for non-GNU make
* build-aux/check.mk ($(TEST_LOGS)) [!GNU_MAKE]: Check for
a $(TESTS) test in the build dir, before one in srcdir. For details,
see <http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/14198>.
Ralf Wildenhues [Sat, 2 Aug 2008 07:41:09 +0000 (09:41 +0200)]
* bootstrap: Fix unportable expr usage.
Kamil Dudka [Fri, 1 Aug 2008 17:33:45 +0000 (19:33 +0200)]
ls: --color now highlights files with capabilities, too
* src/ls.c: [HAVE_CAP] Include <sys/capability.h>.
(has_capability): New function for capability detection.
(print_color_indicator): Colorize file with capability.
* m4/jm-macro.m4: New configure option: --disable-libcap.
Check for libcap usability.
* src/Makefile.am (dir_LDADD, ls_LDADD, ...): Append $(LIB_CAP).
* src/dircolors.c: Update color lists.
* src/dircolors.hin: Mention new CAPABILITY color attribute.
* tests/ls/capability: Test for ls - colorize file with capability.
* tests/Makefile.am (root_tests): Add ls/capability.
* NEWS: Mention the change.
James Youngman [Thu, 31 Jul 2008 07:58:10 +0000 (09:58 +0200)]
factor arbitrarily large numbers
* m4/gmp.m4: New file; adds cu_GMP, which detects GNU MP.
* configure.ac: Use cu_GMP.
* src/Makefile.am: Link factor against libgmp if available.
* src/factor.c: Use GNU MP if it is available.
(emit_factor, emit_ul_factor, factor_using_division,
factor_using_pollard_rho, extract_factors_multi,
sort_and_print_factors, free_factors): new functions
for the arbitrary-precision implementation, taken from an example
in GNU MP.
(factor_wheel): Renamed; was called factor.
(print_factors_single): Renamed; was called print_factors.
(print_factors): New function, chooses between the single- and
arbitrary-precision algorithms according to availability of GNU MP
and the length of the number to be factored.
(usage, main): New options --bignum and --no-bignum.
* coreutils.texi (factor invocation): Document new command-line
options for the MP implementation and update the performance
numbers to take into account the asymptotically faster algorithm.
* TODO: Remove item about factoring large primes (it's done).
* m4/gmp.m4: Add support for --without-gmp.
* NEWS: Mention the new feature.
Kamil Dudka [Wed, 30 Jul 2008 12:31:50 +0000 (14:31 +0200)]
ls -U1 now uses constant memory
When printing one name per line and not sorting, ls now uses
constant memory per directory, no matter how many files are in
the directory.
* ls.c (print_dir): Print each file name immediately, when possible.
* NEWS: Mention the improvement.
Jim Meyering [Wed, 30 Jul 2008 12:29:52 +0000 (14:29 +0200)]
* timeout.c: Fix grammar in a comment. Normalize comment syntax.
Jim Meyering [Mon, 28 Jul 2008 09:48:22 +0000 (11:48 +0200)]
bootstrap: work also when there are no .po files in po/
* bootstrap (update_po_files): Complete the change that I began
in
7ba2dd808232cff3ee76aaceb97f4381c3c9cde4.
Jim Meyering [Sun, 27 Jul 2008 20:21:14 +0000 (22:21 +0200)]
* NEWS: Move shuf --zero-terminated item into bug-fixes section.
Mikael Magnusson [Sun, 27 Jul 2008 15:31:18 +0000 (17:31 +0200)]
shuf: correctly document --head-count
* src/shuf.c (usage): Correct --help output.
* doc/coreutils.texi: Correct option listing.
* NEWS: Mention correction.
Jim Meyering [Sun, 27 Jul 2008 13:14:37 +0000 (15:14 +0200)]
shuf: honor --zero-terminated option even with --input-range=LO-HI
* src/shuf.c (write_permuted_output): Add EOLBYTE parameter and use
it rather than hard-coding "\n".
(main): Adjust sole caller.
* tests/misc/shuf: Add a test to exercise this bug fix.
* NEWS: Mention it.
Jim Meyering [Wed, 23 Jul 2008 12:50:52 +0000 (14:50 +0200)]
dd: minor fullblock changes
* src/dd.c (O_FULLBLOCK): Define using an enum, not #define.
Derive the value, rather than hard-coding to one that might conflict.
(usage): Mention iflag=fullblock in --help output.
(scanargs): Reset the O_FULLBLOCK bit, so that we don't try to set
an undefined attribute via fcntl (fd, F_SETFL, ...
* tests/dd/misc: Signal framework_failure when necessary.
Use "compare actual expected", so any diffs look "right".
* NEWS (dd): Alphabetize and reword.
* coreutils.texi (dd invocation): Adjust wording.
Kamil Dudka [Wed, 23 Jul 2008 09:29:21 +0000 (11:29 +0200)]
dd: new option: iflag=fullblock to accumulate full input blocks
* src/dd.c (iread_fullblock): New function for reading full blocks.
(scanargs): Check for new parameter iflag=fullblock.
(skip): Use iread_fnc pointer instead of iread function.
(dd_copy): Use iread_fnc pointer instead of iread function.
* tests/dd/misc: Add test for dd - read full blocks.
* doc/coretuils.texi: Mention new parameter iflag=fullblock.
* NEWS: Mentioned the change.
Jim Meyering [Wed, 23 Jul 2008 13:50:40 +0000 (15:50 +0200)]
dd: adjust --help output so help2man formats the man page properly
* src/dd.c (usage): Use two spaces (not one) to separate
"directory" from its description, so help2man formats
the derived man page properly.
Reuben Thomas [Tue, 22 Jul 2008 22:25:04 +0000 (23:25 +0100)]
doc: add example .bashrc code for a ~/.dircolors file
* coreutils.texi: Add tip for .bashrc use from Jim Meyering.
Jim Meyering [Tue, 22 Jul 2008 09:23:08 +0000 (11:23 +0200)]
tests: do not run chmod on a prefix of space-embedded tmpdir
* TESTS/test-lib.sh (remove_tmp_): New function.
(trap 0): Use it instead of open-coded (and misquoted) version.
Jim Meyering [Tue, 22 Jul 2008 07:20:52 +0000 (09:20 +0200)]
tests: ensure "make check" w/tainted build dir no longer impacts $HOME
* maint.mk (taint-distcheck): New rule.
(maintainer-distcheck): Make it.
Ralf Wildenhues [Tue, 22 Jul 2008 05:38:31 +0000 (07:38 +0200)]
tests: again, do not change the mode of all directories below $HOME
* tests/CuTmpdir.pm (chmod_tree): Do not run chmod on undefined
argument, can happen when the build path contains spaces.
Jim Meyering [Sat, 19 Jul 2008 13:42:49 +0000 (15:42 +0200)]
* THANKS: Update, now that I have a name for jemm4jemm.
Andreas Schwab [Fri, 18 Jul 2008 15:37:41 +0000 (17:37 +0200)]
mknod: correct misplaced -Z description in --help output
* src/mknod.c (usage): Put it after the "Mandatory arguments..." line.
Jim Meyering [Wed, 16 Jul 2008 11:01:03 +0000 (13:01 +0200)]
dircolors.hin: add Ogg/Theora-related extensions
* dircolors.hin: Add extensions from
http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions
Suggestion from jemm4jemm@yahoo.com.
Jim Meyering [Wed, 16 Jul 2008 10:25:00 +0000 (12:25 +0200)]
* HACKING: describe how to find a misplaced change-set
Jim Meyering [Tue, 15 Jul 2008 06:30:38 +0000 (08:30 +0200)]
fix two bugs in ptx
* src/ptx.c (fix_output_parameters): Don't let before_max_width
go negative -- that would cause an infloop in define_all_fields.
(main): Don't clobber name[0] with lists of two or more input files.
* tests/misc/ptx: New file. Test for the above.
* tests/Makefile.am (TESTS): Add misc/ptx.
Pádraig Brady [Thu, 10 Jul 2008 08:36:49 +0000 (09:36 +0100)]
tests: expand: test for lines starting with both spaces and tabs
The expand released in current distributions (Fedora Core 4 - Fedora 9
at least), doesn't expand --initial tabs if spaces are present.
tests/misc/expand: Add test to verify --initial works correctly
with lines starting with both spaces and tabs.
Jim Meyering [Thu, 10 Jul 2008 06:41:28 +0000 (08:41 +0200)]
make check: accommodate stricter POSIX-conforming shells
Without this, test-related variable settings were not exported to
the shell_or_perl_ function when using dash or Solaris 11's /bin/sh.
* tests/check.mk (TESTS_ENVIRONMENT): Use an explicit "export",
so as not to rely on non-POSIX behavior of some /bin/sh (e.g.,
bash-based ones).
Jim Meyering [Sun, 6 Jul 2008 21:15:23 +0000 (23:15 +0200)]
* bootstrap: Remove $bt and $bt2 also when not using gettext.
Jim Meyering [Fri, 4 Jul 2008 14:34:39 +0000 (16:34 +0200)]
who -r: don't print "last=" when the corresponding byte is unprintable
* src/who.c (print_runlevel): Print last=%c only when the "preceding
run-level" byte is printable. Reported by Gian Piero De Lolliis in
<http://bugzilla.redhat.com/453249>.
Ondřej Vašík [Wed, 2 Jul 2008 12:11:05 +0000 (14:11 +0200)]
doc: describe who's -p, -r, and -t options
* doc/coreutils.texi (who invocation):
Jim Meyering [Fri, 4 Jul 2008 07:41:57 +0000 (09:41 +0200)]
install with just-built ./ginstall only when not cross-compiling
* src/Makefile.am (install-exec-am): ...otherwise, use the default
value, $(INSTALL_PROGRAM). Reported by Brian Silverman.
Jim Meyering [Tue, 1 Jul 2008 14:19:46 +0000 (16:19 +0200)]
* README-hacking: Update the section on LZMA.
Pádraig Brady [Sun, 29 Jun 2008 00:55:03 +0000 (01:55 +0100)]
truncate: ignore whitespace in --size parameters
Without this, `truncate -s '> -1' F` would truncate F to length 0,
and `truncate -s " +1" F` would truncate F to 1 byte. Now, each
elicits a diagnostic.
* src/truncate.c: Skip leading white space in the --size option
argument and any white space after one of the relative modifiers,
so that the presence of a +/- modifier can be detected reliably.
* tests/misc/truncate-parameters: Add tests for the above.
Jim Meyering [Sat, 28 Jun 2008 07:53:03 +0000 (09:53 +0200)]
doc: add "..." to Usage, to indicate there may be multiple OPTIONs
* src/base64.c (usage): Likewise.
* src/cat.c (usage): Likewise.
* src/md5sum.c (usage): Likewise.
* src/mkdir.c (usage): Likewise.
* src/mkfifo.c (usage): Likewise.
* src/split.c (usage): Likewise.
* src/stat.c (usage): Likewise.
Heiko Marr reported the problem with mkdir.
Jim Meyering [Sat, 28 Jun 2008 07:48:11 +0000 (09:48 +0200)]
mkfifo: correct misplaced -Z description in --help output
* src/mkfifo.c (usage): Put it *after* the "Mandatory arguments..." line.
Jim Meyering [Fri, 27 Jun 2008 16:52:56 +0000 (18:52 +0200)]
uniq: remove redundant test
* src/uniq.c (find_field): Remove redundant test in outer loop-
termination expression. Also, add a "const" attribute.
Pádraig Brady [Thu, 26 Jun 2008 22:09:28 +0000 (23:09 +0100)]
timeout: fix invalid argument tests
* tests/misc/timeout-parameters: Remove test for invalid
signal number (we don't know what signal numbers are
invalid on all systems). Also tweak the other invalid
signal check so that the rest of the arguments are correct.
Jim Meyering [Fri, 27 Jun 2008 14:34:00 +0000 (16:34 +0200)]
avoid a -Wsign-compare warning
* src/tee.c (tee_files): Swap fwrite's size/n_elem args and
compare the return value against "1".
Jim Meyering [Fri, 27 Jun 2008 14:26:05 +0000 (16:26 +0200)]
base64: don't rely on feof returning 0/1
* src/base64.c (do_decode): feof is specified to return nonzero,
not 0/1, so use "k < 1 + !!feof(in)" as the loop termination test.
Pádraig Brady [Fri, 27 Jun 2008 07:38:42 +0000 (08:38 +0100)]
truncate: silence -Wsign-compare warnings
* src/truncate.c: Cast signed to unsigned to
confirm intent which will silence -Wsign-compare warnings
Jim Meyering [Fri, 27 Jun 2008 08:54:23 +0000 (10:54 +0200)]
factor out time_t-to-string conversion idiom
* src/system.h: Include "inttostr.h".
(timetostr): New function, factored out of...
* src/date.c (show_date): Use timetostr.
* src/du.c (show_date): Likewise.
* src/ls.c (print_long_format): Likewise.
* src/pinky.c (time_string): Likewise.
* src/stat.c (human_time): Likewise.
* src/*.c: Don't include inttostr.h, since system.h does.
* src/c99-to-c89.diff: Adjust offsets.
Pádraig Brady [Thu, 26 Jun 2008 10:10:13 +0000 (11:10 +0100)]
truncate: Fix integer portability issues
* src/truncate.c: Explicitly convert from off_t to intmax_t
when printing numbers as they may be different types.
Also don't mix size_t and off_t types in operations as
the latter will be promoted to unsigned when these types
are the same size.
Jim Meyering [Thu, 26 Jun 2008 21:04:57 +0000 (23:04 +0200)]
tests: adjust c99-to-c89 patch as well as the code to generate it
* maint.mk (patch-check) [REGEN_PATCH]: Trim some trailing blanks.
* src/c99-to-c89.diff: Adjust shred.c offsets.