summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2013-04-14dd: avoid buffer allocations unless neededOndrej Oprala
* src/dd.c: Add new static global variable ibuf. (alloc_ibuf, alloc_obuf): New functions factored from dd_copy(). (dd_copy): Call the new functions to allocate memory for ibuf and obuf when necessary. (skip): Likewise. * tests/dd/no-allocate.sh: New test. * tests/local.mk: Reference the test.
2013-04-10csplit: add the --suppress-matched optionAssaf Gordon
With --suppress-matched, the lines that match the pattern will not be printed in the output files. I.E. the first line from the second and subsequent splits will be suppressed. * src/csplit.c: process_regexp(),process_line_count(): Don't output the matched lines. Since csplit includes "up to but not including" matched lines in each split, the first line (in the next group) is the matched line - so just skip it. main(): Handle new option. usage(): Mention new option. * doc/coreutils.texi (csplit invocation): Mention new option, examples. * tests/misc/csplit-suppress-matched.pl: New test script. * tests/local.mk: Reference the new test. * NEWS: Mention new feature.
2013-04-07build: fix man page build failure with some permissions setupsEnrico Scholz
Use the more portable 'chmod a-w', instead of the 'chmod -w' form. The latter is not always supported. Also its operation is dependent on umask controlling the permissions bits for new files, which is not the case in the presence of POSIX default ACLs for e.g. In that case, chmod may print a warning like the following, and exit with failure status: chmod: man/hostid.1-t: new permissions are r--rw-r--, not r--r--r-- * man/local.mk: s/-w/a-w/
2013-04-04tests: avoid shared lib tests on unsupported platformsPádraig Brady
* init.cfg (require_gcc_shared_): A new function to check that we can build shared libraries in the particular manner we use in our tests. * tests/cp/nfs-removal-race.sh: Use require_gcc_shared_. Then fail rather than skip, if the actual shared lib build fails. * tests/df/no-mtab-status.sh: Likewise. * tests/df/skip-duplicates.sh: Likewise. * tests/ls/getxattr-speedup.sh: Likewise. Reported in http://bugs.gnu.org/14024
2013-04-04tail: exit without reading input if would never outputPádraig Brady
* src/tail.c (main): If -n0 or -c0 were specified without -f, then no data would ever be output, so exit without reading input. * tests/tail-2/tail-n0f.sh: Augment the related test with this case.
2013-04-04shuf: exit without reading if would never outputPádraig Brady
* src/shuf.c (main): If -n0 specified then no data would ever be output, so exit without reading input. * tests/misc/shuf.sh: Augment the related test with this case.
2013-04-04doc: add details on ln --relative symlink resolutionPádraig Brady
* doc/coreutils.texi (ln invocation): Describe how symlinks are resolved with --relative, and give an example showing the greater control available through realpath(1). * tests/ln/relative.sh: Add a test to demonstrate full symlink resolution, in a case where it might not be wanted.
2013-04-04ln: --relative: fix updating of existing symlinksRémy Lefevre
Don't dereference an existing symlink being replaced. I.E. generate the symlink relative to the symlink's containing dir, rather than to some arbitrary place it points to. * src/ln.c (convert_abs_rel): Don't consider the final component of the symlink name when canonicalizing, as we want to avoid dereferencing the final component. * tests/ln/relative.sh: Add a test case. * NEWS: Mention the fix. Resolves http://bugs.gnu.org/14116
2013-03-25shuf: use reservoir-sampling for large or unknown sized inputsAssaf Gordon
Reservoir sampling optimizes selecting K random lines from large or unknown-sized input: http://en.wikipedia.org/wiki/Reservoir_sampling Note this also avoids reading any input when -n0 is specified. * src/shuf.c (main): Use reservoir-sampling when the number of output lines is known, and the input size is large or unknown. (input_size): A new function to get the input size for regular files. (read_input_reservoir_sampling): New function to read lines from input, keeping only K lines in memory, replacing lines with decreasing prob. (write_permuted_output_reservoir): New function to output reservoir. * tests/misc/shuf-reservoir.sh: An expensive_ test using valgrind to exercise the reservoir-sampling code. * tests/local.mk: Reference new test. * NEWS: Mention the improvement.
2013-03-24stat,tail: improve support for efivarfs, exofs, f2fs and ubifsPádraig Brady
* src/stat.c (human_fstype): Add new file system ID definitions. * NEWS: Mention the improvement. Fixes http://bugs.gnu.org/14020
2013-03-24maint: improve make src/fs-magic-comparePádraig Brady
* README-release: fix the `make` command, and mention how to get the latest results without requring running a system with the latest kernel. * src/local.mk (src/fs-latest-magic.h): A new target to document how/where to place the latest magic header. (src/fs-kernel-magic): Adjust to include separately downloaded header if available. (src/fs-magic): Undefine MANPAGER as it may impact the ability to pipe the output of man(1). (fs-magic-compare): Don't echo the commands run as they're distracting from the output which needs to be examined.
2013-03-24build: fix issues when building with GMPPádraig Brady
* m4/gmp.m4 (cu_GMP): Add an extra check that gmp.h is available which is required on one Mac OS X 10.5.8 system at least, where the lib was available but the header wasn't. Also enable our GMP code on systems where GMP is not in a separate lib.
2013-03-22doc: clarify the printable characters output by odPádraig Brady
* src/od.c (usage): Mention any printable character is output, Not just ASCII. * doc/coreutils.texi (od invocation): Further clarify that only single byte characters are output (due to the alignment requirement). Also mention the fact that 3 digit octal sequences are output for non printable characters without a corresponding C escape. Reported in http://bugs.gnu.org/13947
2013-03-22doc: clarify stat the meaning of --format="%t %T"Pádraig Brady
* src/stat.c (usage): Mention that the values are only defined for character and block special files. * doc/coreutils.texi (stat invocation): Likewise. Also mention st_rdev. Reported in http://bugs.gnu.org/13927
2013-03-06doc: mention `numfmt` as an alternative to `sort -h`Pádraig Brady
* doc/coreutils.texi (sort invocation): Mention that numfmt can achieve the same results with a possibly more accurate sort.
2013-03-06doc: remove a redundant numfmt heading from texinfoPádraig Brady
* doc/coreutils.texi (detailmenu): Remove the redundant numfmt heading.
2013-03-06maint: ensure proper backslash quoting in texinfo macrosPádraig Brady
* doc/coreutils.texi (ambiguousGroupNote): Ensure '\' is escaped appropriately within the macro. This was verified to generate a single '\' in both "info" and "pdf" outputs.
2013-03-04build: fix factor build failure on aarch64Torbjörn Granlund
* src/longlong.h (__aarch64__): Make add_ssaaaa and sub_ddmmss work. * NEWS: Mention the build fix. Reported at https://bugzilla.redhat.com/917735
2013-02-28tests: don't skip all uniq tests when locale is missingAssaf Gordon
* tests/misc/uniq.pl: Previously, if LOCALE_FR was not defined, all tests would be skipped. Modified to skip only the relevant test.
2013-02-28uniq: add the --group optionAssaf Gordon
* src/uniq.c (usage): Summarize the new option, and adjust the --all-repeated option to be more consistent. (check_file): Merge the --group functionality into the core loop for the default uniq operation since it's very similar and can output lines immediately upon reading. (main): Handle the new --group option and make it mutually exclusive with other selection options. * tests/misc/uniq.pl: Add tests. * NEWS: Mention the new feature. * doc/coreutils.texi (uniq invocation): Describe --group.
2013-02-28doc: move some info from all --help messages, onlinePádraig Brady
* src/system.h (emit_ancillary_info): Link to the bug report email addresses and general help URLs online rather than specifying directly. This give us greater scope to present better info like describing the difference between bug-coreutils@gnu.org and coreutils@gnu.org etc. * tests/misc/help-version.sh: Remove the check for bug-coreutils@gnu.org * tests/local.mk: Remove the no longer needed PACKAGE_BUGREPORT.
2013-02-28tests: add '--ignore-case' tests for uniqAssaf Gordon
* tests/misc/uniq.pl: add tests for --ignore-case.
2013-02-28dircolors: add a new entry to colorize 'arc' filesJavier López
* src/dircolors.hin: Add an entry for arc. Suggested in: https://bugs.launchpad.net/ubuntu/+source/coreutils/+bug/1088131
2013-02-28join: Add the -z, --zero-terminated optionAssaf Gordon
* NEWS: Mention join's new option: --zero-terminated (-z). * src/join.c: Add new option, --zero-terminated (-z), to make join use the NUL byte as separator/delimiter rather than newline. (get_line): Use readlinebuffer_delim in place of readlinebuffer. (main): Handle the new option. (usage): Describe new option the same way sort does. * doc/coreutils.texi (join invocation): Describe the new option. * tests/misc/join.pl: add tests for -z option.
2013-02-28dircolors: add new entries to colorized archive formatsOndřej Vašík
* src/dircolors.hin: Add .cab, .alz, .lzo, .lrz, .t7z, .tzo, .lha to colorized archives. Suggested by Ville Skyttä in https://bugzilla.redhat.com/868510
2013-02-22install: cleanup properly if the strip program failed for any reasonOndrej Oprala
* src/install.c (strip): Indicate failure with a return code instead of terminating the program. (install_file_in_file): Handle strip's return code and unlink the created file if necessary. * tests/install/strip-program.sh: Add a test to cover the changes. * NEWS (Bug fixes): Mention the fix. Reported by John Reiser in http://bugzilla.redhat.com/632444.
2013-02-20copy: ensure the correct root ID is checked on all platformsJoachim Schmitz
* src/copy.c (copy_reg): Check ROOT_UID rather than 0, which is significant on HP-NonStop.
2013-02-20maint: cleanup up various uses of __attribute__Pádraig Brady
* src/cfg.mk (sc_prohibit-gl-attributes): Disallow the __attribute() form without trailing underscores as that is not elided where required. Also ensure we use gnulib macros rather than defining our own. * src/system.h: Remove gnulib provided macros. * src/chown-core.c: Likewise. * src/chroot.c: Likewise. * src/copy.c: Likewise. * src/csplit.c: Likewise. * src/dd.c: Likewise. * src/expr.c: Likewise. * src/extent-scan.c: Likewise. * src/factor.c: Likewise. * src/ls.c: Likewise. * src/od.c: Likewise. * src/paste.c: Likewise. * src/ptx.c: Likewise. * src/sort.c: Likewise. * src/stat.c: Likewise. * src/stty.c: Likewise. * src/system.h: Likewise. * src/tac.c: Likewise. * src/test.c: Likewise. * src/tsort.c: Likewise.
2013-02-20build: fix numfmt build error on compilers without __attributeJoachim Schmitz
* src/numfmt.c (): Use the more standard _GL_ATTRIBUTE_PURE which is elided where required. Reported in http://bugs.gnu.org/10305
2013-02-20tests: avoid false failures on file systems with smaller NAME_MAXPádraig Brady
* tests/du/long-from-unreadable.sh: This test requires a NAME_MAX of at least 200, so skip the test otherwise. * tests/rm/deep-2.sh: Likewise. Reported by C de-Avillez with ecryptfs where NAME_MAX = 143.
2013-02-18maint: choose editor in the commit-msg git hook the same way git doesStefano Lattarini
Git honours the GIT_EDITOR environment variable, the "core.editor" Git configuration variable, and the EDITOR environment variable (in that order, and defaulting to "vi" if none of them is set) to decide which editor should be invoked for the user when he has to or want to edit his commit message. However, our commit-msg hook, when invoking an editor on behalf of the user to allow him to fix a non-policy-complaint commit message, only honoured the EDITOR environment variable. To avoid potential annoying inconsistencies, we should really use the same logic used by Git in the selection of the editor. Luckily, we don't have to duplicate this logic (that would be brittle in the long term), as we can rely on the "git var" command, designed exactly to be used in situations like this. * scripts/git-hooks ($editor): Adjust definition.
2013-02-18maint: don't reset PATH in the commit-msg git hookStefano Lattarini
I have a custom 'editor' script in ~/bin, and a system-provided 'editor' program in /usr/bin (on Debian, this is a link set up the "debian alternatives" subsystem). My '$EDITOR' and '$GIT_EDITOR' variables are set simply to 'editor' (no absolute path), which I expect should point to my 'editor' script, since ~/bin precedes /usr/bin in my PATH definition. But the 'commit-msg' hook used in coreutils unconditionally resets its PATH to '/bin:/usr/bin', which causes it to call the "wrong" editor (the one in /usr/bin, not the one in ~/bin) when it makes me update a botched commit message. * scripts/git-hooks: Don't reset $ENV{PATH} to '/bin:/usr/bin', which was only done to avoid failure when enabling Perl's taint checking.
2013-02-14maint: prevent trailing period at first line of a commit messageBernhard Voelker
* scripts/git-hooks/commit-msg (bad_first_line): Return an error message if the first line of a commit message ends with a period.
2013-02-14maint: post-release administriviaPádraig Brady
* NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update.
2013-02-14version 8.21Pádraig Brady
* NEWS: Record release date.
2013-02-14tests: avoid non portable sed use of \tPádraig Brady
* tests/du/threshold.sh: use `cut` rather than sed to avoid using the non portable \t which fails on sed on openbsd 5 at least. Also remove a redundant call to `tr` and avoid explicit setting of LANG=C which is done globally.
2013-02-14build: avoid link failure in devmsg() on older linkersPádraig Brady
On linkers that don't remove unused functions, there will be a reference to a missing dev_debug symbol in the devmsg() function. So for now ... * src/system.h: ... move devmsg() from here ... * src/numfmt.c: ... to here, and document future cleanup. * src/factor.c: Likewise.
2013-02-13numfmt: fix strtol() return code handlingAssaf Gordon
src/numfmt.c (parse_format_string): On some systems, strtol() returns EINVAL if no conversion was performed. So only handle ERANGE here, and handle other format errors directly.
2013-02-11maint: avoid running check-root tests in gnulibBernhard Voelker
* tests/local.mk (check-root): Restrict to SUBDIRS=. as traversing into gnulib-tests induces a false failure.
2013-02-11doc: improve the numfmt man page formatPádraig Brady
* src/numfmt.c (usage): Keep a single space between the "K = 1000", so that it's not displayed on a separate line. Also place ',' between each unit entry to improve readability.
2013-02-10doc: standardize helptext of numfmt and slice into single optionsBenno Schulenberg
* src/numfmt.c (usage): Correct synopsis and make command description clearer. Start option descriptions with lowercase letter; use semicolon instead of period where needed; indent continuation lines; gettextize single options for ease of translation and maintenance; sort options alphabetically. * doc/coreutils.texi (numfmt invocation): Sort numfmt options alphabetically. Enforce double-blank-after-period style. This addresses http://bugs.gnu.org/13681. Improved-by: Bernhard Voelker
2013-02-10maint: consolidate developer debug messagesPádraig Brady
Both factor and numfmt recently introduced debug messages for developers, enabled by --verbose and ---devdebug respectively. There were a few issues though: 1. They used different mechanisms to enable these messages. 2. factor used --verbose which might be needed for something else 3. They used different methods to output the messages, and numfmt used error() which added an unwanted newline 4. numfmt marked all these messages for translation and factor marked a couple. We really don't need these translated. So we fix the above issues here while renaming the enabling option for both commands to ---debug (still undocumented). * src/factor.c (verbose): Rename to dev_debug and change from int to bool as it's just a toggle flag. (long_options): Rename --verbose to ---debug. * src/system.h (devmsg): A new inline function to output a message if enabled by a global dev_debug variable in the compilation unit. * src/numfmt.c: Use devmsg() rather than error(). Also remove the translation tags from these messages. Also change debug flag to bool from int. * tests/misc/numfmt.pl: Adjust for the ---devdebug to ---debug change. * cfg.mk (sc_marked_devdiagnostics): Add a syntax check to ensure translations are not added to devmsg calls. Reported by Göran Uddeborg in http://bugs.gnu.org/13665
2013-02-10tests: tail-2/inotify-rotate: fix a false failure on NFSPádraig Brady
* tests/tail-2/inotify-rotate.sh: Avoid a subshell with bash, which in turn causes the `kill` to be ineffective to the tail processes (as the SIGTERM is sent to the subshell which doesn't propagate the signal on to its children). On NFS the test cleanup will then fail as there will be .nfs files maintained in the directory for the files still opened by the tail processes. Reported by Bernhard Voelker.
2013-02-10tests: skip numfmt grouping tests on some systemsPádraig Brady
* tests/misc/numfmt.pl: When the system locale grouping doesn't match our expected format for grouping 1234 in the fr_FR locale, reset the locale to 'C' so as to skip all locale tests.
2013-02-07tests: avoid actual/expected mismatch due to changed diagnosticJim Meyering
* tests/cp/fail-perm.sh: Adjust expected diagnostic to match just-changed cp diagnostic. * tests/ln/hard-to-sym.sh: Likewise. * .mailmap: Also map my new address.
2013-02-07build: update gnulib submodule; also bootstrap to latestPádraig Brady
Notes tests/init.sh is still in sync with gnulib * bootstrap: update to latest * gnulib: update avoiding secure_getenv and subsequent patches as these are reported to fail on FreeBSD at least.
2013-02-06maint: improve error messages upon failed read, write, access, closeBenno Schulenberg
Note we use "failed to {access,close}" for those single operations, and "error {read,writ}ing" for those partial operation failures. * src/copy.c: Improve error messages for failing read, write and close. * src/cp.c: Improve error messages for failing access. * src/dd.c: Improve error messages for failing read, write and open. * src/head.c: Improve error message for failing close. * src/install.c: Improve error messages for failing access. * src/ln.c: Likewise. * src/mv.c: Likewise. * src/touch.c: Improve error message for failing close. * src/truncate.c: Likewise.
2013-02-05doc: fix a numfmt help section typoAssaf Gordon
* src/numfmt.c (usage): Change erroneous "G" to "M".
2013-02-05stty: add support for DTR/DSR hardware control flowOndřej Vašík
Originally requested in Red Hat bugzilla #445213. * src/stty.c (mode_info): Add support for DTR/DSR hardware flow control, if available. * doc/coreutils.texi: Document it. * tests/misc/stty.sh: Add it to the list of serial options to avoid. * NEWS: Mention the improvement.
2013-02-05numfmt: correct a printf formatPádraig Brady
Prompted by the continuous integration build failure at: http://hydra.nixos.org/build/4010493 * src/numfmt.c (parse_format_string): Correct both sign and size of a printf format, which only gives a warning on 32 bit builds.