summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2015-01-28sync: support syncing specified argumentsGiuseppe Scrivano
* m4/jm-macros.m4 (coreutils_MACROS): Check for syncfs(). * man/sync.x: Add references to syncfs, fsync and fdatasync. * doc/coreutils.texi (sync invocation): Document the new feature. * src/sync.c: Include "quote.h". (AUTHORS): Include myself. (MODE_FILE, MODE_DATA, MODE_FILE_SYSTEM, MODE_SYNC): New enum values. (long_options): Define. (sync_arg): New function. (usage): Describe that arguments are now accepted. (main): Add arguments parsing and add support for fsync(2), fdatasync(2) and syncfs(2). * tests/misc/sync.sh: New (and only) test for sync. * tests/local.mk: Reference the new test. * AUTHORS: Add myself to sync's authors. * NEWS: Mention the new feature.
2015-01-25scripts: autotools-install: updateJim Meyering
* scripts/autotools-install: Increase automake's version number to 1.15 and add Stefano Lattarini's new GPG key ID. Increase gettext's version to 0.19.4 and add Daiki Ueno's GPG key ID. Also move VERSION definition "up" so that it is once again automatically updated via the emacs hook snippet at the end of the file.
2015-01-24stty: only print supported options for combined optionsPádraig Brady
* src/stty.c (usage): Don't reference unsupported options, in the combined options descriptions. * doc/coreutils.texi (stty invocation): Adjust for the new order of the 'sane' and 'raw' combined options. Also add -iutf8 to the 'sane' list.
2015-01-24stty: document the 'status' character where supportedPádraig Brady
* src/stty.c (usage): On systems that support this setting (BSD), display 'status' in the list of adjustable special characters. * doc/coreutils.texi (stty invocation): Mention the option, and that it's not currently supported on Linux.
2015-01-24stty: document the 'discard' character settingPádraig Brady
The equivalent of this is 'flush', but that was never documented as an option (though was output with stty -a). Therefore use the more descriptive name, also generally used on BSD systems. Note even though this setting seems ineffective on Linux, supporting the setting is useful to allow terminal programs to receive the default ^O character code. * doc/coreutils.texi (stty invocation): Document the 'discard' option. * src/stty.c (struct control_info): Add 'discard'; same as 'flush'. (display_all): Show 'discard' rather than 'flush' char. (display_changed): Likewise. (usage): Document the 'discard' option.
2015-01-24stty: add support for extproc/LINEMODEPádraig Brady
Add support for the "extproc" option which is well described at: http://lists.gnu.org/archive/html/bug-readline/2011-01/msg00004.html * src/stty.c (usage): Describe the extproc option if either the Linux EXTPROC local option is defined, or the equivalent BSD TIOCEXT ioctl is defined. (main): Make the separate ioctl call for extproc on BSD. * doc/coreutils.texi (stty invocation): Describe the option, and reference the related RFC 1116. * NEWS: Mention the new feature.
2015-01-20tests: use returns_ function for new split testBernhard Voelker
* tests/split/record-sep.sh: Use the recently added returns_ function to simplify the shell syntax in this test. Also remove the redirection of stdout/stderr to /dev/null as this eases analyzing errors.
2015-01-19split: new -t option to select record separatorAssaf Gordon
* src/split.c (eolchar): A new variable to hold the separator character (unibyte for now). This is reference throughout rather than hardcoding '\n'. (usage): Describe the new --separator option, and mention records along with lines so there is no ambiguity that all options treat lines and records equivalently. (main): Have -t update eolchar, or default to '\n'. * tests/split/record-sep.sh: New test case. * tests/local.mk: Reference the new test. * doc/coreutils.texi (split invocation): Document the new option. Adjust --lines, --line-bytes, --number=[lr]/... to mention they pertain to records if --separator is specified. * NEWS: Mention the new feature.
2015-01-19maint: fix typo in THANKS.in in previous commitPádraig Brady
* THANKS.in: s/Stehpen/Stephen/
2015-01-19doc: clarify that du operands are interdependentPádraig Brady
Following on from http://bugs.gnu.org/17546 make it more obvious that du may elide specified operands to avoid double counting in the set. * src/du.c (usage): Specify that du operates on the set of operands, rather than each independently. * doc/coreutils.texi (du invocation): Likewise. Also state that the number of entries printed may change due to the order specified. Currently, deeper items specified earlier will result in them being displayed, but don't mention that implementation detail in the documentation. * THANKS.in: Add reporter. Reported by Stephen Shirley
2015-01-14tests: use compare-vs-/dev/null instead of 'test -s'Bernhard Voelker
When some program produces unexpected output, that use of compare-vs-/dev/null will ensure that the surprising output is printed in the test's output. With "test -s err" only, one would have to instrument and rerun in order to see the offending output. * cfg.mk (sc_prohibit_and_fail_1): Exempt 'compare' from this check. * tests/dd/misc.sh: Change "tests -s ... || fail=1" to "compare /dev/null ... && fail=1". * tests/misc/nice.sh: Likewise. * tests/rm/read-only.sh: Likewise. * tests/tail-2/inotify-race.sh: Likewise. * tests/touch/no-dereference.sh: Likewise. Suggested by Jim Meyering in http://lists.gnu.org/archive/html/coreutils/2015-01/msg00042.html
2015-01-14tests: add extra protection against unexpected exitsPádraig Brady
Many tests use `program ... && fail=1` to ensure expected error situations are indicated. However that would mask an unexpected exit (like a crash). Therefore explicitly check the expected exit code. Note where error messages are also verified, the extra protection is not added. * tests/init.sh (returns_): A new helper function to check the return code of a command, and used throughout the tests. * cfg.mk (sc_prohibit_and_fail_1): Add a syntax check to avoid new instances of this issue.
2015-01-12tests: avoid skipping some df tests with libmountPádraig Brady
* tests/df/no-mtab-status.sh: Provide libmount placeholders, to avoid skipping the test when libmount is in use. * tests/df/skip-duplicates.sh: Likewise. * tests/df/skip-rootfs.sh: Comment that the test is moot when libmount (/proc/self/mountinfo) is being used.
2015-01-10maint: clean up some test issues identified with shellcheckPádraig Brady
* tests/cp/cp-a-selinux.sh: Comment why unused variables are assigned. Fix misspellings noticed while adjusting. * tests/cp/fiemap-perf.sh: Fix quoting. * tests/misc/shuf.sh: Avoid useless use of cat. * tests/misc/printf-surprise.sh: Likewise.
2015-01-08maint: adjustments related to previous shuf crash fixDaiki Ueno
* tests/misc/shuf.sh: Improve the test so it detects crashes in more cases. * NEWS: Mention the previous fix.
2015-01-08maint: skip long-lines syntax-check if unsupportedAssaf Gordon
* cfg.mk(sc_long_lines): Skip if required wc and sed options are not supported, which is currently the case on OS X.
2015-01-05shuf: do not mishandle 'shuf -i0-0 1'Paul Eggert
Problem reported by Daiki Ueno in: http://bugs.gnu.org/19520 * src/shuf.c (main): Avoid core dump if !input_range. * tests/misc/shuf.sh: Test for this bug.
2015-01-01maint: update further copyright year number rangesBernhard Voelker
* bootstrap: Update copyright year manually (missing in previous gnulib update). * tests/init.sh: Likewise. The entries in the exemption list are processed by "grep -vEf ./.x-update-copyright", and therefore evaluated as an extended regular expression (ERE). Thus, the "bootstrap" entry also matched for bootstrap.conf which we want to be updated. * .x-update-copyright: Change all entries to EREs, i.e. including the caret ^ and dollar sign $ meta-characters matching the beginning and the end of a line. * bootstrap.conf: Update copyright year by "make update-copyright". Finally, the only one showing up with the following command should be the COPYING file: $ git grep 'Copyright .* Free Software' | grep -v '2015 Free Software'
2015-01-01doc: fix man page formatting for split CHUNKS optionsPádraig Brady
* src/split.c (usage): Indent the info on CHUNKS so that help2man can match it and align appropriately in its own section. Fixes http://bugs.gnu.org/19228
2015-01-01build: update to latest gnulibPádraig Brady
Pick up an errno adjustment in xstrtol() that fixes a spurious test failure on Darwin 14.0.0. Also update copyright year to 2015 avoiding a syntax-check failure.
2015-01-01maint: update all copyright year number rangesPádraig Brady
Run "make update-copyright" and then... * tests/sample-test: Adjust to use the single most recent year. * tests/du/bind-mount-dir-cycle-v2.sh: Fix case in copyright message, so that year is updated automatically in future.
2014-12-30tests: fix possible 8 minute running time of inotify-rotate.shPádraig Brady
Commit v8.23-63-g111a2b9 removed the expensive tag on this test, as it runs quickly on systems with inotify. However without that it would take about 8 minutes for the test to complete all iterations. * tests/tail-2/inotify-rotate.sh: Tag as expensive without inotify. Also adjust the polling parameters used on systems without inotify so that the test completes within about 15 seconds.
2014-12-30build: update to latest gnulibPádraig Brady
Included in this are gnulib changes 3ea43e02 2768ceb7 which make the device IDs from /proc/self/mountinfo available to df. This can be leveraged by a subsequent change to df to present a more accurate list of file systems. * bootstrap: Merge from gnulib. * src/ls.c (dev_ino_pop): s/obstack_blank/obstack_blank_fast/ as this API/ABI has changed, giving memory exhausted errors if negative (large positive) numbers are passed to obstack_blank(). * tests/df/skip-duplicates.sh: Adjust as the new gnulib code requires a non NULL mnt_opts even when mnt_type is not "none".
2014-12-29maint: remove duplicate names from THANKSPádraig Brady
* .mailmap: Adjust so that there is only a single entry per name in the generated THANKS.
2014-12-26doc: update the URL referencing SI prefixesPádraig Brady
Identified at https://www.gnu.org/software/gnun/linc/linc.html * doc/coreutils.texi (Block size): Fix the stale link.
2014-12-25tests: fix error message check on some systemsPádraig Brady
http://hydra.nixos.org/build/18129583 identified (on OS X) an incorrect test assumption in the previous commit. * gl/lib/xdectoint.c (__xnumtoint): Suppress the EINVAL error message as it's redundant in this context. * tests/misc/tail.pl: Suppress _optionally_ appended strerror messages. * tests/fmt/base.pl: Likewise. * tests/pr/pr-tests.pl: Likewise. * tests/split/l-chunk.sh: Likewise.
2014-12-19diagnose too-large numbers betterPádraig Brady
Following on from commit v8.23-82-gaddae94, consistently diagnose numbers that are too large, so as to distinguish from other errors, and make the limits obvious. * gl/modules/xdectoint: A new module implementing xdecto[iu]max(), which handles the common case of parsing a bounded integer and exiting with a diagnostic on error. * gl/lib/xdectoimax.c: The signed variant. * gl/lib/xdectoint.c: The parameterized implementation. * gl/lib/xdectoint.h: The interface. * gl/lib/xdectoumax.c: The unsigned variant. * bootstrap.conf: Reference the new module. * cfg.mk (exclude_file_name_regexp--sc_require_config_h_first): Exclude the parameterized templates. * src/csplit.c: Output EOVERFLOW or ERANGE errors if appropriate. * src/fmt.c: Likewise. * src/fold.c: Likewise. * src/head.c: Likewise. * src/ls.c: Likewise. * src/nl.c: Likewise. * src/nproc.c: Likewise. * src/shred.c: Likewise. * src/shuf.c: Likewise. * src/stdbuf.c: Likewise. * src/stty.c: Likewise. * src/tail.c: Likewise. * src/truncate.c: Likewise. * src/split.c: Likewise. * src/pr.c: Likewise. * tests/pr/pr-tests.pl: Adjust to avoid matching errno diagnostic. * tests/fmt/base.pl: Likewise. * tests/split/l-chunk.sh: Likewise. * tests/misc/shred-negative.sh: Likewise. * tests/misc/tail.pl: Likewise. Also remove the redundant existing ERR_SUBST from test err-6. * tests/ls/hex-option.sh: Check HEX/OCT options. * tests/misc/shred-size.sh: Likewise. * tests/misc/stty-row-col.sh: Likewise.
2014-12-19build: add $(EXEEXT) suffix to man page make targetsKO Myung-Hun
* man/local.mk: Add $(EXEEXT) suffix to the executables, which is significant on OS/2 for example.
2014-12-19build: don't call OS/2 routines on all systemsKO Myung-Hun
* src/system.h: Add a missing __OS2__ ifdef guard. Also adjust spacing around () to avoid a syntax-check failure.
2014-12-18build: expand a response file and a wildcard on OS/2KO Myung-Hun
OS/2 traditional shells(cmd) do not expand a response file(@file) or a wildcard. Expand them in each utility itself. * src/system.h (initialize_main): Define on OS/2. Expand a response file and a wildcard.
2014-12-16maint: fix how to request changes for THANKS.inBernhard Voelker
* THANKS.in: Change the comment at the top to send change requests regarding this file to the main mailing list rather than referring to cp's --help output for the mailing list's address - which does not include that information anymore.
2014-12-16dd: fix typo in previous changePaul Eggert
Reported by Bernhard Voelker in: http://lists.gnu.org/archive/html/bug-gnulib/2014-12/msg00191.html * src/dd.c (scanargs): s/IN/OUT/.
2014-12-15dd: diagnose too-large numbers betterPaul Eggert
Reported by Isabella Parakiss in: http://lists.gnu.org/archive/html/bug-gnulib/2014-12/msg00184.html * src/dd.c (parse_integer): Return strtol_error code, not bool. All callers changed. (scanargs): Improve quality of diagnostic when a number is too large.
2014-12-10build: use the system printf routines in most casesPádraig Brady
glibc <= 2.5 would crash when passed invalid long double values, therefore internal gnulib routines were used, essentially only by od, to output such invalid values. Later glibc versions don't crash, as per https://sourceware.org/bugzilla/show_bug.cgi?id=4586 and subsequently od was adjusted to use the system printf routines through the use of the ftoastr module with commit v8.7-22-ga71c22f. Consequently our testing of this feature was moot, and use of the gnulib printf replacement for printf(1), od(1) and error(3) etc. was redundant. * configure.ac (gl_printf_safe): Unset so that we don't check that "nan" is output for these long double values. * tests/misc/od-float.sh: Adjust all existing checks to fail if od exits with failure status (like crashing for example). Add a new case for one of the problematic invalid long double values for x86_64. We only check that od exits successfully at present, which may change if https://sourceware.org/bugzilla/show_bug.cgi?id=17661 is resolved.
2014-12-03maint: avoid -fsanitize=undefined warning in rand-isaacPádraig Brady
* gl/lib/rand-isaac.c (isaac_refill): readisaac() purposefully passes unaligned pointers to avoid memory copies. This is only done on platforms where this is defined, so avoid the associated runtime warning generated with -fsanitize=undefined, which is: lib/rand-isaac.c:125:182: runtime error: store to misaligned address 0x63100003d7fd for type 'isaac_word', which requires 8 byte alignment 0x63100003d7fd: note: pointer points here 47 ce ed a4 be be be 00 00 00 00 00 00 00 00 ... ^
2014-12-02maint: avoid signed overflow warning with -O3Pádraig Brady
Prompted by the implicit -O3 added by american-fuzzy-lop, seen with GCC 4.9.2 on x86_64. src/pr.c: In function 'print_files.part.5': src/pr.c:1781:6: error: assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow] if (cols_ready_to_print () == 0) This happens because cols_ready_to_print() is inlined thus reducing the comparison to the N variable in print_page(). Now this can't overflow due to the protection when parsing the specified column, but use an unsigned type to avoid the apparent signed overflow. * src/pr.c (cols_ready_to_print): Increment an unsigned type to avoid the subsequent signed overflow warning.
2014-12-02du: handle sub-bind-mount cycles gracefullyBoris Ranto
This patch fixes the handling of sub-bind-mount cycles which are incorrectly detected as the file system errors. If you bind mount the directory 'a' to its subdirectory 'a/b/c' and then run 'du a/b' you will get the circular dependency warning even though nothing is wrong with the file system. This happens because the first directory that is traversed twice in this case is not a bind mount but a child of bind mount. The solution is to traverse all the directories in the cycle that fts detected and check whether they are not a (bind) mount. * src/du.c (mount_point_in_fts_cycle): New function that checks whether any of the directories in the cycle that fts detected is a mount point. * src/du.c (process_file): Update the function to use the new function that looks up all the directories in the fts cycle instead of only the last one. * tests/du/bind-mount-dir-cycle-v2.sh: New test case that exhibits the described behavior. * tests/local.mk: Reference the new root test. * NEWS: Mention the bug fix.
2014-11-29tests: avoid hardlink to symlink tests where not supportedPádraig Brady
These checks weren't correctly avoided in commit v8.23-66-g222d7ac * tests/cp/same-file.sh: Avoid all hardlink to symlink tests on platforms where that's not supported. Identified by http://hydra.nixos.org/build/17636446
2014-11-28build: fix missing casts from recent changePádraig Brady
* src/dd.c (alloc_[io]buf): I committed a stale patch that omitted the casts needed on 32 bit. Identified by http://hydra.nixos.org/build/17610188
2014-11-27rm: fix prompted number of arguments to remove on some platformsPádraig Brady
"zu" was output on solaris 8 for example rather than the number, since coreutils-8.22. * cfg.mk: Disallow %z, since we don't currently use the gnulib fprintf module, so any usage with it is non portable. Also our usage with error() currently works only through an ancillary dependency on the vfprintf gnulib module. * src/rm.c (main): Use %PRIuMAX rather than %zu for portability. * src/dd.c (alloc_[io]buf): Likewise for consistency. * src/od.c (main): Likewise. * src/split.c (set_suffix_length): Likewise. * NEWS: Mention the rm bug fix. Reported in http://bugs.gnu.org/19184
2014-11-26tests: fix portability issue in dd/ascii testPádraig Brady
Solaris 8 was seen to issue this error: "printf: `&': illegal format character" * test/dd/ascii.sh: Use the coreutils printf in this test rather than the system one, to avoid portability issues.
2014-11-25build: port new rule for coreutils.h to old BashPaul Eggert
Reported by Ted Carr in: http://bugs.gnu.org/19184 * src/local.mk (src/coreutils.h): Don't assume single_binary_progs is nonempty.
2014-11-24paste: fix possible truncated output with large filesTobias Stoeckmann
If '\n' was present at the size_t boundary of a file, then that and subsequent data would be discarded. * src/paste.c (paste_parallel): Avoid the overflow issue by changing the flag to a boolean rather than a count. * NEWS: Mention the bug fix.
2014-11-24df: only suppress remote mounts of separate exports with --totalPádraig Brady
* src/df.c (filter_mount_list): Separate remote locations are generally explicitly mounted, so list each even if they share the same remote device and thus storage. However with --total keep the suppression to give a more accurate value for the total storage available. (usage): Expand on the new implications of --total and move it in the options list according to alphabetic order. doc/coreutils.texi (df invocation): Mention that --total impacts on deduplication of remote file systems and also move location according to alphabetic order. * tests/df/skip-duplicates.sh: Add remote test cases. * NEWS: Mention the change in behavior. Reported in http://bugs.debian.org/737399 Reported in http://bugzilla.redhat.com/920806 Reported in http://bugzilla.opensuse.org/866010 Reported in http://bugzilla.opensuse.org/901905
2014-11-23df: ensure -a shows all remote file system entriesPádraig Brady
commit v8.22-125-g9d736f8 printed placeholder "-" values for device names that didn't match the preferred device name for a particular mount point. However that was seen to erroneously suppress values for aliased host names or exports, common with remote file systems. * src/df.c (me_for_dev): Rename from devname_for_dev() so that we can determine the remoteness as well as the name for the preferred mount entry. (get_dev): Don't output place holder values when both current and preferred mount entries are remote. Reported in http://bugs.debian.org/737399
2014-11-22tests: add a case verifying mv on case insensitive file systemsPádraig Brady
* NEWS: Update the recent entry to also mention the avoidance of incorrectly unlinking a multi-hardlinked "source" file when presented with source and dest that only differ in case. * src/copy.c (same_file_ok): Mention the case issue with same_name(). * tests/mv/hardlink-case.sh: Test the issue on HFS+. * tests/local.mk: Reference the new test case. * tests/mv/vfat: Remove an old related but unused test case.
2014-11-21doc: mention how to avoid newlines impacting ls -1Pádraig Brady
* src/ls.c (usage): Mention the -b and -q options in the -1 description. * doc/coreutils.texi (ls invocation): Likewise.
2014-11-21tests: chcon: avoid false failure with newer selinuxPádraig Brady
file_t is now mapped to unlabeled_t as per: http://danwalsh.livejournal.com/68189.html Therefore use the latter to ensure we match correctly. This is needed on >= Fedora 21 for example, while it also works on earlier releases.
2014-11-21mv: fail when moving a file to a hardlinkBoris Ranto
We may run into a race condition if we treat hard links to the same file as distinct files. If we do 'mv a b' and 'mv b a' in parallel, both a and b can disappear from the file system. The reason is that in this case the unlink on src is called and the system calls can end up being run in the order where unlink(a) and unlink(b) are the last two system calls. Therefore exit with an error code so that we avoid the potential data loss. * src/copy.c (same_file_ok): Don't set unlink_src that was used by mv, and return false for two hardlinks to a file in move_mode. *src/copy.c (copy_internal): No longer honor the unlink_src option, used only by mv. NEWS: Mention the change in behavior. * tests/cp/same-file.sh: Augment to cover the `cp -a hlsl1 sl1` case. * tests/mv/hard-verbose.sh: Remove no longer needed test. * tests/local.mk: Remove the reference to hard-verbose.sh. * tests/mv/hard-4.sh: Adjust so we fail in this case. * tests/mv/i-4.sh: Likewise. * tests/mv/symlink-onto-hardlink-to-self.sh: Likewise.
2014-11-18maint: run strftime syntax check on newer systemsPádraig Brady
* cfg.mk (sc_strftime_check): Adjust regex to handle newer glibc info formatting with different indentation and quoting.