summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2012-03-22maint: ensure PATH_MAX is set correctlyPádraig Brady
This reverts part of commit v8.12-103-g54cbe6e. * src/system.h: Include gnulib's pathmax.h to honor system specific limits, and then we set PATH_MAX only if needed. Note pathmax.h no longer uses pathconf ("/", _PC_PATH_MAX). Note I didn't reinstate the comments about limits.h inclusion order, because pathmax.h includes limits.h anyway.
2012-03-21build: add numerous gnulib modules, mostly for improved portabilityJim Meyering
* bootstrap.conf (gnulib_modules): Add numerous modules for improved portability. Reported by Eric Blake in http://thread.gmane.org/gmane.comp.gnu.coreutils.general/2426/focus=2489 * po/POTFILES.in: Add new files.
2012-03-21build: update gnulib submodule to latestJim Meyering
2012-03-21maint: use more modern fseeko, rather than fseekJim Meyering
* src/tac.c (temp_stream): Use fseeko, not fseek, on principle: use the more modern interface. In general it is better to avoid fseek due to its ABI-imposed 4GiB limit on the "offset", here its use was fine because the offset was always 0. Using fseeko also has the advantage of not triggering a GNULIB_POSIXCHECK warning. Reported by Eric Blake in http://thread.gmane.org/gmane.comp.gnu.coreutils.general/2426/focus=2489
2012-03-20build: speed up configure for releasesEric Blake
Since most users won't be building with GNULIB_POSIXCHECK defined in CFLAGS, and since we can make ./configure 10% (several seconds!) faster by omitting the framework for a posix check, this patch makes it so that the framework is omitted by default, while still giving instructions for maintainers to re-enable it. It's been a while since we've used GNULIB_POSIXCHECK; see this email: https://lists.gnu.org/archive/html/coreutils/2012-03/msg00126.html Some of those failures are because we are intentionally avoiding specific gnulib modules (that is, we have chosen not to use things like fprintf-posix), but until we work with gnulib to avoid particular warnings, wiring up an automatic GNULIB_POSIXCHECK to happen during 'make my-distcheck' is not feasible. * configure.ac (gl_ASSERT_NO_GNULIB_POSIXCHECK): Conditionally define, according to whether $GNULIB_POSIXCHECK is in environment.
2012-03-20tests: avoid spurious misc/factor failure on OpenBSD 5.1Jim Meyering
* tests/misc/factor: Map OpenBSD 5.1's "unknown option" to our expected "invalid option". Reported by Bruno Haible.
2012-03-20maint: remove now-superfluous coreutils-path-check ruleJim Meyering
* dist-check.mk (coreutils-path-check): Now that we set PATH in TESTS_ENVIRONMENT, it seems like overkill to make "distcheck" rerun all tests just to check this. (my-distcheck): Remove sole use.
2012-03-20doc: clarify current realpath --relative-base behaviorEric Blake
For compatibility with MacOS relpath(1), as seen here: http://opensource.apple.com/source/bootstrap_cmds/\ bootstrap_cmds-79/relpath.tproj/relpath.c we implemented 'realpath --relative-base=dir1 --relative-to=dir2 file' in the same way as 'relpath -d dir1 dir2 file'. This can result in --relative-base rendering --relative-to as a no-op if dir1 is a child of dir2. Document this. * doc/coreutils.texi (realpath invocation): Mention restriction.
2012-03-20tests: avoid spurious dd/sparse failurePádraig Brady
* tests/dd/sparse: Allow for greater variation in sparse-block counts. Reported by Nelson H. F. Beebe and Bruno Haible.
2012-03-17tests: fix sort-discrim to work without GMPPádraig Brady
* tests/misc/sort-discrim: The expr limit is intmax_t without GMP.
2012-03-16tests: avoid an ls-time false positive on Solaris 10Pádraig Brady
* tests/misc/ls-time: Force a ctime update as updating the atime doesn't update ctime on tmpfs on Solaris 10.
2012-03-15realpath: optimize --relative-base usageEric Blake
There is no need to recompute for every path being visited whether the base is a prefix of the relative location. * src/realpath.c (relpath): Hoist base check... (main): ...here. Based on a suggestion by Pádraig Brady.
2012-03-15realpath: let --relative-to default to --relative-baseEric Blake
Most of the time, if someone wants to filter which paths are relative while leaving all others absolute, they also want to to the filtering based on the same --relative-to directory. Make this easier to specify. * src/realpath.c (main): Convert error to default. * doc/coreutils.texi (realpath invocation): Document this. * tests/misc/realpath: Adjust test to match. * NEWS: Document it.
2012-03-15tests: cover more realpath scenariosEric Blake
'realpath --relative-base --relative-to' is identical to --relative-base=--relative-to, so the test wasn't covering what it claimed. Expose recent fixes for handling of // on systems where // is distinct, and for --relative-base=/. Add test that exposes our design decision that --relative-base that is not a prefix of --relative-to is a no-op (if we later change behavior, we will also have to change that part of the test). * tests/misc/realpath: Fix typo. Add some tests.
2012-03-15realpath: fix problems with root handlingEric Blake
When --relative-base is /, all other paths should be treated as relative (except for // where it matters). Also, on platforms like Cygwin where / and // are distinct, realpath was incorrectly collapsing // into /. http://debbugs.gnu.org/10472. * src/realpath.c (path_prefix, path_common_prefix): Treat / and // as having no common match. (relpath): Allow for no match even without --relative-base. * NEWS: Document this.
2012-03-14test: expose recent gnulib canonicalize bugEric Blake
https://lists.gnu.org/archive/html/bug-gnulib/2012-02/msg00038.html detailed a couple of bugs in gnulib's canonicalize that were visible through coreutils' readlink, but only on systems where // is distinct from /. This particular test assumes the POSIX fix which requires canonicalization of a symlink containing just slashes to behave as if slashes separating the symlink from the rest of the name are elided (see http://austingroupbugs.net/view.php?id=541), as that is the only useful (and current) behavior on Cygwin. That is, ln -s / root ls root/dev must list the contents of /dev, not //dev. * tests/misc/readlink-root: New test. * tests/Makefile.am (TESTS): Run it.
2012-03-13tests: new discriminator-based test for sort -n and -hPaul Eggert
* tests/Makefile.am (TESTS): Add misc/sort-discrim. * tests/misc/sort-discrim: New file, which tests a discriminator-based implementation of 'sort'. Coreutils doesn't use this implementation yet, but the test is useful anyway. Co-authored-by: Drew Kutilek <dkutilek@ucla.edu> Co-authored-by: James Wendt <jwendt@cs.ucla.edu>
2012-03-10dirname: support more than one argumentJérémy Compostella
* src/dirname.c (main): Handle new -z option and manage more than one argument. * doc/coreutils.texi (dirname invocation): Mention it. * NEWS (New features): Mention it. * tests/misc/dirname: Add a two arguments test.
2012-03-10split: support an arbitrary number of split files by defaultJérémy Compostella
* src/split.c (next_file_name): If `suffix_auto' is true and the first suffix character is 'z', generate a new file file name adding `z' to the prefix and increasing the suffix length by one. (set_suffix_length): Disable auto suffix width in various cases. * tests/split/suffix-auto-length: Test it. * doc/coreutils.texi (split invocation): Mention it. * NEWS (Improvements): Likewise.
2012-03-09doc: add missing documentation for basename -zJérémy Compostella
doc/coreutils.texi (basename invocation): Add -z option documentation.
2012-03-09maint: fix a version number typo in NEWSBernhard Voelker
* NEWS: s/8.14/8.15/
2012-03-08chmod: add notations +40, 00440, etc.Paul Eggert
* NEWS: Document this. * doc/perm.texi (Operator Numeric Modes): New section. (Numeric Modes, Directory Setuid and Setgid): Document new behavior. * src/chmod.c (usage): Document new behavior. (main): Support new options -0, -1, etc. * tests/chmod/setgid: Test these new features.
2012-03-08build: update gnulib submodule to latestPaul Eggert
2012-03-08du: fix -x: don't ignore non-directory argumentsJim Meyering
Surprise! "du -x non-DIR" would print nothing. Note that the problem arises only when processing a non-directory specified on the command line. Not surprisingly, "du -x" still works as expected for any directory argument. When performing its same-file-system check, du may skip an entry only if it is at fts_level 1 or greater. Command-line arguments are at fts_level == 0 (FTS_ROOTLEVEL). * src/du.c (process_file): Don't use the top-level FTS->fts_dev when testing for --one-file-system (-x). It happens to be valid for directories, but it is always 0 for a non-directory. * tests/du/one-file-system: Add tests for this. * NEWS (Bug fixes): Mention it. Reported by Daniel Stavrovski in http://bugs.gnu.org/10967. Introduced by commit v8.14-95-gcfe1040.
2012-03-07maint: use an optimal-for-coreutils xz compression settingJim Meyering
* cfg.mk: Set XZ_OPT = -8e (determined empirically). This sacrifices 8 KiB of compressed tarball size for a 32-MiB decrease in the memory required during decompression. I.e., using -9e would shave off only 8 KiB from the tar.xz file, yet would force every decompression process to use 32 MiB more memory.
2012-03-07basename: support more than one argumentJérémy Compostella
* src/basename.c (perform_basename): New function refactored from main() that performs the basename work on a STRING, optionally removes a trailing SUFFIX and outputs the result. (main): Handle new options. * doc/coreutils.texi (basename invocation): Mention new options. * test/misc/basename: Add new options test cases. * NEWS (New features): Mention it.
2012-03-06maint: refactor copy to use is_nul()Pádraig Brady
* src/dd.c: Move is_nul() from here to ... * src/system.h: ... here * src/copy.c (sparse_copy): Adjust to use the refactored is_nul()
2012-03-02tests: work around a block alignment issue in dd/sparsePádraig Brady
Prompted by the continuous integration build failure at: http://hydra.nixos.org/build/2188210 (which uses XFS). * tests/dd/sparse (alloc_equal): Add a block allocation comparison function that accounts for variations due to alignment.
2012-02-29doc: timeout: document the exit status when run with "-s KILL"Rodrigo Campos
* src/timeout.c (usage): Document the exit status for this case, in --help and thus in the man page. Word so that it covers both the -s9 and -k options. * doc/coreutils.texi (timeout invocation): Document the exit status for this case.
2012-02-29tests: compile and link shared object with $CC to make LD_PRELOAD workBernhard Voelker
* tests/ls/getxattr-speedup: Compile and link in one step with $CC. If the shared object file is created by ld (binutils), then the destructor print_call_count() may not run (seen on OpenSuSE 12.1). See http://lists.opensuse.org/opensuse/2012-02/msg01342.html Thanks to Cristian Rodríguez.
2012-02-29dd: add support for the conv=sparse optionRoman Rybalko
Notes: Small seeks are not coalesced to larger ones, like is done in cache_round() for example. conv= is used rather then oflag= for FreeBSD compatibility. * src/dd.c (final_op_was_seek): A new global boolean to flag whether the final "write" was converted to a seek. (usage): Describe the new conf=sparse option. (iwrite): Convert a write of a NUL block to a seek if requested. (do_copy): Initialize the output buffer to have a sentinel, to allow for efficient testing for NUL output blocks. If the last block in the file was converted to a seek, then convert back to a write so the size is updated. * NEWS: Mention the new feature. * tests/dd/sparse: A new test for the feature. * tests/Makefile.am: Reference the new test.
2012-02-27doc: fix a wrong option reference in split invocationJérémy Compostella
* doc/coreutils.texi (split invocation): replace `-r' reference with `-nr/n'.
2012-02-26tests: fix help-version on cygwin, where $EXEEXT is nonemptyJim Meyering
* tests/misc/help-version: Remove the $EXEEXT suffix from each program name before comparing with a literal.
2012-02-26tests: remove unnecessary use of -lcBernhard Voelker
* tests/ls/getxattr-speedup: Remove unneeded use of -lc.
2012-02-25sort: default to physmem/8, not physmem/16Paul Eggert
* src/sort.c (default_sort_size): Don't divide advice by 2. Just divide the hard limits by 2. This matches the comments. Reported by Rogier Wolff in http://bugs.gnu.org/10877
2012-02-24doc: clarify a comment in system.hJim Meyering
* src/system.h (STRNCMP_LIT): Clarify comment. Suggested by Bruno Haible.
2012-02-20split: add the --additional-suffix optionJérémy Compostella
Add the --additional-suffix option, to append an additional static suffix to output file names. * src/split.c (next_file_name): Append suffix to output file names. (main): Handle new --additional-suffix option. * NEWS (New features): Mention it. * doc/coreutils.texi (split invocation): Mention it. * tests/split/additional-suffix: New file. Test --additional-suffix. * tests/Makefile.am (TESTS): Add it. Requested by Peng Yu, in bug 6554
2012-02-20ls: adjust errnos indicating device non support for xattrsPádraig Brady
* src/ls.c (errno_unsupported): Remove EBUSY, as this caters for the case where ACLs can't be accessed because the _file_ is locked. http://lists.gnu.org/archive/html/bug-coreutils/2005-06/msg00191.html Also ENOENT is not safe to include as you get that if the _file_ is removed between the stat() and subsequent querying of xattrs.
2012-02-19tests: ls/getxattr-speedup: include <sys/types.h> for older headersJérémy Compostella
Modern <stdio.h> provides ssize_t, but the one from Debian's libc6-dev 2.11.2-10 apparently does not. * tests/ls/getxattr-speedup: Also include <sys/types.h>.
2012-02-18doc: fix file names in split --filter=command exampleJérémy Compostella
* doc/coreutils.texi (split invocation): Output file names should be prefixed with `big-' not `big-x'.
2012-02-18tests: test for ls speed-upJim Meyering
* tests/ls/getxattr-speedup: New test. * tests/Makefile.am (TESTS): Add it. Improved-by: Bernhard Voelker
2012-02-18ls: cache ACL- and CAP-querying syscall failuresJim Meyering
Like the optimization to avoid always-failing getfilecon calls, this change avoids always-failing queries for whether a file has a nontrivial ACL and for whether a file has certain "capabilities". When such a query fails for one file (indicating no support), we know it will always fail that way for the affected device. With this change, we have thus eliminated nearly all failing-unsupported getxattr syscalls. * src/ls.c (has_capability) [!HAVE_CAP]: Set errno to ENOTSUP. (errno_unsupported): Expand the list of E* errno values to match that of lib/acl-internal.h's ACL_NOT_WELL_SUPPORTED macro. (file_has_acl_cache, has_capability_cache): New functions. (gobble_file): Use them in place of non-caching ones. * NEWS (Improvements): Mention it. Suggested by Sven Breuner in http://thread.gmane.org/gmane.comp.gnu.coreutils.general/2187 While eliminating most getfilecon calls saved about 33%, eliminating these other calls can save almost all of the remaining ~67% cost, on some remote file systems.
2012-02-18ls: optimize for when getfilecon would often fail (~33% perf. gain)Jim Meyering
On systems or file systems without SELinux support, all getfilecon and lgetfilecon calls would fail due to lack of support. We can non- invasively cache such failure (on most recently accessed device) and avoid the vast majority of the failing underlying getxattr syscalls. * src/ls.c (errno_unsupported): New function. (selinux_challenged_device): New file-scoped global. (getfilecon_cache, lgetfilecon_cache): New error-caching wrapper functions. (gobble_file): Use the caching wrappers, for when many *getfilecon calls would fail with ENOTSUP or EOPNOTSUPP. Suggested by Sven Breuner in http://thread.gmane.org/gmane.comp.gnu.coreutils.general/2187 Improved-by: Pádraig Brady.
2012-02-18split: support optional start value for --numeric-suffixesJérémy Compostella
Allow changing the --numeric-suffixes start number from the default of 0. * src/split.c (next_file_name): Initialize the suffix index and the output filename according to start value. (main): Check that the suffix length is large enough for the numerical suffix start value. * doc/coreutils.texi (split invocation): Mention it. * NEWS (New features): Mention it. * tests/split/numeric: New file. Test --numeric-suffixes[=FROM]. * tests/Makefile.am (TESTS): Reference the new test.
2012-02-17doc: fix a typo about seek_bytes in NEWSPádraig Brady
* NEWS: s/count_bytes/seek_bytes/2
2012-02-16doc: improve 'rm -f' descriptionBernhard Voelker
* doc/coreutils.texi (rm invocation): Mention that the -f option also silences the message for missing operands, which is useful in scripts e.g., for "rm -f $file_list" when $file_list is empty. * src/rm.c (usage): Likewise. Reported by Jérémy Magrin in http://bugs.gnu.org/10819
2012-02-13dd: fix issues in the count_bytes and seek_bytes flags changePádraig Brady
These edge cases were missed in the previous commit 140eca15c. * src/dd.c (main): Include the bytes slop when truncating without further I/O. Don't invalidate the whole file cache in the case where 0 < count < ibs. * tests/dd/bytes: Change to using the independent truncate command to generate the file for comparison. Remove a redundant test case and replace with one testing the truncation only logic.
2012-02-12dd: add count_bytes, skip_bytes and seek_bytes flagsJérémy Compostella
dd now accepts the count_bytes and skip_bytes input flag and the seek_bytes output flag, to more easily allow processing portions of a file. * src/dd.c (scanargs): Compute skip_records and skip_bytes when 'skip_bytes' iflag is used. Compute max_records and max_bytes when 'count_bytes' iflag is used. Compute seek_records and seek_bytes when 'seek_bytes' oflag is used. (skip_via_lseek): Use new 'bytes' parameter and handle potential 'records' equals to zero. Update the bytes parameter when called with 'fdesc' equal to STDOUT_FILENO. Update the header comments. (dd_copy): Skip accordingly to skip_records AND skip_bytes. Count accordingly to max_records AND max_bytes. Seek on output accordingly to seek_records AND seek_bytes. * NEWS (New features): Mention it. * doc/coreutils.texi (dd invocation): Detail new flags and behaviors. * tests/dd/bytes: New file. Tests for these new flags. * tests/Makefile.am (TESTS): Add it.
2012-02-12build: correct @@-,length values in last hunk of regcomp.c.diffJim Meyering
* gl/lib/regcomp.c.diff: Correct invalid hunk lengths (s/1/7/g) in the last hunk's @@-line.
2012-02-12build: update gnulib, bootstrap, gl/lib/regcomp.c.diffJim Meyering
* gnulib: Update submodule to latest. * bootstrap: Update from gnulib. * gl/lib/regcomp.c.diff: Adapt to gnulib changes.