summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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.
2013-02-04numfmt: a new command to format numbersAssaf Gordon
* AUTHORS: Add my name. * NEWS: Mention the new program. * README: Reference the new program. * src/numfmt.c: New file. * src/.gitignore: Ignore the new binary. * build-aux/gen-lists-of-programs.sh: Update. * scripts/git-hooks/commit-msg: Allow numfmt: commit prefix. * po/POTFILES.in: Add new c file. * tests/misc/numfmt.pl: A new test file giving >93% coverage. * tests/local.mk: Reference the new test. * man/.gitignore: Ignore the new man page. * man/local.mk: Reference the new man page. * man/numfmt.x: A new template. * doc/coreutils.texi: Document the new command.
2013-02-04cut: fix a segfault with disjoint open ended rangesPádraig Brady
Fixes the issue introduced in unreleased commit v8.20-60-gec48bea. * src/cut.c (set_fields): Don't access the bit array if we've an open ended range that's outside any finite range. * tests/misc/cut.pl: Add tests for this case. Reported by Marcel Böhme in http://bugs.gnu.org/13627
2013-02-01doc: say how to tac char-by-charPaul Eggert
This fixes Bug#12115, reported by Reuben Thomas. * doc/coreutils.texi (tac invocation): Document how to reverse a file character by character. Break out MS-DOS into a separate section, like 'cat' does.
2013-01-28df: do not treat rootfs speciallyBernhard Voelker
Like any other pseudo file system, df should show rootfs only when the -a option is specified, i.e. specifying -trootfs alone is not sufficient. As the rootfs entry is now elided by the general deduplication in filter_mount_list (commit v8.20-103-gbb116d3), all other references to rootfs can be removed again. * src/df.c (show_rootfs): Remove global variable. (ROOTFS): Remove constant. (filter_mount_list): Remove case to handle rootfs specially. (main): In the case for handling the -t option, remove setting of the show_rootfs variable. * tests/df/skip-rootfs.sh: Adapt the test case "df -t rootfs": the rootfs file system must not be printed (because no -a). * doc/coreutils.texi (df invocation): Correct the documentation about eliding mount entries: it is not the first occurrence of the the device which wins, but now rather the entry with the shortest mount point name. Also adapt the description about eliding pseudo file system types like rootfs. * NEWS (Changes in behavior): Adapt entry.
2013-01-27df: prefer fullpath entries when deduplicatingOndrej Oprala
* src/df.c (struct devlist): Add a new element for storing pointers to mount_entry structures. (devlist_head, dev_examined): Remove. (filter_mount_list): Add new function to filter out the rootfs entry (unless -trootfs is specified), and duplicities. The function favors entries with a '/' character in me_devname or those with the shortest me_mountdir string, if multiple entries fulfill the first condition. Use struct devlist to build up a list of entries already known, and finally rebuild the global mount_list. (get_all_entries): Call the above new function unless the -a option is specified. (get_dev): Remove the code for skipping rootfs and duplicities. * tests/df/skip-duplicates.sh: Add test cases. Co-authored-by: Bernhard Voelker <mail@bernhard-voelker.de>
2013-01-26timeout: ensure a blocked SIGALRM from the parent is unblockedStephan Krempel
* src/timeout.c (unblock_signal): A new function to unblock a specified signal, or warn if not possible. (set_timeout): Ensure SIGALRM is unblocked before we setup the timer. * tests/misc/timeout-blocked.pl: A new test for the issue. * tests/local.mk: Reference the new test. * NEWS: Mention the fix. Fixes: http://bugs.gnu.org/13535
2013-01-26seq: fix to always honor the step valuePádraig Brady
* src/seq.c (main): With 3 positive integer args we were checking the end value was == "1", rather than the step value. * tests/misc/seq.pl: Add tests for this case. Reported by Marcel Böhme in http://bugs.gnu.org/13525
2013-01-26seq: fix misaligment with -w when no precision for start valuePádraig Brady
* src/seq.c (get_default_format): Also account for the case where '.' is auto added to the start value, which is significant when the number sequence narrows. * tests/misc/seq.pl: Add two new tests for the failing cases. * NEWS: Mention the fix. Fixes http://bugs.gnu.org/13394
2013-01-26cut: fix -f to work with the -d$'\n' edge casePádraig Brady
* src/cut.c (cut_fields): Handle the edge case where '\n' is the delimiter, which could be used for example to suppress the last line if it doesn't contain a '\n'. * test/misc/cut.pl: Add tests for this edge case.
2013-01-26cut: with -f, process each line independentlyPádraig Brady
Previously line N+1 was inspected before line N was fully output, which causes output ordering issues at the terminal or delays from intermittent sources like tail -f. * src/cut.c (cut_fields): Adjust so that we record the previous output character so we can use that info to determine wether to output a '\n' or not. * tests/misc/cut.pl: Add tests to ensure existing functionality isn't broken. * NEWS: Mention the fix. Fixes bug http://bugs.gnu.org/13498
2013-01-23build: update gnulib submodule to latestPaul Eggert
* bootstrap.conf (gnulib_modules): Add statat. The fstatat module was split in two, and we need both halves.
2013-01-24doc: fix an example in the od man pagePádraig Brady
* man/od.x: s/-w 16/-w16/ as -w takes an optional parameter and so the space is significant.
2013-01-23doc: fix order of du options in usage and texinfo manualBernhard Voelker
* src/du.c (usage): Bring options into alphabetical order. * doc/coreutils.texi (du invocation): Likewise. Furthermore, use the @itemx macro for the long options --max-depth and --threshold instead of @item.
2013-01-23maint: define usage note about mandatory args centrallyBernhard Voelker
Each program with at least one long option which is marked as 'required_argument' and which has also a short option for that option, should print a note about mandatory arguments. Define that well-known note centrally and use it rather than literal printf/fputs, and add it where it was missing. * src/system.h (emit_mandatory_arg_note): Add new function. * src/cp.c (usage): Use it rather than literal printf/fputs. * src/csplit.c, src/cut.c, src/date.c, src/df.c, src/du.c: * src/expand.c, src/fmt.c, src/fold.c, src/head.c, src/install.c: * src/kill.c, src/ln.c, src/ls.c, src/mkdir.c, src/mkfifo.c: * src/mknod.c, src/mv.c, src/nl.c, src/od.c, src/paste.c: * src/pr.c, src/ptx.c, src/shred.c, src/shuf.c, src/sort.c: * src/split.c, src/stdbuf.c, src/tac.c, src/tail.c, src/timeout.c: * src/touch.c, src/truncate.c, src/unexpand.c, src/uniq.c: Likewise. * src/base64.c (usage): Add call of the above new function because at least one long option has a required argument. * src/basename.c, src/chcon.c, src/date.c, src/env.c: * src/nice.c, src/runcon.c, src/seq.c, src/stat.c, src/stty.c: Likewise.
2013-01-21du: add -t SIZE, --threshold=SIZE optionJakob Truelsen
* src/du.c (opt_threshold): Add variable to hold the value of the --threshold option specified by the user. (long_options): Add a required_argument entry for the new --threshold option. (usage): Add --threshold option. (process_file): Elide printing the entry if its size does not meet the value specified by the --threshold option. (main): In the argument parsing loop, add a case for the new -t option. Convert the given argument by permitting the well-known suffixes for megabyte, gigabytes, etc. Handle the special case "-0": give an error as this value is not permitted. * doc/coreutils.texi (du invocation): Add documentation for the above new option. * tests/du/threshold.sh: Add new test to exercise the new option. * tests/local.mk (all_tests): Mention the above test. Co-authored-by: Bernhard Voelker <mail@bernhard-voelker.de>
2013-01-20tests: remove test case du/slinkBernhard Voelker
This test tried to ensure that not all symlinks (across all file system types) have Zero size and refers to a change in system.h from 2002-08-31 (commit SH-UTILS-2_0_15-55-g62808a7). The test used to do this by working on symlinks to long file names. This assumption is dependant on the underlying file system, and in some environments like XEN does not even work on file systems known to work otherwise. The test for dereferencing and no-dereferencing symlinks is already covered by other tests (du/deref.sh, du/deref-args.sh, and du/no-deref.sh). Therefore, remove it. * tests/du/slink.sh: Remove file. * tests/local.mk (all_tests): Remove the above test. Discussed in: http://lists.gnu.org/archive/html/coreutils/2013-01/msg00053.html
2013-01-20maint: fix alphabetical order in .gitignoreBernhard Voelker
Since commit v8.20-67-g0f525b6, .gitignore sometimes showed up as changed because the entries "*.gcda" and "*.gcno" had not been in alphabetical order. * .gitignore: Exchange the entries "*.gcda" and "*.gcno".
2013-01-12uptime: gettextize an overlooked string, and normalize anotherBenno Schulenberg
* src/uptime.c: Add calls to gettext() and select_plural().
2013-01-10doc: make a --help text fragment identical to three othersBenno Schulenberg
* src/ln.c (usage): Move a newline to the next text fragment, so the preceding fragment about backup methods becomes the same as the ones for cp, mv, and install. A bit easier for translators.
2013-01-07factor: apply a more general fix to enable correct assemblyPádraig Brady
In addition to the previous 64 bit guards we've placed in longlong.h there are additional _LP64 guards required for mips with -mcpu >= 3, to avoid a build failure (http://bugs.gnu.org/13353) and on sparc with -mcpu >= v9 in 32 bit mode where for example, `factor 2123123123123123123123` would go into an infinite loop. Since factor.c currently operates on uintmax_t, we restrict the use of the assembly in longlong.h to when 'long' has the same width, to provide a more general guard for this code. * src/factor.c: Restrict the use of longlong.h assembly code, to when the width of intmax_t == long. * src/longlong.h: Remove the previous _LP64 guards to avoid divergence from GMP's longlong.h * NEWS: Adjust the info on build and runtime fixes.
2013-01-06doc: sync parse-datetime from gnulibPaul Eggert
* doc/coreutils.texi (Top): Sync from gnulib parse-datetime.texi menu.
2013-01-06doc: avoid @sc in texinfo; it is unnecessaryKarl Berry
* doc/coreutils.texi: avoid @sc and use explicit capitals. * doc/local.mk (sc-use-small-caps-NUL): Remove, as no longer applicable.
2013-01-04doc: remove stale pr news in the manualKarl Berry
* coreutils.texi (pr invocation): remove list of ancient news items; the main documentation already covers what is needed.
2013-01-01maint: update all copyright year number rangesJim Meyering
Run "make update-copyright", but then also run this, perl -pi -e 's/2\d\d\d-//' tests/sample-test to make that one script use the single most recent year number.
2013-01-01build: update gnulib submodule to latestJim Meyering
2012-12-31maint: adjust NEWS entry wordingJim Meyering
* NEWS: Adjust wording in a few entries.
2012-12-27doc: improve od --help and man pagePádraig Brady
* src/od.c: Redorder the information output by --help to ease interpretation and so that appropriate sections are generated by help2man. * doc/coreutils.texi (od invocation): Fix an incorrect reference to @var{n}, which should be @var{bytes}. * man/od.x: Add an "Examples" section, and move the default od format to there, and add a commonly required format to generate hexdumps. Reported by Akim Demaille in http://bugs.gnu.org/13280.
2012-12-21factor: disable x86_64 assembly code for x32 buildsMike Frysinger
The current x86_64 asm code does not work for x32 (__ILP32__) ABIs, so disable it. Note simply deleting the q suffix is not enough. * src/longlong.h: Restrict x86_64 assembly to _LP64 targets, which is consistent with other checks in longlong.h and avoids this code on x32. * NEWS: Mention the build fix.
2012-12-21tests: avoid false positive valgrind failuresPádraig Brady
* init.cfg (require_valgrind_): Check the `true` program, which will check more valgrind failure cases as now detailed in the function comments.
2012-12-21dd: fix a printf format mismatch in an error messagePádraig Brady
* src/dd.c (dd_copy): To print an off_t portably we need to use PRIdMAX and cast to intmax_t, otherwise there could be a mismatch between say a 32 bit off_t and uintmax_t. This was flagged by -Wformat on a 64 bit host when compiling with CFLAGS=-m32.
2012-12-21seq: fix newline output when -s specifiedPádraig Brady
This regression was introduced in commit v8.19-132-g3786fb6. * src/seq.c (seq_fast): Don't use puts() to output the first number, and instead insert it into the buffer as for other numbers. Also output the terminator unconditionally. * tests/misc/seq.pl: Add some basic tests for the -s option. * NEWS: Mention the fix. * THANKS.in: Reported by Philipp Gortan.
2012-12-20tests: add tests for basename's --zero optionBernhard Voelker
The -z option has been introduced in commit v8.15-60-ga3eb71a, i.e. in coreutils-8.16. Time to add some tests for it. * tests/misc/basename.pl: Add tests exercising the -z option. In the foreach loop to append a newline to the end of each expected 'OUT' string, skip the -z tests.
2012-12-20doc: tweak 'lcov' in HACKINGAssaf Gordon
* HACKING: In the paragraph about creating coverage statistics, use the correct -b (--base-directory) parameter.
2012-12-19maint: rewrap a long line noticed by make syntax-checkPádraig Brady
* configure.ac: Wrap the recently introduced long line.
2012-12-19doc: clarify when dd iflag=fullblock is usefulPádraig Brady
* doc/coreutils.texi (dd invocation): Explain that iflag=fullblock ensures that count= will count blocks rather than reads, and reference that in both the count= and iflag=fullblock descriptions. Suggested by John Reiser.