summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2009-07-03sort: allow SI and IEC units on separate human sort fieldsPádraig Brady
* src/sort.c: Store the si_present state per key rather than globally * tests/misc/sort: Add a check that would have previously failed. Also add a test to demonstrate that invalid IEC/SI mixtures are not always noticed when they're not significant to the sort.
2009-07-03tail: avoid an inotify portability problem in kernels prior to 2.6.21Giuseppe Scrivano
* src/tail.c (tail_forever_inotify): Handle the special case in which an old inotify watcher returns 0. Affects kernels in [2.6.13, 2.6.21).
2009-06-29tail: add comments noting potential inotify-related problemsJim Meyering
* src/tail.c (tail_forever_inotify): Add two FIXME comments.
2009-06-27stdbuf: fix to stop -i option causing an assertionPádraig Brady
* src/stdbuf.c (main): Fix the array bounds check in the assert * tests/misc/stdbuf: Add a test for all standard streams
2009-06-23maint: update all Copyright year lists to include 2009Jim Meyering
2009-06-17stdbuf: A new program to run a command with modified stdio bufferingPádraig Brady
* AUTHORS: Register as the author. * NEWS: Mention this change. * README: Add stdbuf command to list. * configure.ac: Only enable on ELF systems with GCC. * cfg.mk (sc_system_h_headers): Use VC_LIST_EXCEPT rather than VC_LIST, so we can add an exception, if needed. * .x-sc_system_h_headers: New file. Exempt libstdbuf.c. * Makefile.am (syntax_check_exceptions): Add .x-sc_system_h_headers. * doc/coreutils.texi (stdbuf invocation): Add stdbuf info. * man/.gitignore: Ignore generated manpage. * src/.gitignore: Ignore stdbuf and libstdbuf.so binaries. * man/Makefile.am (stdbuf.1): Add dependency. * man/stdbuf.x: New file with example usage. * po/POTFILES.in: Reference new command and shared library sources. * src/Makefile.am (build_if_possible__progs): Add stdbuf and libstdbuf, (pkglib_PROGRAMS): Reference optional shared lib, (libstdbuf_so_LDADD): Ensure we don't link with non PIC libcoreutils.a. (libstdbuf_so_LDFLAGS): Add -shared GCC option, (libstdbuf_so_CFLAGS): Add -fPIC GCC option. (check-README): Exclude libstbuf. (check-AUTHORS): ditto. (sc_tight_scope): Exclude functions starting with __. * src/libstdbuf.c: The LD_PRELOAD shared library to control buffering. * src/stdbuf.c: New file to setup env variables before execing command. * tests/Makefile.am: Reference new test file. * tests/misc/help-version: Set expected exit codes. * tests/misc/invalid-opt: ditto. * tests/misc/stdbuf: Add 9 tests.
2009-06-15tail: use inotify if it is availableGiuseppe Scrivano
* NEWS: Document the new feature. * m4/jm-macros.m4: Check if inotify is present. * src/tail.c (tail_forever_inotify): New function. (main): Use the inotify-based function, if possible. * tests/Makefile.am: Add new tests for tail. * tests/test-lib.sh (require_proc_pid_status_, get_process_status_): New functions. * tests/tail-2/pid: New file. * tests/tail-2/wait: New file. * tests/tail-2/tail-n0f: Refactor code into the test-lib.sh require_proc_pid_status_ function.
2009-06-13diag: say "failed to...", rather than "cannot..." in a few diagnosticsJim Meyering
* src/chroot.c (main): ...it's more precise. * src/nohup.c (main): Likewise. * src/setuidgid.c (main): Likewise. * src/timeout.c (main): Likewise.
2009-06-13sort: Ignore fields where end position is before the start positionCliff Miller
* NEWS: Mention the fix * THANKS: Add Cliff Miller * src/sort.c (keycompare): Ensure lima >= texta * tests/misc/sort: Add 3 corresponding tests Signed-off-by: Pádraig Brady <P@draigBrady.com>
2009-06-11ls --color: do not colorize files with multiple hard links by defaultKamil Dudka
* src/ls.c: Rename hl->mh, do not colorize files with multiple hard links by default. * src/dircolors.c: Rename HARDLINK -> MULTIHARDLINK, hl -> mh. * src/dircolors.hin: Do not colorize files with multiple hard links by default. * tests/Makefile.am: Rename the test case accordingly. * tests/ls/multihardlink: Additionally test ls' default behavior and factor out some duplication. * NEWS: Mention the change in behavior.
2009-06-07sort: die immediately upon heap allocation failureJim Meyering
* src/sort.c (register_proc): Handle hash_insert failure.
2009-06-04dircolors: add screen-256color-bce to TERM listMike Frysinger
* src/dircolors.hin: Add screen-256color-bce.
2009-06-03dircolors: recognize .xz, .txz, .tbz and .tlz suffixesJim Meyering
* src/dircolors.hin: Add .xz, .txz, .tbz and .tlz.
2009-06-02chroot: make --groups= work without --userspec=; be more robustJim Meyering
* src/chroot.c (set_additional_groups): Add comments. Given an empty or all-comma group list, diagnose it and return nonzero. When more than one group is invalid, diagnose all of them, not just the first. (main): Honor --groups= also when --userspec= is not specified. Now that set_additional_groups consistently diagnoses its failures, don't diagnose it separately here. * tests/chroot/credentials: Do not invoke with an empty group list.
2009-06-02chroot: don't set bogus user-ID or group-ID for --u=U: or --u=:GJim Meyering
* src/chroot.c (main): Initialize both "uid" and "gid". To -1. This also allows one to set the user-ID or primary group-ID to 0, in case it's not that already. * tests/chroot/credentials: Test for the above.
2009-06-02chroot: set-*-ID failure must provoke nonzero exit before execvpJim Meyering
* src/chroot.c (main): Exit upon set-group-ID or set-user-ID failure.
2009-05-29head, tail: make --help less ambiguousEric Blake
* src/head.c (usage): Use -n K, not -n N, to avoid confusion. * src/tail.c (usage): Likewise. * doc/coreutils.texi (head invocation, tail invocation): Likewise. Reported by Christophe Lyon.
2009-05-26sort: new --human-numeric-sort option to sort KiB MB etc.Michael Speer
* NEWS: Document the new option * doc/coreutils.texi (sort invocation): ditto * src/sort.c (main): handle the new --human-numeric-sort option (-h). (human_numcompare): A new function to compare SI and IEC suffixes before falling back to the standard --numeric comparison. (find_unit_order): A new helper function to find the order of magnitude of a number string as determined by its suffix. (check_mixed_SI_IEC): A new helper function to exit with error if both SI and IEC suffixes are presented. * tests/misc/sort: Add 8 tests to test the new functionality. * THANKS: Update
2009-05-26chroot: accept new options --userspec=U:G and --groups=G1,G2,G3Giuseppe Scrivano
* NEWS: Note chroot's new options. * doc/coreutils.texi: Document them. * src/chroot.c (main): Add support for --userspec and --groups. * tests/Makefile.am (root-tests): Add chroot/credentials. * tests/chroot/credentials: New file. * tests/test-lib.sh: Define NON_ROOT_GROUP to a default value.
2009-05-18doc: clarify the operation of the comm -123 parametersPádraig Brady
* src/comm.c (usage): give more information on the -123 parameters, with examples to show that they can be combined. Addresses <http://savannah.gnu.org/bugs/?24974>. * doc/coreutils.texi (comm invocation): Mention that the column separators are suppressed along with the column. Suggestion from Dan Jacobson. * man/comm.x: Reference other commands that match adjacent lines. * man/join.x: ditto. * man/uniq.x: ditto.
2009-05-17maint: use ARRAY_CARDINALITY moreJim Meyering
* src/sort.c (main): Use ARRAY_CARDINALITY, rather than open-coding it. * src/factor.c (WHEEL_END): Likewise. * src/csplit.c (main): Likewise. * src/od.c: Likewise, * src/ls.c (main): Likewise. (N_ENTRIES): Remove definition. Use ARRAY_CARDINALITY instead. * src/dircolors.c: Likewise. (array_len): Remove definition.
2009-05-17build: tr: avoid a warning due to newer gcc's -Wenum-compareJim Meyering
* src/tr.c (N_CHAR_CLASSES): Remove anonymous enum definition. (look_up_char_class): Use ARRAY_CARDINALITY, rather than N_CHAR_CLASSES.
2009-05-17maint: define ARRAY_CARDINALITY in system.hJim Meyering
* src/system.h (ARRAY_CARDINALITY): Define if not already defined.
2009-05-11truncate: fix bug in use of isspaceEric Blake
* src/truncate.c (main): Pass unsigned characters to isspace. * NEWS: Mention this.
2009-05-05doc: note the use of LC_COLLATE in comm, join and uniqPádraig Brady
* doc/coreutils.texi (uniq invocation): Simplify the text to remove the inconsequential mentioning of order, while implying that LC_COLLATE can alter equality comparisons. * src/comm.c (usage): Mention LC_COLLATE is significant. * src/join.c (usage): Ditto. * src/uniq.c (usage): Ditto. Also improve the summary. Suggestion from Andries Brouwer
2009-05-05tests: fix typo in check-AUTHORS ruleAndreas Schwab
* src/Makefile.am (check-AUTHORS): Set locale.
2009-05-03mv, rm: adapt to new and improved gnulib interfacesDavid Bartley
Use gnulib's new priv-set module and updated write-any-file. With them, the remove-called can_write_any_file function no longer tries to drop the unlink-directory privilege, so now each caller of remove must do that separately, calling priv_set_remove_linkdir. * bootstrap.conf (gnulib_modules): Add priv-set. * src/rm.c: Include "priv-set.h". (main): Call priv_set_remove_linkdir. * src/mv.c (main): Likewise. * gnulib: Update submodule to latest.
2009-05-03tests: correct the "make check"-run check-AUTHORS testJim Meyering
* src/Makefile.am (check-AUTHORS): Revert back to using en_US.UTF-8, to ease parsing (English-only) text around the list of names, even when .po files are not installed. Reported by Andreas Schwab. Along the way, use $(AM_V_GEN), not "@". (sc_tight_scope): Use $(AM_V_GEN) here, too. * gnulib: Update submodule to latest, for the proper_name_utf8 fix that makes --version output print the UTF-8 rendering of author names in more cases.
2009-04-28df: adjust comment to match recent code changeJim Meyering
* src/df.c (main): Update comment to match.
2009-04-28df: use open(2), not stat, to trigger automountingTomas Smetana
* src/df.c (main): When iterating over command-line arguments, attempting to ensure each backing file system is mounted, use open, not stat. stat is no longer sufficient to trigger automounting, in some cases. Based on a suggestion from Ian Kent. More details in http://bugzilla.redhat.com/497830
2009-04-27copy.c: factor out test for errno value indicating "unsupported"Jim Meyering
* src/copy.c (errno_unsupported): New function. (copy_attr_error, copy_internal): Use it.
2009-04-27cp -a: diagnose failure when preserving xattr/context requiredOndřej Vašík
* src/copy.c (copy_attr_by_fs): Always print diagnostics when preserving xattrs is required. (copy_attr_by_name): Likewise. (copy_reg): Always print diagnostics when preserving SELinux context is required. (copy_internal): Likewise. Also, do not ignore ENOTSUP and ENODATA errors when preserving SELinux context is required. * NEWS (Bug fixes): Mention it.
2009-04-27mv: ignore xattr-preservation failure when not supported by filesystemOndřej Vašík
*src/copy.c: Do not warn about xattr-preservation failure when xattrs are not supported and preservation of xattrs is not explicitly required. Reported by Eric Sandeen in http://bugzilla.redhat.com/496142
2009-04-25build: adjust use of automake's new $(AM_V_GEN) variableJim Meyering
* src/Makefile.am (dircolors.h, wheel-size.h, wheel.h, fs.h): (version.c, version.h): Use $(AM_V_GEN) only as a prefix of an existing command. Otherwise, it provokes warnings from some "make" programs. Suggestion from Ralf Wildenhues.
2009-04-25tests: fix check-AUTHORS skip logicRalf Wildenhues
* src/Makefile.am (check-AUTHORS): When this test is skipped, be sure to avoid all commands in the recipe, not just those passed to the first shell.
2009-04-24build: use automake's new $(AM_V_GEN) and $(AM_V_at) variablesJim Meyering
* src/Makefile.am (dircolors.h, wheel-size.h, wheel.h, fs.h): (version.c, version.h): Mark with $(AM_V_GEN) and $(AM_V_at), so that the latest automake prints "GEN $@" by default.
2009-04-23sort -m: don't segfault when output file is also an input fileJim Meyering
* src/sort.c (avoid_trashing_input): Fix an off-by-one error and guard the use of memmove. * NEWS (Bug fixes): Mention it. * tests/misc/sort: Add tests to exercise the offending code. * THANKS: Update. Reported by Otavio Salvador in http://bugs.debian.org/525048.
2009-04-23tests: make the check-AUTHORS test more portable, now that it's...Jim Meyering
run as part of "make check". * src/Makefile.am (check-AUTHORS): Don't depend on en_US.UTF-8. Instead, use the French UTF8 locale, if configure found one. If not found, just skip the test.
2009-04-23avoid parallel "make distcheck" failure due to two run-in-src/ rulesJim Meyering
Move the check-AUTHORS rule from "syntax-check" to "check". * maint.mk (local-checks-available): Remove check-AUTHORS. (check-AUTHORS): Remove rule. * src/Makefile.am (CLEANFILES): Add $(no_install__progs), since they too are built sometimes. (check-AUTHORS): Split a longer-than-80 sed command. (../AUTHORS): Remove obsolete rule.
2009-04-22cp: work around linux kernel bug: short-read != EOF on /procJim Meyering
Remove the optimization that avoided up to 50% of cp's read syscalls. Do not assume that a short read on a regular file indicates EOF. When reading from a file in /proc on linux [at least 2.6.9 - 2.6.29] into a 4k-byte buffer or larger, a short read does not always indicate EOF. For example, "cp /proc/slabinfo /tmp" copies only 4068 of the total 7493 bytes. This optimization (25719a33154f0c62ea9881f0c79ae312dd4cec7a, Improve performance a bit by optimizing away; 2005-11-24) appears to have been worth less than a 2% speed-up (and usually much less), so the impact of removing it is negligible. * src/copy.c (copy_reg): Don't exit the loop early. * tests/cp/proc-short-read: New test, lightly based on a suggestion from Mike Frysinger, to exercise this fix. * tests/Makefile.am (TESTS): Add cp/proc-short-read. * NEWS (Improve robustness): Mention this change.
2009-04-19fix comment typosRalf Wildenhues
* bootstrap: Fix comment typos. * src/pr.c: Likewise.
2009-04-10build: tight-scope test: don't build excluded programsJim Meyering
* src/Makefile.am (sc_tight_scope): Depend on $(bin_PROGRAMS), not $(all_programs)
2009-04-07maint: avoid "make syntax-check" failureJim Meyering
* src/install.c (main): Tweak syntax of new diagnostic.
2009-04-07install: deprecate the --preserve_context optionPádraig Brady
src/install.c: Print a warning when --preserve_context rather than --preserve-context is used as per FIXME.
2009-04-07shred,sort,shuf: don't use /dev/urandom by defaultPádraig Brady
Suggestion from Steven Schveighoffer at: http://savannah.gnu.org/patch/?6797 to greatly speed up the random passes done by shred. * gl/lib/randread.c: Default to using the internal pseudorandom generator, rather than reading /dev/urandom * src/shred.c (usage): remove mention of /dev/urandom * src/shuf.c (usage); ditto * src/sort.c (usage): ditto * doc/coreutils.text: Document the new behaviour for aquiring random data.
2009-04-07maint: Clarify ambiguous refs to Linux kernels or GNU/Linux systemsPádraig Brady
* README-prereq: s_linux_GNU/Linux_ or s_linux_Linux kernel_ * README-valgrind: ditto * src/chown-core.c: ditto * src/dd.c: ditto * src/df.c: ditto * src/ls.c: ditto * src/mv.c: ditto * src/pwd.c: ditto * src/remove.c: ditto * src/shred.c: ditto * src/stat.c: ditto * src/su.c: ditto * src/system.h: ditto * src/timeout.c: ditto * src/truncate.c: ditto
2009-04-03ls: fix alignment when month names have varying widthsPádraig Brady
Reported by Samuel Thibault and Stéphane Raimbault, as the glibc fr_FR locale has recently changed to use the official but variable width abbreviated month names. Other glibc locales also have variable widths. http://sourceware.org/ml/libc-locales/2008-q1/msg00035.html http://sourceware.org/bugzilla/show_bug.cgi?id=9859 * NEWS: Mention the fix * gl/lib/mbsalign.c: A new module to align and truncate a string in a specified number of screen cells, while handling multi-byte characters appropriately. * gl/lib/mbsalign.h: Ditto * gl/modules/mbsalign: Ditto * bootstrap.conf: Reference the new module * src/ls.c (abmon_init): New function, precompute the abbreviated months aligned left in a minimum width column <= 5 screen cells. (align_nstrftime): New function, replace the first %b in the format specification to strftime with the precomputed month string. Note using the cached month strings speeds up `ls -lU` by around 17% on glibc-2.7-2 on linux at least. Also if we implement this function using heap storage rather than automatic storage, and use snprintf instead of strcpy, ls will slow down by 2% and 1% respectively (i.e. a net gain of 14% rather than 17%). * tests/ls/abmon-align: A new test to test ls alignment for various formats and locales * tests/Makefile.am: Reference the new test
2009-04-02doc: Clarify the help for version sorting in ls and sortPádraig Brady
* src/ls.c: Update the -v help description * src/sort.c: Update the -V help description
2009-03-27tests: fix 'make sc_tight_scope' on cygwinEric Blake
* src/Makefile.am (sc_tight_scope): Ignore leading underscores in symbols.
2009-03-26df: port the known-value fix to AIX as wellPaul Eggert
* src/df.c (known_value): New function, which also works on AIX /proc file systems. (df_readable, show_dev): Use it instead of hardcoding comparison to UINTMAX_MAX. Suggested by Jim Meyering and Matthew Woehlke.