platform/upstream/coreutils.git
14 years agomaint: improve additional library tracking
Eric Blake [Fri, 9 Oct 2009 19:57:56 +0000 (13:57 -0600)]
maint: improve additional library tracking

* src/Makefile.am (LDADD): Refactor, to make per-library additions
to individual programs easier to maintain.

14 years agochcon: don't disable just because SELinux is disabled
Jim Meyering [Wed, 7 Oct 2009 13:31:17 +0000 (15:31 +0200)]
chcon: don't disable just because SELinux is disabled

* src/chcon.c (main): Now that gnulib provides getfilecon wrappers,
we can revert most of the 2009-10-05 commit 3a97d664, "chcon: exit
immediately if SELinux is disabled", since chcon is still useful as
long as the file system provides handlers for the security.*
name space.  gnulib's getfilecon wrappers ensure that an offending
context now evokes a return value of -1.
Prompted by comments from Stephen Smalley in
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/18378/focus=18394
* NEWS (Bug fixes): Mention it.

14 years agols: remove explicit getfilecon work-around
Jim Meyering [Wed, 7 Oct 2009 20:29:12 +0000 (22:29 +0200)]
ls: remove explicit getfilecon work-around

* src/ls.c (gobble_file): Remove l?getfilecon work-around,
now that the gnulib wrappers handle it for us.

14 years agobuild: update gnulib submodule to latest, for getfilecon wrappers
Jim Meyering [Fri, 9 Oct 2009 11:57:02 +0000 (13:57 +0200)]
build: update gnulib submodule to latest, for getfilecon wrappers

14 years agomaint: use X2NREALLOC in more places
Eric Blake [Thu, 8 Oct 2009 14:35:55 +0000 (08:35 -0600)]
maint: use X2NREALLOC in more places

* src/chroot.c (set_additional_groups): Use X2NREALLOC rather than
x2nrealloc.
* src/factor.c (emit_factor): Likewise.
* src/setuidgid.c (main): Likewise.

14 years agomaint: remove unused macros and declarations
Eric Blake [Thu, 8 Oct 2009 15:35:51 +0000 (09:35 -0600)]
maint: remove unused macros and declarations

* src/system.h (EDQUOT, EISDIR, ENOSYS, EOVERFLOW, F_OK, X_OK)
(W_OK, R_OK): Delete; macros provided by gnulib.
(includes): Gnulib guarantees both <time.h> and <sys/time.h>, in
either order.
(free, malloc, memchr, realloc, getenv, lseek): Delete, gnulib
guarantees these declarations.
* m4/check-decl.m4 (gl_CHECK_DECLS): Delete checks now done by
gnulib.

14 years agomaint: move timeout exit statuses
Eric Blake [Thu, 8 Oct 2009 14:13:02 +0000 (08:13 -0600)]
maint: move timeout exit statuses

* src/timeout.c (EXIT_TIMEDOUT, EXIT_CANCELED): Remove as
macros...
* src/system.h (EXIT_TIMEDOUT, EXIT_CANCELED): ...and provide as
enum values instead.
* src/stdbuf.c (EXIT_CANCELED): Delete.

14 years agostat: test recent patch
Eric Blake [Thu, 8 Oct 2009 14:53:56 +0000 (08:53 -0600)]
stat: test recent patch

* tests/misc/stat-slash: New test.
* tests/Makefile.am (TESTS): Run it.

14 years agostdbuf: improve path search
Eric Blake [Thu, 24 Sep 2009 23:18:47 +0000 (17:18 -0600)]
stdbuf: improve path search

* src/stdbuf.c (set_program_path): Use gnulib methods for better
file name handling.
* bootstrap.conf (gnulib_modules): Add xreadlink.

14 years agostat: work with recent gnulib changes
Eric Blake [Thu, 8 Oct 2009 12:04:09 +0000 (06:04 -0600)]
stat: work with recent gnulib changes

* src/stat.c (do_stat): Don't mask function-like stat macro.

14 years agostat: add support for many more file system types
Jim Meyering [Thu, 8 Oct 2009 08:06:42 +0000 (10:06 +0200)]
stat: add support for many more file system types

* src/stat.c (human_fstype): Add the following FS types,
from <linux/magic.h>: afs, anon-inode FS, btrfs, cgroupfs,
cramfs-wend, debugfs, futexfs, inotifyfs, minux3, securityfs,
selinux, xenfs.
Also add "nilfs".
* src/Makefile.am (fs-kernel-magic): New rule.
* NEWS (Bug fixes): Mention this.

14 years agostat: recognize CIFS and HFS file system types
Jim Meyering [Thu, 8 Oct 2009 07:05:08 +0000 (09:05 +0200)]
stat: recognize CIFS and HFS file system types

* src/stat.c (human_fstype) [CIFS, HFS]: Add new file system types.
Prompted by a report from Stuart Kemp.
Normalize the form of a few hexadecimal magic numbers.
Alphabetize on S_MAGIC_ case names.
* src/Makefile.am (fs-magic-compare, fs-def, fs-magic): New rules, to
automate comparison of our list with that in the Linux statfs man page.
* NEWS (Bug fixes): Mention it.

14 years agomd5sum, sha*sum: also accept openssl checksum syntax
Guenter Knauf [Sat, 3 Oct 2009 21:24:26 +0000 (23:24 +0200)]
md5sum, sha*sum: also accept openssl checksum syntax

* src/md5sum.c (split_3): Accept openssl checksum syntax, which
differs only by two spaces from that of the bsd checksum tools:
openssl: MD5(f)= d41d8cd98f00b204e9800998ecf8427e
bsd:     MD5 (f) = d41d8cd98f00b204e9800998ecf8427e

14 years agomaint: make release-making instructions more generic
Jim Meyering [Tue, 6 Oct 2009 14:49:36 +0000 (16:49 +0200)]
maint: make release-making instructions more generic

* README-release: Make instructions more generic.

14 years agopost-release administrivia
Jim Meyering [Tue, 6 Oct 2009 11:20:18 +0000 (13:20 +0200)]
post-release administrivia

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

14 years agoversion 8.0 v8.0
Jim Meyering [Tue, 6 Oct 2009 11:04:16 +0000 (13:04 +0200)]
version 8.0

* NEWS: Record release date.

14 years agobuild: update gnulib submodule to latest
Jim Meyering [Tue, 6 Oct 2009 09:01:33 +0000 (11:01 +0200)]
build: update gnulib submodule to latest

14 years agochcon: exit immediately if SELinux is disabled
Ondřej Vašík [Mon, 5 Oct 2009 07:20:48 +0000 (09:20 +0200)]
chcon: exit immediately if SELinux is disabled

This change happens to avoid an abort in chcon when SELinux is
disabled while operating on a file with an "unlabeled" context from
back in 2006.  However, that same abort can still be triggered by the
same file when running chcon with SELinux enabled.  This bug in chcon
will be fixed in a subsequent commit via a getfilecon wrapper.  See
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/18378/focus=18384
for how to correct your disk attributes to avoid triggering this bug.
* src/chcon.c (main): Exit immediately if SELinux is disabled.
Reported in http://bugzilla.redhat.com/527142 by Yanko Kaneti.
* src/runcon.c (main): Do not hardcode program name in error message.
* THANKS: Update.

14 years agobuild: update gnulib submodule to latest
Jim Meyering [Sat, 3 Oct 2009 04:56:55 +0000 (06:56 +0200)]
build: update gnulib submodule to latest

14 years agodircolors: highlight .cgm and .emf as images
James R. Van Zandt [Fri, 2 Oct 2009 16:56:16 +0000 (10:56 -0600)]
dircolors: highlight .cgm and .emf as images

* src/dircolors.hin: Add .cgm, .emf.
* THANKS: Update.

14 years agomaint: remove obsolete syntax-check exclusion
Jim Meyering [Fri, 2 Oct 2009 13:48:08 +0000 (15:48 +0200)]
maint: remove obsolete syntax-check exclusion

* cfg.mk (local-checks-to-skip): Remove strftime-check.

14 years agotail: avoid a race where we could miss new data with --pid
Pádraig Brady [Thu, 1 Oct 2009 07:36:25 +0000 (08:36 +0100)]
tail: avoid a race where we could miss new data with --pid

* src/tail.c (tail_forever, tail_forever_inotify): Close a race in
tail_forever_inotify where new data written after the file check by
a now dead process, but before the pid check, is not output.  We use
the POSIX guarantee that read() and write() are serialized wrt each
other even in separate processes, to assume full file consistency
after exit() and so poll for new data _after_ the writer has exited.
This also allows us to not redundantly _wait_ for new data if the
process is dead.
* tests/tail-2/pid: Remove the now partially invalid sub second sleep
check as we now don't unconditionally wait, and replace it with a check
for the redundant sleep.  Also clarify some of the existing comments.
* NEWS: Mention the fix.

14 years agomaint: move gnu-web-doc-update script to gnulib
Jim Meyering [Fri, 2 Oct 2009 08:52:09 +0000 (10:52 +0200)]
maint: move gnu-web-doc-update script to gnulib

* bootstrap.conf (gnulib_modules): Add gnu-web-doc-update.
Remove gendocs, since gnu-web-doc-update depends on it.
* gnu-web-doc-update: Remove file, now that we get it from gnulib.

14 years agobuild: update gnulib submodule to latest
Jim Meyering [Fri, 2 Oct 2009 10:10:04 +0000 (12:10 +0200)]
build: update gnulib submodule to latest

14 years agotests: tail-2/pid: use a 3-second timeout, not 1
Jim Meyering [Wed, 30 Sep 2009 21:28:13 +0000 (23:28 +0200)]
tests: tail-2/pid: use a 3-second timeout, not 1

* tests/tail-2/pid: When using the timeout program to ensuring that
tail -s.1 --pid=$PID_T_MAX does not wait forever, use a timeout longer
than 1 second.  A 1-second timeout could be too short on a very busy
system, and result in a timeout, and hence false-positive failure.

2009-09-30  Jim Meyering  <meyering@redhat.com>

14 years agobuild: update gnulib submodule to latest
Jim Meyering [Wed, 30 Sep 2009 15:06:58 +0000 (17:06 +0200)]
build: update gnulib submodule to latest

14 years agobuild: translate diagnostics from two new files
Jim Meyering [Wed, 30 Sep 2009 11:11:38 +0000 (13:11 +0200)]
build: translate diagnostics from two new files

* po/POTFILES.in: Add two new files: lib/siglist.h, lib/strsignal.c

14 years agobuild: now that we use the lock module, don't exclude lock.m4
Jim Meyering [Wed, 30 Sep 2009 14:47:47 +0000 (16:47 +0200)]
build: now that we use the lock module, don't exclude lock.m4

* bootstrap.conf: Don't exclude lock.m4.

14 years agols: always print "?" for allocated size of a dereferenced dangling symlink
Pádraig Brady [Tue, 29 Sep 2009 14:43:01 +0000 (15:43 +0100)]
ls: always print "?" for allocated size of a dereferenced dangling symlink

Previously for `ls -Ls` (but not `ls -Lsl`), we referenced
the st_blocks returned from the previous failed stat() call.
This undefined value was seen to be 0 for dangling symlinks at least.
* src/ls.c (print_file_name_and_frills, length_of_file_name_and_frills):
Don't use st_blocks if the previous stat() failed
* tests/ls/dangle: Add a test case
* NEWS: Mention the fix, and roll up related items into a single entry.

14 years agobuild: use gnulib's freopen module
Jim Meyering [Wed, 30 Sep 2009 07:26:58 +0000 (09:26 +0200)]
build: use gnulib's freopen module

* bootstrap.conf (gnulib_modules): Add freopen, strsignal, fsync.
Exposed via make CFLAGS=-DGNULIB_POSIXCHECK 2>&1 \
|perl -lne '/.* use gnulib module (\S+).*/ and print $1' \
|sort |uniq -c|sort -nr
(avoided_gnulib_modules): Don't avoid the "lock" module.
Now it's required, as a dependency of the strsignal module.

14 years agostat: interpret "-" as standard input
Jim Meyering [Tue, 15 Sep 2009 21:07:18 +0000 (23:07 +0200)]
stat: interpret "-" as standard input

* src/stat.c (do_stat): Interpret a command line argument of "-"
to mean "standard input", like many other tools do.
(do_statfs): Fail upon any attempt to use "-".
* NEWS (Changes in behavior): Mention it.
* tests/misc/stat-hyphen: New test, to exercise the above.
* tests/Makefile.am (TESTS): Add misc/stat-hyphen.

14 years agols: don't use an undefined struct stat after failed stat/lstat
Jim Meyering [Tue, 29 Sep 2009 05:28:01 +0000 (07:28 +0200)]
ls: don't use an undefined struct stat after failed stat/lstat

* src/ls.c (format_inode): Access f->stat only if f->stat_ok is set.
* NEWS (Bug fixes): Mention it.
Improved-by: Pádraig Brady <P@draigBrady.com>
14 years agols: print "?", not "0" as inode of dereferenced dangling symlink
Jim Meyering [Mon, 28 Sep 2009 18:24:41 +0000 (20:24 +0200)]
ls: print "?", not "0" as inode of dereferenced dangling symlink

ls prints inode numbers two ways: for long (-l) listings,
and for short ones, e.g., ls -li and ls -i.  The code to print
long listings properly printed "?" when the inode was unknown,
but the code for handling short listings would print 0 instead.
Factor out the formatting code into a new function so ls prints
the right string ("?") from both places:
* NEWS (Bug fixes): Mention it.
* src/ls.c (format_inode): New function.
(print_long_format): Use it here.
(print_file_name_and_frills): Use it here, too.
* tests/ls/dangle: Exercise this fix.
Reported by Yang Ren in http://bugzilla.redhat.com/525400

14 years agols: with -LR, exit with status 2 upon detecting a cycle
Jim Meyering [Mon, 28 Sep 2009 16:29:02 +0000 (18:29 +0200)]
ls: with -LR, exit with status 2 upon detecting a cycle

* src/ls.c (print_dir): Diagnosing the cycle is not enough.
Also set exit status to 2.  This is what Solaris' /bin/ls does, too.
* tests/ls/infloop: Rework test: match both expected stdout and stderr.
Require an exit status of 2 in this case.
* doc/coreutils.texi (ls invocation): Mention that a loop provokes
in an exit status of 2.
* NEWS (Bug fixes): Mention it.
Reported by Yang Ren in http://bugzilla.redhat.com/525402.
* THANKS: Correct ordering of Yang Ren's names.

14 years agomaint: factor coreutils-specific code out of bootstrap
Jim Meyering [Sat, 26 Sep 2009 12:13:16 +0000 (14:13 +0200)]
maint: factor coreutils-specific code out of bootstrap

* bootstrap (bootstrap_epilogue): Define a default, empty function.
Remove coreutils-specific code, and instead,
invoke this new function at the end of this script.
* bootstrap.conf (bootstrap_epilogue): Define, to override the default.

14 years agocp, mv: use linkat to guarantee semantics
Eric Blake [Thu, 24 Sep 2009 23:11:26 +0000 (17:11 -0600)]
cp, mv: use linkat to guarantee semantics

* src/copy.c (copy_internal): Use linkat, not link.

14 years agoln: add -L/-P options
Eric Blake [Thu, 24 Sep 2009 17:57:11 +0000 (11:57 -0600)]
ln: add -L/-P options

* src/ln.c (STAT_LIKE_LINK): Delete.
(logical): New flag.
(long_options): Add -L, -P.
(usage): Mention them.
(main): Choose between them.
(do_link): Perform correct action.
* tests/ln/misc: Move hard-to-sym portion of test...
* tests/ln/hard-to-sym: ...into new test, and add more.
* tests/Makefile.am (TESTS): Run new test.
* NEWS: Document this.
* doc/coreutils.texi (link invocation, ln invocation): Likewise.
* bootstrap.conf (gnulib_modules): Add linkat.

14 years agobuild: update gnulib submodule to latest
Eric Blake [Wed, 23 Sep 2009 06:37:53 +0000 (08:37 +0200)]
build: update gnulib submodule to latest

14 years agomaint: Use logical rather than bitwise operators on bools
Pádraig Brady [Wed, 23 Sep 2009 09:10:51 +0000 (10:10 +0100)]
maint: Use logical rather than bitwise operators on bools

This is because bitwise operators are:
- confusing and inconsistent in a boolean context
- non short circuiting
- brittle in C89 where bool can be an int (so > 1)

14 years agomaint: expr: avoid compiler warnings without GMP
Pádraig Brady [Wed, 23 Sep 2009 11:49:42 +0000 (12:49 +0100)]
maint: expr: avoid compiler warnings without GMP

* src/expr.c (mpz_clear, mpz_get_str, mpz_out_str)
[!HAVE_GMP]: Reference unused arguments.

14 years agobuild: update gnulib submodule to latest
Eric Blake [Wed, 23 Sep 2009 06:37:53 +0000 (08:37 +0200)]
build: update gnulib submodule to latest

14 years agomaint: summarize gnulib changes
Eric Blake [Tue, 22 Sep 2009 21:07:50 +0000 (15:07 -0600)]
maint: summarize gnulib changes

* NEWS: Provide a blurb about recent gnulib improvements.  Fix typo
in readlink blurb.

14 years agodoc: ls: further improve --help message re --color
Jim Meyering [Tue, 22 Sep 2009 18:53:35 +0000 (20:53 +0200)]
doc: ls: further improve --help message re --color

* src/ls.c (usage): Correct grammar, change voice, shorten.
Inspired by a report from Bruno Schulenberg.

14 years agoreadlink: pick up gnulib changes to readlink -f
Eric Blake [Tue, 22 Sep 2009 21:03:02 +0000 (15:03 -0600)]
readlink: pick up gnulib changes to readlink -f

* bootstrap.conf (obsolete_gnulib_modules): Move rename...
(gnulib_modules): ...here.  Add symlink.
* NEWS: Document the change in readlink.
* doc/coreutils.texi (readlink invocation): Likewise.
* tests/readlink/can-f: Update test to new semantics, and add test
of loop.

14 years agomaint: df.c: adapt to newer gnulib
Jim Meyering [Tue, 22 Sep 2009 17:43:23 +0000 (19:43 +0200)]
maint: df.c: adapt to newer gnulib

* src/df.c: Don't include "canonicalize.h".  No longer needed,
since canonicalize_file_name is now guaranteed to be declared
in <stdlib.h>, thanks to gnulib.

14 years agobuild: update gnulib submodule to latest
Jim Meyering [Wed, 23 Sep 2009 06:37:53 +0000 (08:37 +0200)]
build: update gnulib submodule to latest

14 years agodoc: stdbuf: mention it can have a non standard exit status
Pádraig Brady [Tue, 22 Sep 2009 07:35:25 +0000 (08:35 +0100)]
doc: stdbuf: mention it can have a non standard exit status

* doc/coreutils.texi (Exit status): Add stdbuf to the list

14 years agomaint: uptime: fix a theoretical compile warning
Pádraig Brady [Tue, 22 Sep 2009 07:01:44 +0000 (08:01 +0100)]
maint: uptime: fix a theoretical compile warning

* src/uptime.c (print_uptime) [!HAVE_UTMPX_H && !HAVE_UTMP_H]:
Reference possibly unused arguments.

14 years agols: fix a performance regression
Pádraig Brady [Tue, 22 Sep 2009 09:06:49 +0000 (10:06 +0100)]
ls: fix a performance regression

* src/ls.c (print_color_indicator): This reinstates commit f3f1ccfd,
21-10-2008, "ls: make it possible to disable file capabilities checking"
which was inadvertently reverted with commit 3a169f4c, 14-09-2009,
"ls: handle disabling of colors consistently ...".

14 years agobuild: avoid compiler warnings on cygwin 1.5
Eric Blake [Mon, 21 Sep 2009 16:28:01 +0000 (10:28 -0600)]
build: avoid compiler warnings on cygwin 1.5

* src/copy.c (utimens_symlink): Avoid unused variables.
* src/su.c (getusershell): Rely on gnulib for prototype.

14 years agodoc: ls: add an article, "the"
Jim Meyering [Mon, 21 Sep 2009 12:28:54 +0000 (14:28 +0200)]
doc: ls: add an article, "the"

* src/ls.c (usage): Tweak wording.

14 years agols: handle disabling of colors consistently for all tile types
Pádraig Brady [Mon, 14 Sep 2009 12:37:37 +0000 (13:37 +0100)]
ls: handle disabling of colors consistently for all tile types

* src/ls.c (print_color_indicator): Use consistent syntax for
all file and directory subtypes, and fall back to the color
of the base type if there is no enabled color for the subtype.
This allows turning off specific colors for o+w dirs for example.
* tests/ls/color-dtype-dir: Add a case to test that turning off
coloring for o+w directories, falls back to standard dir color.
* NEWS: Mention the fix
Introduced by commit ac467814, 2005-09-05,
"Colorize set-user-ID ... files and sticky ... directories."

14 years agodoc: ls: make help for --color more concise and accurate
Pádraig Brady [Thu, 10 Sep 2009 07:00:31 +0000 (08:00 +0100)]
doc: ls: make help for --color more concise and accurate

* src/ls.c (usage): Shorten the --color ancillary info by
two lines, while replacing --color=none with --color=never.
Mention "always" is the default parameter of the --color option,
along with the primary help for that option.
Mention the ancillary --color info in the --color primary help.

14 years agodoc: normalize and add missing entries to texinfo menu
Pádraig Brady [Mon, 21 Sep 2009 06:51:33 +0000 (07:51 +0100)]
doc: normalize and add missing entries to texinfo menu

* doc/coreutils.texi: Add the missing arch, base64, link, readlink,
and unlink entries.  Also remove extraneous '.' from some entries
and try to align all entries on the same column.
* THANKS: Add Benno Schulenberg.

14 years agodoc: mention the texinfo documentation in --help
Pádraig Brady [Fri, 18 Sep 2009 22:06:21 +0000 (23:06 +0100)]
doc: mention the texinfo documentation in --help

* src/system.h: Rename emit_bug_reporting_address() to
emit_ancillary_info() and update it to not print the translation
project address in en_* locales, and _do_ print it in the 'C'
(and other) locales so that it's included in the default man page.
Also mention how to invoke the texinfo documentation for each command.
Also move the "hard-locale.h" include to the 8 files that now use it.
* man/help2man: Strip the newly added texinfo reference from the
--help output as a more verbose version is already added by help2man.
Suggestion from C de-Avillez

14 years agomaint: automate the web-doc updating procedure
Jim Meyering [Mon, 21 Sep 2009 06:56:17 +0000 (08:56 +0200)]
maint: automate the web-doc updating procedure

* gnu-web-doc-update: New script, destined for gnulib.
* README-release: Refer to the new script.

14 years agodircolors: arrange to highlight names with the .lz suffix
Jim Meyering [Sat, 19 Sep 2009 10:26:36 +0000 (12:26 +0200)]
dircolors: arrange to highlight names with the .lz suffix

* src/dircolors.hin: Add .lz, for GNU lzip.
Suggested by Matias A. Fonzo.

14 years agomktemp: adapt to new, 3-argument gen_tempname_len
Jim Meyering [Fri, 18 Sep 2009 21:05:59 +0000 (23:05 +0200)]
mktemp: adapt to new, 3-argument gen_tempname_len

* src/mktemp.c (mkstemp_len, mkdtemp_len): Update callers of
gen_tempname_len.
* gl/lib/tempname.c, gl/lib/tempname.h: Rebase against recently
API-modified copy of tempname module in gnulib.
Reported by Lluís Batlle.

14 years agobuild: merge bootstrap changes from gnulib
Jim Meyering [Thu, 17 Sep 2009 12:30:01 +0000 (14:30 +0200)]
build: merge bootstrap changes from gnulib

* bootstrap: Update from gnulib.

14 years agorm, rmdir: improve cross-compilation support
Eric Blake [Wed, 16 Sep 2009 14:27:07 +0000 (08:27 -0600)]
rm, rmdir: improve cross-compilation support

* bootstrap.conf (gnulib_modules): Drop rmdir-errno.
* src/rmdir.c (errno_rmdir_non_empty): Check both cases allowed by
POSIX, rather than relying on configure-time check that might
fail during cross-compilation.  Reverts commit 9b6eb98d41.

14 years agocp: fix a probably redundant chmod when setting xattrs
Ondřej Vašík [Tue, 15 Sep 2009 09:41:23 +0000 (10:41 +0100)]
cp: fix a probably redundant chmod when setting xattrs

* src/copy.c (copy_reg): Fix initial value of access_changed variable.
This was introduced by Pádraig Brady in commit cca83faf, 2009-09-14,
"cp,mv: preserve extended attributes even for read-only files"

14 years agodoc: NEWS: mention origin of touch -t ....60 bug
Jim Meyering [Mon, 14 Sep 2009 13:57:13 +0000 (15:57 +0200)]
doc: NEWS: mention origin of touch -t ....60 bug

* NEWS: It is an old bug.

14 years agodoc: touch, document that it accepts .60
Jim Meyering [Mon, 14 Sep 2009 13:37:26 +0000 (15:37 +0200)]
doc: touch, document that it accepts .60

* doc/coreutils.texi (touch invocation): Document that SS may be 60.

14 years agotouch: don't reject "60" as number of seconds in a legacy time stamp
Jim Meyering [Sat, 12 Sep 2009 12:00:32 +0000 (14:00 +0200)]
touch: don't reject "60" as number of seconds in a legacy time stamp

A valid command like "touch -t 197101010000.60 F" would fail due
to the suffix of ".60".  This bug is fixed via the latest change
to gnulib's posixtm module.
* tests/touch/60-seconds: New test.
* tests/Makefile.am (TESTS): Add it.
* NEWS (Bug fixes): Mention it.

14 years agobuild: update gnulib submodule to latest, for fixed posixtm module
Jim Meyering [Mon, 14 Sep 2009 12:54:23 +0000 (14:54 +0200)]
build: update gnulib submodule to latest, for fixed posixtm module

14 years agomaint: use #!/bin/sh consistently in shell-based test scripts
Jim Meyering [Mon, 14 Sep 2009 12:53:24 +0000 (14:53 +0200)]
maint: use #!/bin/sh consistently in shell-based test scripts

* tests/misc/sort-continue: Change first line to standard #!/bin/sh,
not #!/bin/bash (though it doesn't matter, since each is invoked
via $(SHELL) dir/test-name.

14 years agotests: fix dd/skip-seek-past-file to work on ecryptfs
Pádraig Brady [Mon, 14 Sep 2009 00:38:03 +0000 (01:38 +0100)]
tests: fix dd/skip-seek-past-file to work on ecryptfs

* tests/dd/skip-seek-past-file: Require sparse support
to ensure that when we're checking if we can create an
$OFF_T_MAX length file, that we don't actually allocate
any space.  This was an issue on ecryptfs and was reported
by Bert Wesarg.

14 years agocp,mv: preserve extended attributes even for read-only files
Ondřej Vašík [Mon, 14 Sep 2009 13:12:01 +0000 (14:12 +0100)]
cp,mv: preserve extended attributes even for read-only files

* src/copy.c (copy_reg): Temporarily set u+rw on the destination file
to allow GNU/Linux to set xattrs.
* tests/misc/xattr: Test that change.
* NEWS (Bug fixes): Mention it.
Reported by Ernest N. Mamikonyan.

14 years agodoc: improve timeout's --help message
Jim Meyering [Mon, 14 Sep 2009 07:18:30 +0000 (09:18 +0200)]
doc: improve timeout's --help message

* src/timeout.c (usage): Improve --help description.

14 years agomaint: use consistent cpp indentation in all .c files
Jim Meyering [Sun, 13 Sep 2009 20:05:37 +0000 (22:05 +0200)]
maint: use consistent cpp indentation in all .c files

* src/stty.c: Make cpp indentation reflect nesting.
* src/factor.c: Likewise.

14 years agodoc: NEWS: say quadratic and linear, rather than O(N^2) and O(N)
Jim Meyering [Sun, 13 Sep 2009 10:11:57 +0000 (12:11 +0200)]
doc: NEWS: say quadratic and linear, rather than O(N^2) and O(N)

* NEWS: Use a slightly less technical description.
Suggested by Andreas Schwab.

14 years agodoc: improve NEWS
Jim Meyering [Sun, 13 Sep 2009 09:48:03 +0000 (11:48 +0200)]
doc: improve NEWS

* NEWS (rm -r, without -f): Mention that the N in "O(N)" represents
hierarchy depth.  Suggested by Ralf Wildenhues.
(rm -r, standards conformance): Make wording more accurate.

14 years agoid: don't print context=... when POSIXLY_CORRECT is set
Jim Meyering [Fri, 11 Sep 2009 14:30:27 +0000 (16:30 +0200)]
id: don't print context=... when POSIXLY_CORRECT is set

* src/id.c (print_full_info) [POSIXLY_CORRECT]: Don't print context.
Reported by Ulrich Drepper.
* NEWS (Changes in behavior): Mention it.
* doc/coreutils.texi (id invocation): Document that id also prints the
security context, when possible, and when POSIXLY_CORRECT is not set.
* tests/id/no-context: New file.  Test for this.
* tests/Makefile.am (TESTS): Add it.

14 years agorm: avoid compiler warning
Eric Blake [Fri, 4 Sep 2009 04:45:36 +0000 (22:45 -0600)]
rm: avoid compiler warning

* src/remove.c (rm_fts): Don't allow fall-through when assertions
are disabled.

14 years agoeuidaccess-stat: remove unnecessary macros
Eric Blake [Fri, 4 Sep 2009 04:07:39 +0000 (22:07 -0600)]
euidaccess-stat: remove unnecessary macros

* lib/euidaccess-stat.c (F_OK, R_OK, W_OK, X_OK): Delete; now
guaranteed by gnulib.

14 years agorm: use gnulib faccessat
Eric Blake [Fri, 4 Sep 2009 03:59:54 +0000 (21:59 -0600)]
rm: use gnulib faccessat

* bootstrap.conf (gnulib_modules): Add faccessat.  Replace strdup
with strdup-posix.
* m4/jm-macros.m4 (coreutils_MACROS): Revert previous change, now
that gnulib does it for us.
* src/remove.c (write_protected_non_symlink): Use faccessat in
more situations.

14 years agorm: improve efficiency of rm -r (without -f) from O(N^2) to O(N)
Jim Meyering [Thu, 3 Sep 2009 13:15:09 +0000 (15:15 +0200)]
rm: improve efficiency of rm -r (without -f) from O(N^2) to O(N)

where N is the depth of the deepest hierarchy rm is processing.
* src/remove.c (write_protected_non_symlink): Use faccessat to
avoid O(N)-per-entry cost of calling euidaccess.
* m4/jm-macros.m4 (coreutils_MACROS): Check for faccessat.
* NEWS (Improvements): Mention it.

14 years agobuild: placate gcc's new -Wskip-jump-init
Jim Meyering [Sat, 15 Aug 2009 15:22:01 +0000 (17:22 +0200)]
build: placate gcc's new -Wskip-jump-init

* remove.c (rm_fts): Put braces around each of the two offending blocks.
* configure.ac: Don't turn off -Wjump-misses-init.
With the rewrite of remove.c, it is no longer needed.

14 years agorm: rewrite to use fts
Jim Meyering [Sun, 12 Jul 2009 16:15:23 +0000 (18:15 +0200)]
rm: rewrite to use fts

* remove.c: Don't include "unlinkdir.h"; no longer used.
Do not include <setjmp.h> or "cycle-check.h".  Likewise.
Include "xfts.h".
(dir_name, dir_len): Remove definitions.
(CONSECUTIVE_READDIR_UNLINK_THRESHOLD): Likewise.
(INODE_SORT_DIR_ENTRIES_THRESHOLD, NEED_REWIND, D_TYPE): Likewise.
(struct dirstack_state, Dirstack_state): Likewise.
(g_buf, g_n_allocated): Remove declarations.
(hash_freer, hash_compare_strings, rm_malloc): Remove functions.
(rm_free, push_dir, top_dir, pop_dir, right_justify): Likewise.
(full_filename0, xfull_filename, full_filename_): Likewise.
(AD_stack_height, AD_stack_top, AD_stack_pop, AD_stack_clear): Likewise.
(obstack_init_minimal, ds_init, ds_clear, ds_free): Likewise.
(AD_pop_and_chdir, AD_ensure_initialized, AD_mark_helper): Likewise.
(AD_mark_as_unremovable, AD_mark_current_as_unremovable): Likewise.
(AD_push_initial, AD_push, AD_push, AD_is_removable): Likewise.
(write_protected_non_symlink): Change 3rd parameter from
dirstack_state "ds" to full_name.
(prompt): Adjust parameters.  Now, state comes from FTS/FTSENT pair.
Those replace fd_cwd and "ds".  Remove "filename".  Remove pdirent_type
in favor of new "is_dir" parameter.  Rename is_empty to is_empty_p.
(DO_RMDIR, DO_UNLINK): Remove definitions.
(remove_entry, fd_to_subdirp, compare_ino): Remove functions.
(dirent_count, dirent_inode_sort_may_be_useful): Likewise.
(preprocess_dir): Likewise.
(fts_skip_tree, mark_ancestor_dirs, excise, rm_fts): New functions.
(remove_cwd_entries, remove_dir, rm_1): Remove functions.
(rm): Rewrite as a simple loop calling fts_read and dispatching
each entry via rm_fts.
* src/rm.c (main): Adapt to new signature of rm().
* bootstrap.conf (gnulib_modules): Remove unlinkdir, no longer used.
* src/Makefile.am (sc_tight_scope): Also recognize an extern "enum"
declaration.
* tests/rm/empty-name: Adjust expected output to match new diagnostic.
* NEWS (Improvements): Mention it.

14 years agomaint: doc: adjust README-release
Jim Meyering [Fri, 11 Sep 2009 11:13:45 +0000 (13:13 +0200)]
maint: doc: adjust README-release

* README-release: Remove mention of bootstrap's old
--gnulib-srcdir=/gnulib option.  No longer needed, and its
use can lead to subtle problems.

14 years agopost-release administrivia
Jim Meyering [Fri, 11 Sep 2009 06:16:18 +0000 (08:16 +0200)]
post-release administrivia

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

14 years agoversion 7.6 v7.6
Jim Meyering [Fri, 11 Sep 2009 05:53:16 +0000 (07:53 +0200)]
version 7.6

* NEWS: Record release date.

14 years agolink,ln: use gnulib's link module to work around Solaris 10 deficiency
Jim Meyering [Thu, 10 Sep 2009 15:51:44 +0000 (17:51 +0200)]
link,ln: use gnulib's link module to work around Solaris 10 deficiency

Before this change, :>f; ln -T f no-such/ would succeed on Solaris 10.
After it, ln fails, as it should: ln: accessing `z/': Not a directory
The command, link f no-such/, had the same problem on that system.
* bootstrap.conf (gnulib_modules): Add "link".
* tests/ln/slash-decorated-nonexistent-dest: New test.
* tests/Makefile.am (TESTS): Add it.
* NEWS (Portability): Mention the improvement.

14 years agobuild: update gnulib submodule to latest
Jim Meyering [Thu, 10 Sep 2009 14:51:35 +0000 (16:51 +0200)]
build: update gnulib submodule to latest

14 years agodoc: improve various BLOCKSIZE and SIZE help
Ondřej Vašík [Thu, 10 Sep 2009 11:33:41 +0000 (12:33 +0100)]
doc: improve various BLOCKSIZE and SIZE help

* doc/coreutils.texi (multiplierSuffixes): Mention that
the suffix can be specified without a leading number
* src/split.c (usage): Refactor SIZE help to within a function
* src/truncate.c (usage): Likewise
* src/ls.c (usage): Likewise
* src/df.c (usage): Likewise. Also add a function with BLOCKSIZE help
* src/du.c (usage): Likewise.
* src/system.h: Define 2 functions to emit common help text
This was prompted by https://bugzilla.redhat.com/show_bug.cgi?id=511188

14 years agodd conv=unblock: print final newline consistently
Jim Meyering [Wed, 9 Sep 2009 14:48:02 +0000 (16:48 +0200)]
dd conv=unblock: print final newline consistently

* src/dd.c (dd_copy) [C_UNBLOCK]: Always print the final newline for
non-empty output, not just when output size is a multiple of cbs.
* doc/coreutils.texi (dd invocation) [conv=unblock]: Mention that dd
prints a newline after each output record, not just when replacing
trailing spaces.
Reported by Ulrich Drepper.
* tests/dd/unblock: New file.  Test for this.
* tests/Makefile.am (TESTS): Add it.
* NEWS (Bug fixes): Mention it.

14 years agomaint: make cfg.mk slightly more generic
Jim Meyering [Wed, 9 Sep 2009 14:44:37 +0000 (16:44 +0200)]
maint: make cfg.mk slightly more generic

* cfg.mk (url_dir_list): Don't hard-code "coreutils".  Use $(PACKAGE).

14 years ago* gnulib: Update submodule to latest.
Jim Meyering [Tue, 8 Sep 2009 07:45:44 +0000 (09:45 +0200)]
* gnulib: Update submodule to latest.

14 years agotail: make the new piped-stdin test as portable as the old one
Jim Meyering [Tue, 8 Sep 2009 06:26:22 +0000 (08:26 +0200)]
tail: make the new piped-stdin test as portable as the old one

* src/tail.c (main): Adapt piped-stdin test to use the same isapipe,
test as was used in the preceding POSIXLY_CORRECT condition.
Remove the now-subsumed POSIXLY_CORRECT test.
Reported by Pádraig Brady.
* doc/coreutils.texi (tail invocation): Document this change.
* NEWS (Changes in behavior): Reclassify, clarify.

14 years agotests: tail-2/assert: reduce risk of race condition
Pádraig Brady [Tue, 8 Sep 2009 09:00:01 +0000 (10:00 +0100)]
tests: tail-2/assert: reduce risk of race condition

* tests/tail2/assert: This reverts commit be853120, 25-08-2009,
"tests: tail-2/assert: avoid risk of race condition"
kill -0 doesn't send a signal and so will only confirm that the
background process was forked, which we know already because
we have its pid.

14 years agotests: address a race condition in misc/cat-buf
Pádraig Brady [Mon, 7 Sep 2009 22:50:19 +0000 (23:50 +0100)]
tests: address a race condition in misc/cat-buf

* tests/misc/cat-buf: Increase the delay between writes
to decrease the chance that dd will read both at once.
Since the test is inherently racy, print a warning via
skip_test_ rather than failing outright.
Reported by Jim Meyering.

14 years agotail: syntax-only: use "false", rather than equivalent, 0
Jim Meyering [Mon, 7 Sep 2009 20:36:05 +0000 (22:36 +0200)]
tail: syntax-only: use "false", rather than equivalent, 0

* src/tail.c (record_open_fd): Initialize "->ignore" to false, not 0.

14 years agotail: ignore -f for piped-stdin, as POSIX requires
Jim Meyering [Mon, 7 Sep 2009 20:10:10 +0000 (22:10 +0200)]
tail: ignore -f for piped-stdin, as POSIX requires

* src/tail.c (main): Tailing a pipe "forever" is not useful,
and POSIX specifies that tail ignore the -f when there is no
file argument and stdin is a FIFO or pipe.  So we do that.
In addition, GNU tail excludes "-" arguments from the list of files
to tail forever, when the associated file descriptor is connected
to a FIFO or pipe.  Before this change, ":|tail -f" would hang.
Reported by Ren Yang and Ulrich Drepper.
* tests/tail-2/pipe-f: Test for this.
* tests/tail-2/pipe-f2: Ensure tail doesn't exit early for a fifo.
* tests/Makefile.am (TESTS): Add these tests.
* NEWS (POSIX conformance): Mention it.

14 years agotests: tail-2/flush-initial should not rely on stdbuf
Pádraig Brady [Mon, 7 Sep 2009 16:03:08 +0000 (17:03 +0100)]
tests: tail-2/flush-initial should not rely on stdbuf

* tests/tail-2/flush-initial: stdbuf is not built on all systems.
In any case it's redundant since stdout will automatically be buffered
since we're redirecting to file. So just call tail without using stdbuf.

14 years agotail: don't give up on inotify mode for an already-ignored "-"
Jim Meyering [Mon, 7 Sep 2009 18:56:38 +0000 (20:56 +0200)]
tail: don't give up on inotify mode for an already-ignored "-"

* src/tail.c (main): Adjust today's change to honor the
F[i].ignore flag that may have been set in tail_file.

14 years agotests: misc/cat-buf: clean up syntax
Jim Meyering [Mon, 7 Sep 2009 18:23:03 +0000 (20:23 +0200)]
tests: misc/cat-buf: clean up syntax

* tests/misc/cat-buf: Don't suppress dd's stderr.
Remove useless quotes.

14 years agotests: ls/color-clear-to-eol: append NL to accommodate old sed
Jim Meyering [Mon, 7 Sep 2009 17:36:21 +0000 (19:36 +0200)]
tests: ls/color-clear-to-eol: append NL to accommodate old sed

* tests/ls/color-clear-to-eol: Some vendor sed programs fail
to operate on lines that are not NL-terminated.
This affects at least Solaris 10's /bin/sed.
Reported by Pádraig Brady.

14 years agotests: tail-2/infloop-1: avoid rare test failure on a busy system
Jim Meyering [Mon, 7 Sep 2009 09:39:19 +0000 (11:39 +0200)]
tests: tail-2/infloop-1: avoid rare test failure on a busy system

* tests/tail-2/infloop-1: Sleep 3 seconds, not 1, but in increments
of 0.1 second.  Before, this test would fail ~1 time in 20 via
"make -j9 check" on a quad-core system.
Correct comment.

14 years agobuild: update gnulib submodule to latest
Jim Meyering [Mon, 7 Sep 2009 07:23:57 +0000 (09:23 +0200)]
build: update gnulib submodule to latest

14 years agodoc: tweak NEWS
Jim Meyering [Mon, 7 Sep 2009 07:23:19 +0000 (09:23 +0200)]
doc: tweak NEWS

* NEWS (dd): Tweak wording.
Two blank lines between sections.