platform/upstream/coreutils.git
12 years agomaint: use more modern fseeko, rather than fseek
Jim Meyering [Tue, 20 Mar 2012 18:21:01 +0000 (19:21 +0100)]
maint: use more modern fseeko, rather than fseek

* 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

12 years agobuild: speed up configure for releases
Eric Blake [Mon, 24 Jan 2011 18:07:51 +0000 (11:07 -0700)]
build: speed up configure for releases

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.

12 years agotests: avoid spurious misc/factor failure on OpenBSD 5.1
Jim Meyering [Sat, 17 Mar 2012 16:05:41 +0000 (17:05 +0100)]
tests: avoid spurious misc/factor failure on OpenBSD 5.1

* tests/misc/factor: Map OpenBSD 5.1's "unknown option" to our
expected "invalid option".  Reported by Bruno Haible.

12 years agomaint: remove now-superfluous coreutils-path-check rule
Jim Meyering [Sat, 17 Mar 2012 11:06:56 +0000 (12:06 +0100)]
maint: remove now-superfluous coreutils-path-check rule

* 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.

12 years agodoc: clarify current realpath --relative-base behavior
Eric Blake [Wed, 14 Mar 2012 20:02:59 +0000 (14:02 -0600)]
doc: clarify current realpath --relative-base behavior

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.

12 years agotests: avoid spurious dd/sparse failure
Pádraig Brady [Sat, 17 Mar 2012 16:04:21 +0000 (17:04 +0100)]
tests: avoid spurious dd/sparse failure

* tests/dd/sparse: Allow for greater variation in sparse-block counts.
Reported by Nelson H. F. Beebe and Bruno Haible.

12 years agotests: fix sort-discrim to work without GMP
Pádraig Brady [Fri, 16 Mar 2012 11:23:13 +0000 (11:23 +0000)]
tests: fix sort-discrim to work without GMP

* tests/misc/sort-discrim: The expr limit is intmax_t without GMP.

12 years agotests: avoid an ls-time false positive on Solaris 10
Pádraig Brady [Fri, 16 Mar 2012 12:51:04 +0000 (12:51 +0000)]
tests: avoid an ls-time false positive on Solaris 10

* tests/misc/ls-time: Force a ctime update as updating
the atime doesn't update ctime on tmpfs on Solaris 10.

12 years agorealpath: optimize --relative-base usage
Eric Blake [Wed, 14 Mar 2012 19:42:59 +0000 (13:42 -0600)]
realpath: optimize --relative-base usage

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.

12 years agorealpath: let --relative-to default to --relative-base
Eric Blake [Wed, 14 Mar 2012 19:42:59 +0000 (13:42 -0600)]
realpath: let --relative-to default to --relative-base

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.

12 years agotests: cover more realpath scenarios
Eric Blake [Wed, 14 Mar 2012 03:51:47 +0000 (21:51 -0600)]
tests: cover more realpath scenarios

'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.

12 years agorealpath: fix problems with root handling
Eric Blake [Sat, 4 Feb 2012 18:50:53 +0000 (11:50 -0700)]
realpath: fix problems with root handling

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.

12 years agotest: expose recent gnulib canonicalize bug
Eric Blake [Mon, 6 Feb 2012 23:27:48 +0000 (16:27 -0700)]
test: expose recent gnulib canonicalize bug

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.

12 years agotests: new discriminator-based test for sort -n and -h
Paul Eggert [Sun, 11 Mar 2012 23:30:22 +0000 (16:30 -0700)]
tests: new discriminator-based test for sort -n and -h

* 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>
12 years agodirname: support more than one argument
Jérémy Compostella [Fri, 9 Mar 2012 18:21:42 +0000 (19:21 +0100)]
dirname: support more than one argument

* 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.

12 years agosplit: support an arbitrary number of split files by default
Jérémy Compostella [Thu, 1 Mar 2012 19:37:41 +0000 (20:37 +0100)]
split: support an arbitrary number of split files by default

* 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.

12 years agodoc: add missing documentation for basename -z
Jérémy Compostella [Fri, 9 Mar 2012 15:05:20 +0000 (16:05 +0100)]
doc: add missing documentation for basename -z

doc/coreutils.texi (basename invocation): Add -z option documentation.

12 years agomaint: fix a version number typo in NEWS
Bernhard Voelker [Fri, 9 Mar 2012 06:33:54 +0000 (07:33 +0100)]
maint: fix a version number typo in NEWS

* NEWS: s/8.14/8.15/

12 years agochmod: add notations +40, 00440, etc.
Paul Eggert [Fri, 9 Mar 2012 03:00:27 +0000 (19:00 -0800)]
chmod: add notations +40, 00440, etc.

* 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.

12 years agobuild: update gnulib submodule to latest
Paul Eggert [Fri, 9 Mar 2012 02:47:44 +0000 (18:47 -0800)]
build: update gnulib submodule to latest

12 years agodu: fix -x: don't ignore non-directory arguments
Jim Meyering [Thu, 8 Mar 2012 09:33:50 +0000 (10:33 +0100)]
du: fix -x: don't ignore non-directory arguments

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.

12 years agomaint: use an optimal-for-coreutils xz compression setting
Jim Meyering [Sat, 3 Mar 2012 08:41:31 +0000 (09:41 +0100)]
maint: use an optimal-for-coreutils xz compression setting

* 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.

12 years agobasename: support more than one argument
Jérémy Compostella [Sun, 4 Mar 2012 19:00:36 +0000 (20:00 +0100)]
basename: support more than one argument

* 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.

12 years agomaint: refactor copy to use is_nul()
Pádraig Brady [Thu, 1 Mar 2012 11:56:41 +0000 (11:56 +0000)]
maint: refactor copy to use is_nul()

* 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()

12 years agotests: work around a block alignment issue in dd/sparse
Pádraig Brady [Fri, 2 Mar 2012 10:53:48 +0000 (10:53 +0000)]
tests: work around a block alignment issue in dd/sparse

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.

12 years agodoc: timeout: document the exit status when run with "-s KILL"
Rodrigo Campos [Wed, 29 Feb 2012 14:36:18 +0000 (11:36 -0300)]
doc: timeout: document the exit status when run with "-s KILL"

* 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.

12 years agotests: compile and link shared object with $CC to make LD_PRELOAD work
Bernhard Voelker [Mon, 27 Feb 2012 20:13:10 +0000 (21:13 +0100)]
tests: compile and link shared object with $CC to make LD_PRELOAD work

* 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.

12 years agodd: add support for the conv=sparse option
Roman Rybalko [Mon, 27 Feb 2012 13:53:07 +0000 (13:53 +0000)]
dd: add support for the conv=sparse option

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.

12 years agodoc: fix a wrong option reference in split invocation
Jérémy Compostella [Sun, 26 Feb 2012 14:05:36 +0000 (15:05 +0100)]
doc: fix a wrong option reference in split invocation

* doc/coreutils.texi (split invocation): replace `-r' reference with
`-nr/n'.

12 years agotests: fix help-version on cygwin, where $EXEEXT is nonempty
Jim Meyering [Sun, 19 Feb 2012 17:32:54 +0000 (18:32 +0100)]
tests: fix help-version on cygwin, where $EXEEXT is nonempty

* tests/misc/help-version: Remove the $EXEEXT suffix from each
program name before comparing with a literal.

12 years agotests: remove unnecessary use of -lc
Bernhard Voelker [Fri, 24 Feb 2012 11:22:20 +0000 (12:22 +0100)]
tests: remove unnecessary use of -lc

* tests/ls/getxattr-speedup: Remove unneeded use of -lc.

12 years agosort: default to physmem/8, not physmem/16
Paul Eggert [Sat, 25 Feb 2012 18:32:52 +0000 (10:32 -0800)]
sort: default to physmem/8, not physmem/16

* 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

12 years agodoc: clarify a comment in system.h
Jim Meyering [Fri, 24 Feb 2012 09:02:18 +0000 (10:02 +0100)]
doc: clarify a comment in system.h

* src/system.h (STRNCMP_LIT): Clarify comment.
Suggested by Bruno Haible.

12 years agosplit: add the --additional-suffix option
Jérémy Compostella [Sun, 19 Feb 2012 12:52:47 +0000 (13:52 +0100)]
split: add the --additional-suffix option

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

12 years agols: adjust errnos indicating device non support for xattrs
Pádraig Brady [Mon, 20 Feb 2012 12:33:17 +0000 (12:33 +0000)]
ls: adjust errnos indicating device non support for xattrs

* 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.

12 years agotests: ls/getxattr-speedup: include <sys/types.h> for older headers
Jérémy Compostella [Sun, 19 Feb 2012 14:38:15 +0000 (15:38 +0100)]
tests: ls/getxattr-speedup: include <sys/types.h> for older headers

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>.

12 years agodoc: fix file names in split --filter=command example
Jérémy Compostella [Sat, 18 Feb 2012 18:59:52 +0000 (19:59 +0100)]
doc: fix file names in split --filter=command example

* doc/coreutils.texi (split invocation): Output file names should be
prefixed with `big-' not `big-x'.

12 years agotests: test for ls speed-up
Jim Meyering [Mon, 13 Feb 2012 11:52:19 +0000 (12:52 +0100)]
tests: test for ls speed-up

* tests/ls/getxattr-speedup: New test.
* tests/Makefile.am (TESTS): Add it.
Improved-by: Bernhard Voelker
12 years agols: cache ACL- and CAP-querying syscall failures
Jim Meyering [Mon, 13 Feb 2012 11:05:40 +0000 (12:05 +0100)]
ls: cache ACL- and CAP-querying syscall failures

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.

12 years agols: optimize for when getfilecon would often fail (~33% perf. gain)
Jim Meyering [Sat, 11 Feb 2012 11:36:57 +0000 (12:36 +0100)]
ls: optimize for when getfilecon would often fail (~33% perf. gain)

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.
12 years agosplit: support optional start value for --numeric-suffixes
Jérémy Compostella [Sun, 29 Jan 2012 14:20:31 +0000 (15:20 +0100)]
split: support optional start value for --numeric-suffixes

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.

12 years agodoc: fix a typo about seek_bytes in NEWS
Pádraig Brady [Fri, 17 Feb 2012 11:28:01 +0000 (11:28 +0000)]
doc: fix a typo about seek_bytes in NEWS

* NEWS: s/count_bytes/seek_bytes/2

12 years agodoc: improve 'rm -f' description
Bernhard Voelker [Thu, 16 Feb 2012 12:29:44 +0000 (13:29 +0100)]
doc: improve 'rm -f' description

* 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

12 years agodd: fix issues in the count_bytes and seek_bytes flags change
Pádraig Brady [Mon, 13 Feb 2012 21:47:28 +0000 (21:47 +0000)]
dd: fix issues in the count_bytes and seek_bytes flags change

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.

12 years agodd: add count_bytes, skip_bytes and seek_bytes flags
Jérémy Compostella [Sat, 4 Feb 2012 14:25:54 +0000 (15:25 +0100)]
dd: add count_bytes, skip_bytes and seek_bytes flags

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.

12 years agobuild: correct @@-,length values in last hunk of regcomp.c.diff
Jim Meyering [Sun, 12 Feb 2012 13:37:00 +0000 (14:37 +0100)]
build: correct @@-,length values in last hunk of regcomp.c.diff

* gl/lib/regcomp.c.diff: Correct invalid hunk lengths (s/1/7/g)
in the last hunk's @@-line.

12 years agobuild: update gnulib, bootstrap, gl/lib/regcomp.c.diff
Jim Meyering [Sat, 11 Feb 2012 09:43:50 +0000 (10:43 +0100)]
build: update gnulib, bootstrap, gl/lib/regcomp.c.diff

* gnulib: Update submodule to latest.
* bootstrap: Update from gnulib.
* gl/lib/regcomp.c.diff: Adapt to gnulib changes.

12 years agomv: "mv A B" would sometimes succeed, yet A would remain, ...
Jim Meyering [Wed, 1 Feb 2012 20:42:45 +0000 (21:42 +0100)]
mv: "mv A B" would sometimes succeed, yet A would remain, ...

But only when both A and B were hard links to the same symlink.
* src/copy.c (same_file_ok): Handle another special case: the one
in which we are moving a symlink onto a hard link to itself.
In this case, we must explicitly tell the caller to unlink the
source file.  Otherwise, at least the linux-3.x kernel rename
function would do nothing, as mandated by POSIX 2008.
* tests/mv/symlink-onto-hardlink-to-self: New test.
* tests/Makefile.am (TESTS): Add it.
* NEWS (Bug fixes): Mention it.
Reported by Bernhard Voelker in http://bugs.gnu.org/10686

12 years agomaint: add braces as requested by HACKING coding standard
Jérémy Compostella [Sun, 5 Feb 2012 16:53:55 +0000 (17:53 +0100)]
maint: add braces as requested by HACKING coding standard

* src/dd.c (dd_copy): Braces were missing for this do/while statement.

12 years agodoc: clarify --help output for some optional arguments
Pádraig Brady [Mon, 30 Jan 2012 11:59:04 +0000 (11:59 +0000)]
doc: clarify --help output for some optional arguments

* src/pr.c (usage): Fix the -S description to indicate
that the argument is optional for the short option.
* doc/coreutils.texi (pr invocation): Likewise.
* src/od.c (usage): Fix the -S description to indicate
that the argument is required for the short option.
Clarify -w takes an argument and that it is optional.

12 years agomaint: sort: remove the last uses of "'%s'" in diagnostics
Jim Meyering [Mon, 30 Jan 2012 11:48:20 +0000 (12:48 +0100)]
maint: sort: remove the last uses of "'%s'" in diagnostics

* src/sort.c (key_warnings): Use quote (quote_n, since there are two)
rather than literal single quotes ('%s') in diagnostic.

12 years agomv: allow moving symlink onto same-inode dest with >= 2 hard links
Jim Meyering [Thu, 5 Jan 2012 10:45:50 +0000 (11:45 +0100)]
mv: allow moving symlink onto same-inode dest with >= 2 hard links

Normally, mv detects a few subtle cases in which proceeding with a
same-file rename would, with very high probability, cause data loss.
Here, we have found a corner case in which one of these same-inode
tests makes mv refuse to perform a useful operation.  Permit that
corner case.
* src/copy.c (same_file_ok): Detect/exempt this case.
* tests/mv/symlink-onto-hardlink: New test.
* tests/Makefile.am (TESTS): Add it.
* NEWS (Bug fixes): Mention it.
Initially reported by: Matt McCutchen in http://bugs.gnu.org/6960.
Raised again by Anders Kaseorg due to http://bugs.debian.org/654596.
Improved-by: Paul Eggert.
12 years agobuild: update gnulib, for syntax-check vs canonicalize fix
Jim Meyering [Mon, 30 Jan 2012 07:36:11 +0000 (08:36 +0100)]
build: update gnulib, for syntax-check vs canonicalize fix

12 years agomaint: use single copyright year range
Jim Meyering [Fri, 27 Jan 2012 10:35:24 +0000 (11:35 +0100)]
maint: use single copyright year range

Run "make update-copyright".

12 years agomaint: make copyright statements more consistent; update gnulib
Jim Meyering [Fri, 27 Jan 2012 10:33:11 +0000 (11:33 +0100)]
maint: make copyright statements more consistent; update gnulib

* cfg.mk (update-copyright-env): Add UPDATE_COPYRIGHT_FORCE=1
to rejoin some split lines, and UPDATE_COPYRIGHT_USE_INTERVALS=2
to make update-copyright use only one year range.
* gnulib: Update to latest, for newer update-copyright script.

12 years agomaint: fix copyright in old fileutils ChangeLog
Jim Meyering [Fri, 27 Jan 2012 07:47:28 +0000 (08:47 +0100)]
maint: fix copyright in old fileutils ChangeLog

* old/fileutils/ChangeLog-1997: Insert omitted "Free Software" in
the name of the copyright holder.  Compress year range.

12 years agomaint: remove some redundant automake _SOURCES
Pádraig Brady [Thu, 26 Jan 2012 00:00:55 +0000 (00:00 +0000)]
maint: remove some redundant automake _SOURCES

* src/Makefile.am: Remove auto generated entries.

12 years agomaint: cleanup an extraneous version output in a test
Pádraig Brady [Wed, 25 Jan 2012 23:13:58 +0000 (23:13 +0000)]
maint: cleanup an extraneous version output in a test

* test/misc/stdbuf: Fixup the minor copy & paste issue
introduced in commit ff7f0ff8

12 years agorealpath: avoid the use of printf
Pádraig Brady [Wed, 25 Jan 2012 19:49:50 +0000 (19:49 +0000)]
realpath: avoid the use of printf

This was seen to give an 11% performance improvement.

* src/realpath.c (relpath): Avoid using printf.
(process_path): Likewise.

12 years agomaint: use the standard require_perl_ function
Pádraig Brady [Tue, 24 Jan 2012 14:32:42 +0000 (14:32 +0000)]
maint: use the standard require_perl_ function

* tests/cp/sparse-fiemap: Don't use a separate check.

12 years agorealpath: remove extraneous '/' for --relative-to edge cases
Pádraig Brady [Wed, 25 Jan 2012 16:42:42 +0000 (16:42 +0000)]
realpath: remove extraneous '/' for --relative-to edge cases

* src/realpath.c (path_common_prefix): Be consistent and
always include a leading '/' in the count returned.
(relpath): Account for the change in path_common_prefix()
and avoid outputting extra '/' chars in relative paths that
span the root dir.
* tests/misc/realpath: Add the two reported cases.
Reported by Mike Frysinger

12 years agobuild: update gnulib to latest, for test warning fixes
Jim Meyering [Mon, 23 Jan 2012 16:59:49 +0000 (17:59 +0100)]
build: update gnulib to latest, for test warning fixes

See http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/29810
for details.

12 years agotests: remove crufty test=test_name code from old tests
Jim Meyering [Mon, 23 Jan 2012 13:42:10 +0000 (14:42 +0100)]
tests: remove crufty test=test_name code from old tests

Before init.sh and similar, we would set test=test_name, and then
construct temporary file names using $test.  Now that each
init.sh-using test is in its own directory, that practice is unwelcome.
Remove bad examples.
* tests/rm/f-1: Per above.
* tests/rm/i-1: Likewise.
* tests/rm/interactive-always: Likewise.
* tests/rm/interactive-once: Likewise.
* tests/rm/ir-1: Likewise.
* tests/rm/r-1: Likewise.

12 years agomaint: quote 'like this' or "like this", not `like this'
Paul Eggert [Sun, 22 Jan 2012 23:26:00 +0000 (15:26 -0800)]
maint: quote 'like this' or "like this", not `like this'

* doc/coreutils.texi (Formatting the file names):
coreutils now quotes 'like this'.
* man/help2man:
* src/timeout.c (usage): Quote 'like this' in diagnostics.
* HACKING, Makefile.am, NEWS, README, README-hacking, TODO, cfg.mk:
* doc/Makefile.am, doc/coreutils.texi, m4/jm-macros.m4:
* man/Makefile.am, man/help2man, src/Makefile.am, src/copy.h:
* src/extract-magic, src/ls.c, src/pinky.c, src/pr.c, src/sort.c:
* src/split.c, src/timeout.c, src/who.c, tests/dd/skip-seek-past-file:
* tests/pr/pr-tests: Quote 'like this' in commentary.
* cfg.mk (old_NEWS_hash): Update due to changed old NEWS.

12 years agostat: clarify the description of the %o stat format
Pádraig Brady [Fri, 20 Jan 2012 14:22:56 +0000 (14:22 +0000)]
stat: clarify the description of the %o stat format

* src/stat.c (usage):  Indicate this is a transfer size
suggestion, rather than some persistent block size.
* doc/coreutils.texi (stat invocation): Likewise.

12 years agodoc: tweak an @uref so its alt reference text renders in info
Jim Meyering [Sat, 14 Jan 2012 19:52:27 +0000 (20:52 +0100)]
doc: tweak an @uref so its alt reference text renders in info

* doc/coreutils.texi (Opening the software toolbox): Remove commas
from @uref argument, so the alternate text renders properly in info.
Reported by Reuben Thomas.

12 years agomaint: fix minor whitespace issues
Pádraig Brady [Wed, 11 Jan 2012 15:29:18 +0000 (15:29 +0000)]
maint: fix minor whitespace issues

The previous commit introduced a couple of spacing issues,
luckily one of which caused a test to fail.

* src/stat.c (default_format): Add a space so times are aligned.
* src/tr.c (string2_extentd): Remove an extraneous space.

12 years agomaint: adjust formatting of certain continued strings
Jim Meyering [Mon, 9 Jan 2012 21:56:54 +0000 (22:56 +0100)]
maint: adjust formatting of certain continued strings

Add a rule to ding any source file that has a continued string
with a word in the first column of the following line.
Those tend to trigger malfunction in tools that try to map an
arbitrary line number to an enclosing function name.  Of course,
very many strings do precisely this, *when they are part of the
usage function*.  So we exempt the body of each usage function.
* src/dircolors.c (main): Separate a long, continued string
into two separately-quoted parts.
* src/od.c (decode_one_format): Likewise.
(decode_one_format, main): Move a space from end of
preceding line to the beginning of the continued line.
* src/tr.c (unquote, string2_extend, validate): Likewise.
* src/seq.c (main): Split in two and use string concatenation.
* src/stat.c (default_format): Use a mix of techniques.
* cfg.mk (sc_prohibit_continued_string_alpha_in_column_1): New rule.
Exempt three files in src: system.h, od.c, printf.c.

12 years agomaint: straggler *.[ch] files: convert more `...' to '...'
Jim Meyering [Mon, 9 Jan 2012 21:38:24 +0000 (22:38 +0100)]
maint: straggler *.[ch] files: convert more `...' to '...'

The preceding commands ignored .[ch] files in lib/ and gl/.
This is what I should have been doing from the start:

  git grep -l '`.*'\' $(g ls-files |grep '\.[ch]$') \
    | xargs perl -pi -e 's/`(.+?'\'')/'\''$1/'

12 years agomaint: src/*.[ch]: convert more `...' to '...'
Jim Meyering [Sun, 8 Jan 2012 20:03:22 +0000 (21:03 +0100)]
maint: src/*.[ch]: convert more `...' to '...'

Run this (twice):
  git grep -E -l '`.+'\' src/*.[ch] \
    |xargs perl -pi -e 's/`(.+?'\'')/'\''$1/'

12 years agomaint: src/*.c: change remaining quotes (without embedded spaces)
Jim Meyering [Sun, 8 Jan 2012 14:08:30 +0000 (15:08 +0100)]
maint: src/*.c: change remaining quotes (without embedded spaces)

Run this (twice):
  git grep -E -l '`[^ ]+'\' src/*.c \
    |xargs perl -pi -e 's/`([^ ]+'\'')/'\''$1/'

12 years agomaint: convert `...' to '...' in --help output
Jim Meyering [Sun, 8 Jan 2012 13:08:03 +0000 (14:08 +0100)]
maint: convert `...' to '...' in --help output

All affected lines end with \ or \n\, so run this command
until it produces no new changes (4 times):
  git grep -E -l '`[^ ]+'\''.*\\' src \
    |xargs perl -pi -e 's/`([^ ]+'\''.*\\)/'\''$1/'

12 years agomaint: adjust quoting: emit '...', not `...' in diagnostics
Jim Meyering [Sat, 7 Jan 2012 17:30:14 +0000 (18:30 +0100)]
maint: adjust quoting: emit '...', not `...' in diagnostics

* src/csplit.c (parse_repeat_count, extract_regexp): As above.
* src/date.c (main): Likewise.
* src/ls.c (decode_switches): Likewise.
* src/od.c (decode_one_format, main): Likewise.
* src/pathchk.c (no_leading_hyphen): Likewise.
* src/pr.c (main, getoptarg): Likewise.
* src/rm.c (diagnose_leading_hyphen): Likewise.
* src/sort.c (key_warnings, incompatible_options, main): Likewise.
* src/stat.c (print_esc_char): Print '\x', not `\x' in diagnostic.
* src/test.c (main): Likewise.
* src/touch.c (main): Likewise.
* src/tr.c (build_spec_list, validate, append_range): Likewise.
* tests/misc/mktemp: This is an unusual case, since the affected
string contains only the ` of an `...' string.  So we change
the long ` to a lone '.
* tests/pr/pr-tests: Manual quote adapting fix-up.
* tests/ln/hard-to-sym: Likewise.
* tests/split/suffix-length: Likewise.
* tests/mv/part-fail: Likewise.
* tests/misc/chcon: Likewise.
* tests/misc/stat-printf: Likewise.

12 years agotests: more automated quote adjustment
Jim Meyering [Sat, 7 Jan 2012 19:55:10 +0000 (20:55 +0100)]
tests: more automated quote adjustment

Relax initial regexp to match more instances, but add a
filter to avoid some invalid conversions.  Run this:

git grep -l "\`[^']*'" tests | xargs perl -pi -e '$q=q"'\''";' \
  -e '$q="$q\\$q$q"; /(= ?\`|\`expr|\`echo|\Q$q\E)/ and next;' \
  -e ' s/\`([^'\''"]*?'\'')/'\''$1/g'
The last disjunct in the above (...) filter is to exempt
any line that contains this string: '\''
With quoting like that, converting a ` to ' is likely to cause trouble,
so we'll handle those manually.  Here are three examples where
the exemption is required:

  *': `link-to-dir/'\'': hard link not allowed for directory'*) ;;
  printf 'creating file `%s'\''\n' $f
  'mv: inter-device move failed: `%s'\'' to `%s'\'';'\

12 years agotests: change `...' to '...' on lines not matching /[=\$]/
Jim Meyering [Sat, 7 Jan 2012 16:47:58 +0000 (17:47 +0100)]
tests: change `...' to '...' on lines not matching /[=\$]/

Exempt lines with '$' or '=', since those are prone to improper
conversion.  Run this:
  git grep -l "\`[^']*'" tests \
   |xargs perl -pi -e '/[=\$]/ and next;s/\`([^'\''"]*?'\'')/'\''$1/g'

12 years agotests: adjust \`...' quoting to '...' to adapt to latest gnulib
Jim Meyering [Sat, 7 Jan 2012 16:43:50 +0000 (17:43 +0100)]
tests: adjust \`...' quoting to '...' to adapt to latest gnulib

Run this:
  git grep -l "\\\\\`[^']*'" tests \
    |xargs perl -pi -e 's/\\\`(.*?'\'')/'\''$1/g

12 years agobuild: update gnulib submodule to latest (quoting change)
Jim Meyering [Sat, 7 Jan 2012 16:23:17 +0000 (17:23 +0100)]
build: update gnulib submodule to latest (quoting change)

This pulls in changes to the quote and quotearg modules that
render quoted strings in diagnostics.  `Old' vs 'new'.

12 years agomaint: prep for global quoting changes: handle irregular cases manually
Jim Meyering [Mon, 9 Jan 2012 20:33:37 +0000 (21:33 +0100)]
maint: prep for global quoting changes: handle irregular cases manually

* src/chroot.c (usage): Change ``...'' to '...', and describe the
default more accurately (also adding quotes): s,/bin/sh,'/bin/sh -i',
* src/join.c (usage): Change ` ...'' ' to "...''".
* src/fmt.c (isopen): Change `' to '` in list of bytes, so that
a subsequent change can safely perform the `...' to '...' conversion.
* src/truncate.c (main): Tweak quoting in comments to use '...',
not `...`, for consistency with the rest of comments in coreutils.

12 years agomaint: update quoting of "Try `prog --help'" to "Try 'prog --help'"
Jim Meyering [Sat, 7 Jan 2012 16:18:14 +0000 (17:18 +0100)]
maint: update quoting of "Try `prog --help'" to "Try 'prog --help'"

Automatically adjust both the source (now in only one place)
and all tests that expect the resulting output via this:

git grep -l 'Try.*--help' src/system.h tests \
  | xargs perl -pi -e 's/Try \\?`(\S+ --help)/Try '\''$1/'

12 years agomaint: use new emit_try_help in place of equivalent fprintf
Jim Meyering [Sat, 7 Jan 2012 15:54:26 +0000 (16:54 +0100)]
maint: use new emit_try_help in place of equivalent fprintf

Run this command:
  perl -0777 -pi -e \
   's/fprintf \(stderr, _\("Try `%s --help.*\n.*;/emit_try_help ();/m'\
     src/*.c

12 years agomaint: factor out all `Try --help'-emitting statements
Jim Meyering [Sat, 7 Jan 2012 15:42:41 +0000 (16:42 +0100)]
maint: factor out all `Try --help'-emitting statements

* src/system.h (emit_try_help): New function.

12 years agomaint: post-release administrivia
Jim Meyering [Fri, 6 Jan 2012 17:29:53 +0000 (18:29 +0100)]
maint: post-release administrivia

* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.

12 years agoversion 8.15 v8.15
Jim Meyering [Fri, 6 Jan 2012 17:05:54 +0000 (18:05 +0100)]
version 8.15

* NEWS: Record release date.

12 years agoscripts: allow one-line summary to start with "[Vv]ersion \d"
Jim Meyering [Fri, 6 Jan 2012 16:51:52 +0000 (17:51 +0100)]
scripts: allow one-line summary to start with "[Vv]ersion \d"

* scripts/git-hooks/commit-msg: Do not reject the commit log
message generated by our automated release-and-tag process.
(bad_first_line): New function, extracted from...
(check_msg): ... here.  Use it.

12 years agobuild: update gnulib submodule to latest
Jim Meyering [Fri, 6 Jan 2012 13:16:15 +0000 (14:16 +0100)]
build: update gnulib submodule to latest

12 years agotests: adjust quoting in expected output to match new gnulib policy
Jim Meyering [Fri, 6 Jan 2012 09:14:39 +0000 (10:14 +0100)]
tests: adjust quoting in expected output to match new gnulib policy

* tests/misc/xstrtol: Use '...' to match new quoting in most places.
However, leave `9x' to match the sole comparison against output
from the quote function, which still uses `...'.
* tests/misc/sort-merge: Likewise, though here I had to leave
`...'-quoted output to match output from four tests.
* tests/pr/pr-tests: Convert a single `...' to '...'.
* gnulib: Update submodule to latest.

12 years agomaint: adjust ChangeLog to reflect earlier df request
Jim Meyering [Fri, 6 Jan 2012 07:53:04 +0000 (08:53 +0100)]
maint: adjust ChangeLog to reflect earlier df request

* build-aux/git-log-fix: Credit early reporter.
* THANKS.in: Add a name.

12 years agotests: avoid stty icanon issues on some platforms
Pádraig Brady [Thu, 5 Jan 2012 15:31:50 +0000 (15:31 +0000)]
tests: avoid stty icanon issues on some platforms

* tests/misc/stty: Exclude 'icanon' for the list to check,
as it's problematic on ppc*|sparc* platforms.

12 years agotests: avoid ulimit issue on bash 3.2 on OS X
Pádraig Brady [Tue, 3 Jan 2012 19:35:12 +0000 (19:35 +0000)]
tests: avoid ulimit issue on bash 3.2 on OS X

* tests/misc/sort-continue: Perform the glob before
the ulimit, as it was seen to make the glob fail
on bash 3.2 on Mac OS X 10.6.8 at least.

12 years agotests: avoid a false positive due to overflow on Linux/HPPA
Pádraig Brady [Wed, 4 Jan 2012 23:33:20 +0000 (23:33 +0000)]
tests: avoid a false positive due to overflow on Linux/HPPA

* tests/misc/timeout-parameters: Verify that the timer doesn't
fire immediately in the problematic range, and avoid overflow
checks in that case.
* man/timeout.x: Mention the possible bug.

Reported by Bruno Haible

12 years agotests: adjust setfacl usage to accommodate Solaris 10
Jim Meyering [Thu, 5 Jan 2012 10:31:29 +0000 (11:31 +0100)]
tests: adjust setfacl usage to accommodate Solaris 10

* cfg.mk (sc_prohibit_short_facl_mode_spec): New rule.
* tests/cp/acl: Extend setfacl mode spec to have length 3.
* tests/ls/slink-acl: Likewise.
* tests/mv/acl: Likewise.
Report and analysis by Bruno Haible.

12 years agosplit: avoid failure due to leftover 'errno' value
Bruno Haible [Thu, 5 Jan 2012 08:26:32 +0000 (09:26 +0100)]
split: avoid failure due to leftover 'errno' value

* src/split.c (lines_chunk_split): Fix logic bug that led to
unwarranted failure of "split -n l/2 /dev/zero" on NetBSD 5.1.
The same would happen when splitting a growing file, where
open/lseek-end gives one size, but by the time we read, there
is more data available.
(bytes_chunk_extract): Likewise.
* NEWS (Bug fixes): Mention this.
* tests/split/l-chunk: The latter case was not exercised.
Add code to do that.
Bug introduced with the chunk-selecting feature in v8.7-25-gbe10739.

Co-authored-by: Jim Meyering <meyering@redhat.com>
12 years agodoc: README: recommend GNU make to run tests on IRIX 6.5 and Solaris 9
Jim Meyering [Thu, 5 Jan 2012 07:10:29 +0000 (08:10 +0100)]
doc: README: recommend GNU make to run tests on IRIX 6.5 and Solaris 9

* README: Document vendor "make check" failure on those two systems.
Reported by Bruno Haible.

12 years agomaint: ignore *.trs files, lib/getopt.h and build-aux/test-driver
Jim Meyering [Wed, 4 Jan 2012 17:13:19 +0000 (18:13 +0100)]
maint: ignore *.trs files, lib/getopt.h and build-aux/test-driver

* .gitignore: Also ignore automake's new .trs files and its
build-aux/test-driver, as well as lib/getopt.h.

12 years agodoc: adjust NEWS
Jim Meyering [Tue, 3 Jan 2012 16:33:21 +0000 (17:33 +0100)]
doc: adjust NEWS

* NEWS (New programs): Move this small section to the top.
(df): Reword entry, from Pádraig Brady.

12 years agodf: work around long-named /dev/disk/by-uuid/... symlinks
Jim Meyering [Thu, 29 Dec 2011 13:49:00 +0000 (14:49 +0100)]
df: work around long-named /dev/disk/by-uuid/... symlinks

On systems with recent kernel/tools, a symlink from /etc/mtab to
/proc/mounts, and a by-UUID mount (i.e., soon, nearly everyone),
you will see something like the following when running "df -hT":
(this has been truncated to fit in a width-limited ChangeLog file)

Filesystem                                             Type      Siz...
rootfs                                                 rootfs     11G
udev                                                   devtmpfs  3.8G
tmpfs                                                  tmpfs     774M
/dev/disk/by-uuid/828fc648-9f30-43d8-a0b1-f7096a2edb66 ext4       11G
tmpfs                                                  tmpfs     1.6G
/dev/sda2                                              ext3      494M
/dev/sda5                                              ext4       12G
/dev/sda6                                              ext4      9.9G

Contrast that with what we're used to seeing (modulo the
two entries mounted on "/", which is a separate problem):

Filesystem     Type      Size  Used Avail Use% Mounted on
rootfs         rootfs     11G  1.9G  8.0G  19% /
udev           devtmpfs  3.8G     0  3.8G   0% /dev
tmpfs          tmpfs     774M  376K  774M   1% /run
/dev/sda3      ext4       11G  1.9G  8.0G  19% /
tmpfs          tmpfs     1.6G  8.0K  1.6G   1% /run/shm
/dev/sda2      ext3      494M   78M  392M  17% /boot
/dev/sda5      ext4       12G  7.6G  3.7G  68% /usr
/dev/sda6      ext4      9.9G  6.6G  2.8G  71% /var

When that long /dev/disk/by-uuid/... name is merely a symlink
to a much shorter (and often more useful) device name like
"/dev/sda3", and when it's part of a listing of all file systems,
I would much prefer to see only the latter.  Similarly, when using
an encrypted root file system, you would see a name like
/dev/mapper/luks-828fc648-9f30-43d8-a0b1-f7196a2edb66 pointing
to say, /dev/dm-0, I prefer the shorter name.

I.e., if I explicitly run
"df -hT /dev/disk/by-uuid/828fc648-9f30-43d8-a0b1-f7096a2edb66",
then, it's fine -- and expected -- to print to the long name.
It was explicitly given.  However, with no non-option argument,
df should print the shorter name.  Note that performing this
translation at a lower level (via a change to gnulib's mountlist.c)
would make it impossible to distinguish those two cases.

* src/df.c: Include "canonicalize.h".
(get_dev): Add a parameter, telling when we're in process-all-
mount-points mode; update all callers.  When true, resolve
UUID-suffixed symlinks.
* NEWS (Changes in behavior): Mention it.
Reported by Dan Jacobson in http://bugs.gnu.org/10363

12 years agotests: adjust realpath test to avoid "make distcheck" failure
Jim Meyering [Tue, 3 Jan 2012 11:58:37 +0000 (12:58 +0100)]
tests: adjust realpath test to avoid "make distcheck" failure

* tests/misc/realpath: Quote lhs of test ... = ..., so that
when $PWD contains a space (like it does via "make distcheck"),
the test does not fail

12 years agorealpath: a new program to print the resolved path
Pádraig Brady [Tue, 27 Dec 2011 00:30:23 +0000 (00:30 +0000)]
realpath: a new program to print the resolved path

This program is compatible with other realpath(1)
implementations, and also incorporates relpath like support,
through the --relative options.  The relpath support
was suggested by Peng Yu, who also provided an initial
implemenation of that functionality.

* AUTHORS: Add my name.
* NEWS: Mention the new command.
* README: Likewise.
* doc/coreutils.texi (realpath invocation): Add realpath info.
* man/Makefile.am (realpath.1): Add dependency.
* man/realpath.x: New template.
* man/.gitignore: Ignore generated man page.
* po/POTFILES.in: Add src/realpath.c.
* src/.gitignore: Exclude realpath.
* src/Makefile.am (EXTRA_PROGRAMS): Add realpath.
* src/realpath.c: New file.
* scripts/git-hooks/commit-msg: Add realpath to the list of prefixes.
* tests/Makefile.am (TESTS): Add misc/realpath.
* tests/misc/realpath: New file.

12 years agobuild: update gnulib for canonicalize_filename_mode improvements
Pádraig Brady [Tue, 3 Jan 2012 11:33:20 +0000 (11:33 +0000)]
build: update gnulib for canonicalize_filename_mode improvements

This is required for the new realpath command.

12 years agobuild: tail: avoid type/format mismatch warning from gcc
Jim Meyering [Mon, 2 Jan 2012 20:28:15 +0000 (21:28 +0100)]
build: tail: avoid type/format mismatch warning from gcc

Without this change, gcc's -Werror=format would complain that
the '%lx' format requires 'long unsigned int', not 'int'.
* src/tail.c (fremote): Use a temporary variable.