platform/upstream/coreutils.git
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.

12 years agotests: also print chmod's --version
Jim Meyering [Sun, 1 Jan 2012 17:40:54 +0000 (18:40 +0100)]
tests: also print chmod's --version

* tests/rm/many-dir-entries-vs-OOM: This test also exercises chmod.

12 years agomaint: update all copyright year number ranges
Jim Meyering [Sun, 1 Jan 2012 08:47:10 +0000 (09:47 +0100)]
maint: update all copyright year number ranges

Run "make update-copyright".

12 years agotests: change copyright year from 2011 to 2012 in sample-test
Jim Meyering [Sun, 1 Jan 2012 08:52:49 +0000 (09:52 +0100)]
tests: change copyright year from 2011 to 2012 in sample-test

This file is special.  We don't want to use a range,
but merely the current year number.
* tests/sample-test: s/2011/2012/

12 years agotests: fix a missing-dependency problem
Jim Meyering [Sat, 31 Dec 2011 10:56:40 +0000 (11:56 +0100)]
tests: fix a missing-dependency problem

* tests/check.mk (.built-programs): Depend on src/Makefile.am,
so that when we add a program, this file is updated, and the new
program is tested via misc/help-version.  Spotted by Pádraig Brady.

12 years agobuild: avoid spurious test.c warning with -Wsuggest-attribute=pure
Jim Meyering [Fri, 30 Dec 2011 21:48:38 +0000 (22:48 +0100)]
build: avoid spurious test.c warning with -Wsuggest-attribute=pure

* src/test.c: Add pragma to suppress gcc-4.6.2's warning that
"advance" might be candidate for attribute 'pure'.

12 years agotail: avoid theoretically undefined behavior
Jim Meyering [Wed, 28 Dec 2011 17:30:50 +0000 (18:30 +0100)]
tail: avoid theoretically undefined behavior

* src/tail.c (start_lines): Do not form potentially-invalid address.
Use safe_read's return value as a pointer offset only after
ensuring that it is not SAFE_READ_ERROR (size_t)(-1).
Spotted by coverity.
Also, move declaration of "p" to be closer to first use.

12 years agotests: also unset _STDBUF_E, _STDBUF_I and _STDBUF_O
Jim Meyering [Wed, 28 Dec 2011 17:01:01 +0000 (18:01 +0100)]
tests: also unset _STDBUF_E, _STDBUF_I and _STDBUF_O

* tests/envvar-check (vars): Add these to the list of envvars we
ignore: _STDBUF_E, _STDBUF_I, _STDBUF_O, used by libstdbuf.

12 years agodoc: homologize ch{con,grp,mod,own} option descriptions
Pádraig Brady [Mon, 26 Dec 2011 19:20:04 +0000 (19:20 +0000)]
doc: homologize ch{con,grp,mod,own} option descriptions

* src/chgrp.c (usage): Group associated options together,
to aid users.  Also minimize the differences between
individual messages across these four commands, to
aid translators.
* src/chmod.c: Likewise.
* src/chown.c: Likewise.
* src/chcon.c (usage): Likewise.  Document the
--dereference option.

Suggested by Paul Eggert and Jari Aalto

12 years agostat,tail: recognize new FS type: pipefs
Jim Meyering [Mon, 26 Dec 2011 15:09:48 +0000 (16:09 +0100)]
stat,tail: recognize new FS type: pipefs

* src/stat.c (human_fstype) [S_MAGIC_PIPEFS]: New case.
* NEWS (Bug fixes): Mention this.

12 years agodoc: stat: clarify that %t and %T expand to the file system type
Jim Meyering [Sat, 24 Dec 2011 11:03:18 +0000 (12:03 +0100)]
doc: stat: clarify that %t and %T expand to the file system type

* src/stat.c (usage): Mention "file system type", not just "type"
for %t and %T.  Do not capitalize the first letter of each description.

12 years agotail: with -f, use polling when a file is on an FS of unknown type
Jim Meyering [Thu, 22 Dec 2011 22:23:02 +0000 (23:23 +0100)]
tail: with -f, use polling when a file is on an FS of unknown type

Before, we would use inotify in that case, which would work as long
as updates were taking place locally, but not at all when remote.
Move hard-coded list of known remote FS types into a more
maintainable table in stat.c, alongside the list of FS
names and magic numbers.  Generate a new is_local_fs_type function.
* src/Makefile.am (fs-is-local.h): New rule, generated file.
* src/extract-magic: Revamp to parse local/remote keyword after
each magic number in src/stat.c's case statements.
Accept new --local option.
* src/.gitignore: Ignore the generated fs-is-local.h.
* src/tail.c [HAVE_INOTIFY]: Include fs-is-local.h.
(fremote) [HAVE_INOTIFY]: Use the new function in place of
the switch stmt with hard-coded list of FS types.
Emit a warning when processing a file on a file system of unknown type.
* NEWS (Changes in behavior): Mention it.
Suggested by Sven Breuner.

12 years agodoc: update README-release with process to check for new FS magic
Jim Meyering [Thu, 22 Dec 2011 09:13:35 +0000 (10:13 +0100)]
doc: update README-release with process to check for new FS magic

* README-release: Run the Makefile rule that checks for new file
system magic numbers.

12 years agotail,stat: add support for FhGFS
Jim Meyering [Thu, 22 Dec 2011 08:26:31 +0000 (09:26 +0100)]
tail,stat: add support for FhGFS

* src/stat.c (human_fstype): Add a case: fhgfs, 0x19830326.
* src/tail.c (fremote): Add S_MAGIC_FHGFS.
* NEWS (Bug fixes): Update the entry for GPFS to mention FhGFS, too.
Reported by Sven Breuner.

12 years agodoc: improve factor example
Jim Meyering [Tue, 20 Dec 2011 13:39:57 +0000 (14:39 +0100)]
doc: improve factor example

* doc/coreutils.texi (factor invocation): Adjust example to use $(...)
consistently, not a mix of `...` and $(...).  Separate the computation
of the product and the actual factorization, so the timing of the
latter doesn't include the cost of the former.

12 years agobuild: remove now-useless code from bootstrap.conf
Jim Meyering [Sat, 17 Dec 2011 16:26:00 +0000 (17:26 +0100)]
build: remove now-useless code from bootstrap.conf

* bootstrap.conf (bootstrap_epilogue): Remove now-unnecessary,
snippet that edited gnulib-tests/gnulib.mk.  This snippet was
rendered unnecessary by commit v8.14-73-g5bf2c0e.

12 years agobuild: merge in bootstrap changes from gnulib
Jim Meyering [Sat, 17 Dec 2011 15:38:23 +0000 (16:38 +0100)]
build: merge in bootstrap changes from gnulib

* bootstrap: Pull in the combination of gnulib's "bootstrap: detect
tools required by gnulib-tool" patch and the related fix.

12 years agodu: -x should not count files in other file systems
Paul Eggert [Thu, 15 Dec 2011 02:00:42 +0000 (18:00 -0800)]
du: -x should not count files in other file systems

This fixes Bug#10293, which I guess was introduced in commit
95c948b06a dated 2003-10-02.
* NEWS: Document fix.
* src/du.c (process_file): Don't count files in different file
systems if -x is given.
* tests/du/one-file-system: Test for this bug.

12 years agodoc: document 'touch' and timestamps better
Paul Eggert [Tue, 13 Dec 2011 00:56:50 +0000 (16:56 -0800)]
doc: document 'touch' and timestamps better

* doc/coreutils.texi (touch invocation): Explain file timestamps
better.  Problem reported by Nelson H.F. Beebe (Bug#7999).

12 years agols: give a more useful diagnostic for a bogus --time-style arg
Jim Meyering [Sun, 11 Dec 2011 10:59:31 +0000 (11:59 +0100)]
ls: give a more useful diagnostic for a bogus --time-style arg

* src/ls.c (decode_switches): Replace our use of XARGMATCH
with open-coded version so that we can give a better diagnostic.
* tests/ls/time-style-diag: New file.
* tests/Makefile.am (TESTS): Add it.
Reported by Dan Jacobson in http://bugs.gnu.org/10253
with suggestions from Eric Blake and Paul Eggert.

12 years agomaint: remove a misleading comment from shred.c
Jim Meyering [Fri, 9 Dec 2011 19:12:44 +0000 (20:12 +0100)]
maint: remove a misleading comment from shred.c

* src/shred.c: Remove obsolete TODO comment.  The first two and the
last item were done, adding --recursive (-r) is neither necessary
nor appropriate, and I don't want to add --interactive.  I don't
see a need for the others.  Prompted by comments from Amr Ali.

12 years agols: be responsive to interrupts when color-listing large directories
Jim Meyering [Thu, 8 Dec 2011 09:49:03 +0000 (10:49 +0100)]
ls: be responsive to interrupts when color-listing large directories

Starting with commit adc30a83, when using --color, ls inhibited
interrupts to avoid corrupting the state of an output terminal.
However, for very large directories, that inhibition rendered ls
uninterruptible for too long, including a potentially long period
even before any output is generated.
* src/ls.c: Two phases of processing are time-consuming enough that
they can provoke this: the readdir loop and the printing loop.  The
printing was supposed to be covered by a call to process_signals in
(print_name_with_quoting): ... but that call was mistakenly guarded
by a condition that might be false for many or even all files being
processed.  Call process_signals unconditionally.
(print_dir): Also call process_signals in the readdir loop.
* NEWS (Bug fixes): Mention it.
Reported by Arkadiusz Miśkiewicz in http://bugs.gnu.org/10243
Co-authored-by: Eric Blake <eblake@redhat.com>
12 years agoln: clarify usage of -L, -n, -T
Paul Eggert [Mon, 5 Dec 2011 22:39:02 +0000 (14:39 -0800)]
ln: clarify usage of -L, -n, -T

* src/ln.c (usage): Use clearer wording to describe the -L, -n,
and -T options (Bug#9896).

12 years agomaint: don't assume GNU make \# syntax (fix previous)
Paul Eggert [Mon, 5 Dec 2011 22:03:57 +0000 (14:03 -0800)]
maint: don't assume GNU make \# syntax (fix previous)

* src/Makefile.am (fs_normalize_perl_subst, fs-magic, fs-kernel-magic):
Undo previous patch; it missed a \#.
(fs_normalize_perl_subst): Use \043 rather than \#.
\043 is portable to all ASCIIish platforms, whereas \# is portable
only to platforms that are compatible with GNU make (and are
incompatible with POSIX make).  Porting this to EBCDIC is left as
an exercise for the reader....

12 years agomaint: sort, stat: remove unused parameters
Jim Meyering [Sun, 4 Dec 2011 13:08:54 +0000 (14:08 +0100)]
maint: sort, stat: remove unused parameters

* src/sort.c (struct thread_args) [is_lo_child]: Remove member.
(sortlines): Remove unused parameter, "is_lo_child".  Update callers.
* src/stat.c (out_epoch_sec): Mark unused parameter.
(do_statfs, do_stat): Remove unused parameter, "terse". Update callers.

12 years agomaint: don't assume GNU make \# syntax
Paul Eggert [Mon, 5 Dec 2011 21:29:28 +0000 (13:29 -0800)]
maint: don't assume GNU make \# syntax

* src/Makefile.am (fs_normalize_perl_subst): Don't make unportable
assumption about \# in the right hand side of a macro definition.
This works with GNU make, but not with POSIX make.
Problem reported by Basavaraj B (Bug#10220).
(fs-magic, fs-kernel-magic): Do the #-substitution here instead.

12 years agood,test: address warnings from gcc's -Wjump-misses-init
Jim Meyering [Sat, 3 Dec 2011 16:49:57 +0000 (17:49 +0100)]
od,test: address warnings from gcc's -Wjump-misses-init

* src/test.c (unary_operator): gcc reported that initializations
in two case statements were skipped.  Enclose in braces.
* src/od.c (decode_one_format): Likewise.

12 years agomaint: remove redundant usage declarations (-Wredundant-decls)
Jim Meyering [Sat, 3 Dec 2011 15:42:19 +0000 (16:42 +0100)]
maint: remove redundant usage declarations (-Wredundant-decls)

* src/csplit.c (usage): Remove declaration.
* src/ls.c (usage): Likewise.
* src/pr.c (usage): Likewise.

12 years agomaint: add missing ":" after "License" in local gnulib module files
Jim Meyering [Sat, 3 Dec 2011 13:04:17 +0000 (14:04 +0100)]
maint: add missing ":" after "License" in local gnulib module files

This avoids spurious diagnostics when running our "bootstrap" script.
* gl/modules/heap: Append colon after "License".
* gl/modules/randint: Likewise.
* gl/modules/randperm: Likewise.
* gl/modules/randread: Likewise.
Reported by Stefano Lattarini.  Diagnosed by Bruno Haible.

12 years agodoc: fix list of GNU extension date formats
Eric Blake [Thu, 1 Dec 2011 19:09:41 +0000 (12:09 -0700)]
doc: fix list of GNU extension date formats

I didn't check how long these were documented as GNU extensions,
nor when they were added by POSIX; but since they are all part
of POSIX 2008, we no longer need call them out as extensions.

The next version of POSIX will standardize %s:
http://austingroupbugs.net/view.php?id=169
but as that is not out yet, I didn't change %s.

* doc/coreutils.texi (Time conversion specifiers): %R and %z are
now POSIX.
(Date conversion specifiers): Likewise for %F, %g, %G.

12 years agotests: adjust PATH to generally include /sbin and /usr/sbin
Bernhard Voelker [Thu, 1 Dec 2011 00:04:34 +0000 (01:04 +0100)]
tests: adjust PATH to generally include /sbin and /usr/sbin

Commit 5eeaca94 added /sbin to the PATH for tests using mkfs. For other
tests, e.g. tests/cp-fiemap-perf using filefrag, we need /usr/sbin also.
Add both directories generally for the tests, "since many of us always
augment our PATH with all of the sbin paths all of the time anyway" (Bob
in http://lists.gnu.org/archive/html/coreutils/2011-11/msg00107.html).
The previous commit is hereby obsolete.
* tests/init.cfg (sanitize_path_): Add /sbin and /usr/sbin to PATH
unless already included. Needed for tests using admin tools like mkfs
and filefrag on systems where the user's environment does not have
these directories in the PATH.
* tests/init.cfg (require_mkfs_PATH_): Remove obsolete function.
* tests/cp/cp-a-selinux: Remove require_mkfs_PATH_ call.
* tests/cp/cp-mv-enotsup-xattr: Likewise.
* tests/cp/sparse-fiemap: Likewise.
* tests/mkdir/writable-under-readonly: Likewise.
* tests/rm/read-only: Likewise.

12 years agobuild: simplify warnings based on last gnulib update
Eric Blake [Tue, 29 Nov 2011 23:16:45 +0000 (16:16 -0700)]
build: simplify warnings based on last gnulib update

We no longer need to exclude this warning.

* configure.ac (WARN_CFLAGS): Gnulib dropped
-Wunsuffixed-float-constants, as non-portable.

12 years agobuild: update gnulib for syntax-check improvement
Eric Blake [Tue, 29 Nov 2011 23:10:40 +0000 (16:10 -0700)]
build: update gnulib for syntax-check improvement

Commit 5b3e538 proved useful enough to migrate to gnulib after
enhancing it to be more generic, which in turn pointed out that
commit a2c811db missed an offender.

* gnulib: Update to latest.
* cfg.mk (sc_prohibit_reversed_compare_failure): Delete, now that
gnulib provides it.
* tests/ls/dangle: Fix last offender.

12 years agobuild: update gnulib to fix build failure with --enable-gcc-warnings
Jim Meyering [Tue, 29 Nov 2011 13:39:54 +0000 (14:39 +0100)]
build: update gnulib to fix build failure with --enable-gcc-warnings

12 years agobuild: enable -Wsuggest-attribute=pure|const in lib/,...
Jim Meyering [Sun, 27 Nov 2011 15:13:26 +0000 (16:13 +0100)]
build: enable -Wsuggest-attribute=pure|const in lib/,...

but not in gnulib-tests/.
* configure.ac (GNULIB_WARN_CFLAGS): Do not exclude
-Wsuggest-attribute=pure|const, thus enabling these two warning
options in lib/, since gnulib now toes the line.
Continue to disable them in gnulib-tests/, since some programs
there trigger these suggestions and are not worth fixing.

12 years agobuild: update gnulib for const+pure attributes
Jim Meyering [Mon, 28 Nov 2011 08:28:33 +0000 (09:28 +0100)]
build: update gnulib for const+pure attributes

12 years agotests: add a syntax check for last week's global change
Jim Meyering [Sun, 27 Nov 2011 14:36:06 +0000 (15:36 +0100)]
tests: add a syntax check for last week's global change

Last week I made a global change, commit a2c811db, `tests: use
"compare exp out", not "compare out exp"', but forgot to add a
corresponding syntax check rule.  Without that, it is far too
easy to add a new test or to merge in an old one that would
be non-conforming.  Obviously this is only a heuristic, since
it relies on the expected-output file to have a name that starts
with "exp".
* cfg.mk (sc_prohibit_reversed_compare_failure): Prohibit use of
compare with reversed arguments.

12 years agomaint: update comment gcc-4.6.2 still botches -Wsuggest-attribute=pure
Jim Meyering [Sun, 27 Nov 2011 12:51:40 +0000 (13:51 +0100)]
maint: update comment gcc-4.6.2 still botches -Wsuggest-attribute=pure

* configure.ac: Update the comment on which gcc versions still must
not use -Wsuggest-attribute=pure option: still required on post-
Fedora 16 rawhide's 4.6.2 20111027.

12 years agomaint: bootstrap: run autopoint and libtoolize *before* gnulib-tool
Jim Meyering [Mon, 6 Sep 2010 07:48:46 +0000 (09:48 +0200)]
maint: bootstrap: run autopoint and libtoolize *before* gnulib-tool

* bootstrap (AUTOPOINT, AUTORECONF): Factor out definitions.
Run autopoint and libtoolize *before* gnulib-tool.
After it, run an abbreviated autoreconf, rather than a loop around
all tools.
* bootstrap.conf (gnulib_tool_option_extras): Add both --symlink
and --makefile-name=gnulib.mk.  Remove stray use of $bt.
* lib/Makefile.am: Initialize all of the following so that
generated code in gnulib.mk may use += to append to those variables:
AM_CFLAGS, AM_CPPFLAGS, BUILT_SOURCES, CLEANFILES, EXTRA_DIST,
MAINTAINERCLEANFILES, MOSTLYCLEANDIRS, MOSTLYCLEANFILES, SUFFIXES,
noinst_LIBRARIES.

12 years agomaint: bootstrap: remove some now-unneeded code
Jim Meyering [Mon, 6 Sep 2010 07:23:18 +0000 (09:23 +0200)]
maint: bootstrap: remove some now-unneeded code

This bootstrap script arose back when gnulib-tool was young.
Since then, it has seen improvements that render much of this
script unnecessary.  In particular, it can now make symlinks
to the files it uses.  Also, I no longer see as much value in
marking files as read-only via comments.
* bootstrap (slirp, bt_mark_as_generated): Remove.

12 years agomaint: use gnulib's gettext-h, not the gettext module
Jim Meyering [Thu, 24 Nov 2011 18:22:09 +0000 (19:22 +0100)]
maint: use gnulib's gettext-h, not the gettext module

* bootstrap.conf (gnulib_modules): Use gnulib's gettext-h, not the
gettext module.  Not only is gettext-h far smaller (it has far fewer
dependencies than the gnulib module), but it does not suffer from
the problem with the gettext module whereby it adds a -I.../intl
option to compilation flags.  That can provoke warnings, since we
don't have such a directory.  We used to work around that via a
hack in bootstrap, but that was ugly and inefficient.

12 years agomaint: append many lib/ and m4/ names to .gitignore
Jim Meyering [Tue, 22 Nov 2011 21:36:39 +0000 (22:36 +0100)]
maint: append many lib/ and m4/ names to .gitignore

12 years agobuild: update gnulib submodule to latest for fixed stdalign test
Jim Meyering [Thu, 24 Nov 2011 21:07:37 +0000 (22:07 +0100)]
build: update gnulib submodule to latest for fixed stdalign test

12 years agoscripts: commit-msg: tweak 72-column test to avoid a false-positive
Jim Meyering [Wed, 23 Nov 2011 08:02:51 +0000 (09:02 +0100)]
scripts: commit-msg: tweak 72-column test to avoid a false-positive

* scripts/git-hooks/commit-msg: Don't warn about a line that is
longer than 72 if it is a comment.  Git-generated comments would
occasionally trigger this.

12 years agobuild: update gnulib and tests/init.sh
Jim Meyering [Wed, 23 Nov 2011 07:43:18 +0000 (08:43 +0100)]
build: update gnulib and tests/init.sh

* gnulib: Update.
* tests/init.sh: Update from gnulib.

12 years agobuild: --enable-gcc-warnings: disable some new warnings
Jim Meyering [Tue, 22 Nov 2011 20:45:24 +0000 (21:45 +0100)]
build: --enable-gcc-warnings: disable some new warnings

* configure.ac: Disable some new warning options pulled in via
an update to gnulib's manywarnings module: -Wformat-nonliteral,
-Wunsuffixed-float-constants, -Wdouble-promotion.

12 years agotests: use "compare exp out", not "compare out exp"
Jim Meyering [Tue, 22 Nov 2011 09:08:04 +0000 (10:08 +0100)]
tests: use "compare exp out", not "compare out exp"

Likewise, when an empty file is expected, use "compare /dev/null out",
not "compare out /dev/null". I.e., specify the expected/desired contents
via the first file name.  Prompted by a suggestion from Bruno Haible
in http://thread.gmane.org/gmane.comp.gnu.grep.bugs/4020/focus=29154

Run these commands:

    git grep -l -E 'compare [^ ]+ exp' \
      |xargs perl -pi -e 's/(compare) (\S+) (exp\S*)/$1 $3 $2/'
    git grep -l -E 'compare [^ ]+ /dev/null' \
      |xargs perl -pi -e 's/(compare) (\S+) (\/dev\/null)/$1 $3 $2/'

* tests/chgrp/no-x: As above.
* tests/chmod/no-x: Likewise.
* tests/chmod/silent: Likewise.
* tests/chmod/thru-dangling: Likewise.
* tests/chown/basic: Likewise.
* tests/chown/deref: Likewise.
* tests/chown/preserve-root: Likewise.
* tests/cp/abuse: Likewise.
* tests/cp/backup-is-src: Likewise.
* tests/cp/cp-a-selinux: Likewise.
* tests/cp/cp-mv-enotsup-xattr: Likewise.
* tests/cp/fail-perm: Likewise.
* tests/cp/into-self: Likewise.
* tests/cp/proc-zero-len: Likewise.
* tests/cp/src-base-dot: Likewise.
* tests/cp/thru-dangling: Likewise.
* tests/dd/reblock: Likewise.
* tests/dd/unblock-sync: Likewise.
* tests/du/2g: Likewise.
* tests/du/8gb: Likewise.
* tests/du/basic: Likewise.
* tests/du/bigtime: Likewise.
* tests/du/deref-args: Likewise.
* tests/du/exclude: Likewise.
* tests/du/files0-from-dir: Likewise.
* tests/du/hard-link: Likewise.
* tests/du/inacc-dest: Likewise.
* tests/du/inacc-dir: Likewise.
* tests/du/long-sloop: Likewise.
* tests/du/max-depth: Likewise.
* tests/du/move-dir-while-traversing: Likewise.
* tests/du/no-deref: Likewise.
* tests/du/no-x: Likewise.
* tests/du/one-file-system: Likewise.
* tests/du/slash: Likewise.
* tests/du/trailing-slash: Likewise.
* tests/install/strip-program: Likewise.
* tests/ln/hard-backup: Likewise.
* tests/ls/block-size: Likewise.
* tests/ls/color-clear-to-eol: Likewise.
* tests/ls/color-dtype-dir: Likewise.
* tests/ls/color-norm: Likewise.
* tests/ls/dangle: Likewise.
* tests/ls/dired: Likewise.
* tests/ls/file-type: Likewise.
* tests/ls/follow-slink: Likewise.
* tests/ls/infloop: Likewise.
* tests/ls/m-option: Likewise.
* tests/ls/no-arg: Likewise.
* tests/ls/recursive: Likewise.
* tests/ls/rt-1: Likewise.
* tests/ls/stat-dtype: Likewise.
* tests/ls/stat-failed: Likewise.
* tests/ls/stat-free-symlinks: Likewise.
* tests/ls/x-option: Likewise.
* tests/misc/arch: Likewise.
* tests/misc/cat-buf: Likewise.
* tests/misc/cat-proc: Likewise.
* tests/misc/chcon: Likewise.
* tests/misc/csplit: Likewise.
* tests/misc/df-P: Likewise.
* tests/misc/fmt-long-line: Likewise.
* tests/misc/groups-dash: Likewise.
* tests/misc/groups-version: Likewise.
* tests/misc/head-pos: Likewise.
* tests/misc/nl: Likewise.
* tests/misc/od-N: Likewise.
* tests/misc/od-multiple-t: Likewise.
* tests/misc/od-x8: Likewise.
* tests/misc/printf: Likewise.
* tests/misc/printf-hex: Likewise.
* tests/misc/pwd-option: Likewise.
* tests/misc/readlink-fp-loop: Likewise.
* tests/misc/runcon-no-reorder: Likewise.
* tests/misc/seq-long-double: Likewise.
* tests/misc/sort-NaN-infloop: Likewise.
* tests/misc/sort-benchmark-random: Likewise.
* tests/misc/sort-debug-keys: Likewise.
* tests/misc/sort-float: Likewise.
* tests/misc/sort-merge-fdlimit: Likewise.
* tests/misc/sort-unique-segv: Likewise.
* tests/misc/stat-hyphen: Likewise.
* tests/misc/stat-slash: Likewise.
* tests/misc/stdbuf: Likewise.
* tests/misc/sum-sysv: Likewise.
* tests/misc/tac-2-nonseekable: Likewise.
* tests/misc/tac-continue: Likewise.
* tests/misc/tr-case-class: Likewise.
* tests/misc/truncate-fail-diag: Likewise.
* tests/misc/wc-files0: Likewise.
* tests/mkdir/selinux: Likewise.
* tests/mv/backup-dir: Likewise.
* tests/mv/backup-is-src: Likewise.
* tests/mv/diag: Likewise.
* tests/mv/dir2dir: Likewise.
* tests/mv/dup-source: Likewise.
* tests/mv/force: Likewise.
* tests/mv/hard-verbose: Likewise.
* tests/mv/i-link-no: Likewise.
* tests/mv/into-self: Likewise.
* tests/mv/into-self-2: Likewise.
* tests/mv/into-self-3: Likewise.
* tests/mv/mv-special-1: Likewise.
* tests/mv/part-fail: Likewise.
* tests/mv/perm-1: Likewise.
* tests/mv/sticky-to-xpart: Likewise.
* tests/mv/trailing-slash: Likewise.
* tests/rm/rm1: Likewise.
* tests/rm/rm2: Likewise.
* tests/rm/cycle: Likewise.
* tests/rm/dir-no-w: Likewise.
* tests/rm/dir-nonrecur: Likewise.
* tests/rm/fail-2eperm: Likewise.
* tests/rm/fail-eacces: Likewise.
* tests/rm/i-never: Likewise.
* tests/rm/inaccessible: Likewise.
* tests/rm/interactive-always: Likewise.
* tests/rm/interactive-once: Likewise.
* tests/rm/isatty: Likewise.
* tests/rm/one-file-system: Likewise.
* tests/rm/rm3: Likewise.
* tests/rm/rm5: Likewise.
* tests/rm/unread2: Likewise.
* tests/rm/v-slash: Likewise.
* tests/sample-test: Likewise.
* tests/split/b-chunk: Likewise.
* tests/split/fail: Likewise.
* tests/split/l-chunk: Likewise.
* tests/split/lines: Likewise.
* tests/split/r-chunk: Likewise.
* tests/split/suffix-length: Likewise.
* tests/tail-2/big-4gb: Likewise.
* tests/tail-2/follow-name: Likewise.
* tests/tail-2/follow-stdin: Likewise.
* tests/tail-2/pipe-f: Likewise.
* tests/tail-2/pipe-f2: Likewise.
* tests/tail-2/start-middle: Likewise.
* tests/touch/60-seconds: Likewise.
* tests/touch/fail-diag: Likewise.
* tests/touch/not-owner: Likewise.
* tests/touch/relative: Likewise.

12 years agotests: use compare, not "diff", in a few stray tests
Jim Meyering [Tue, 22 Nov 2011 09:18:30 +0000 (10:18 +0100)]
tests: use compare, not "diff", in a few stray tests

* tests/install/basic-1: Use compare, not diff.
* tests/mkdir/p-v: Likewise.
* tests/mv/part-fail: Likewise.
* tests/rm/rm1: Likewise.
* tests/rm/rm2: Likewise.
* tests/touch/not-owner: Likewise.

12 years agomaint: revert "build: update gnulib submodule to latest"
Jim Meyering [Sun, 20 Nov 2011 22:58:13 +0000 (23:58 +0100)]
maint: revert "build: update gnulib submodule to latest"

Don't update to latest from gnulib just yet.
This reverts commit 173f4d9bd628fb771eaeca3d2fef97dcd71fedb8.
In particular, manywarnings is too aggressive.

12 years agobuild: update gnulib submodule to latest
Jim Meyering [Sun, 20 Nov 2011 22:38:03 +0000 (23:38 +0100)]
build: update gnulib submodule to latest

12 years agomaint: make generated THANKS file read-only
Jim Meyering [Sun, 20 Nov 2011 20:33:48 +0000 (21:33 +0100)]
maint: make generated THANKS file read-only

* Makefile.am (THANKS): Make generated file read-only.

12 years agodoc: clarify ln's --help output
Jim Meyering [Sun, 20 Nov 2011 20:18:53 +0000 (21:18 +0100)]
doc: clarify ln's --help output

* src/ln.c (usage): Use TARGET, not "source" in description.
Reported by Michael J Daniel in http://bugs.gnu.org/9896.

12 years agoport to GNU hosts, where getuid and friends can fail
Paul Eggert [Sun, 20 Nov 2011 22:08:33 +0000 (14:08 -0800)]
port to GNU hosts, where getuid and friends can fail

* src/groups.c (main):
* src/install.c (need_copy):
* src/su.c (log_su):
* src/test.c (unary_operator):
* src/whoami.c (main):
Don't assume that getuid and friends always succeed.
This fixes the same problem that we recently fixed with 'id'.

12 years agomaint: avoid gitlog-to-changelog diagnostic about unused entries
Jim Meyering [Sun, 20 Nov 2011 14:34:59 +0000 (15:34 +0100)]
maint: avoid gitlog-to-changelog diagnostic about unused entries

* build-aux/git-log-fix: Comment out two unused entries.
Each of those two entries does indicate an error in a commit log,
but precedes the cut-off date, so has an actual VC'd ChangeLog entry.
I.e., gitlog-to-changelog generates ChangeLog entries since 2008-02,
and these two predate that.
* ChangeLog-2008: Make the indicated correction.

12 years agoln: fix position of --backup values description
Erik Auerswald [Sat, 19 Nov 2011 21:07:29 +0000 (22:07 +0100)]
ln: fix position of --backup values description

* src/ln.c (usage): A paragraph describing interactions of -s
with -L and -P somehow snuck in between the description of the
--backup option and the values used to control it. Fix this by
moving the value description up.

12 years agoscripts: rewrite git commit-msg hook in Perl
Jim Meyering [Fri, 18 Nov 2011 14:33:56 +0000 (15:33 +0100)]
scripts: rewrite git commit-msg hook in Perl

* scripts/git-hooks/commit-msg: Rewrite in perl.
This is still a work in progress in that it hard-codes coreutils-
specific program names and policies that should be easy to selectively
enable or disable without modifying the script.

12 years agosort: clarify wording on -k syntax
Eric Blake [Wed, 16 Nov 2011 17:09:12 +0000 (10:09 -0700)]
sort: clarify wording on -k syntax

* src/sort.c (usage): Use KEYDEF instead of POS, and call out the
specific OPTS that can occur in KEYDEF.
Based on a report by Lars Noodén, http://bugs.gnu.org/10019