Age | Commit message (Collapse) | Author |
|
* tests/init.cfg (skip_test_): Remove function.
Use skip_ in place of skip_test_ everywhere else.
* cfg.mk (sc_prohibit_skip_): Remove rule.
* tests/**: Use skip_, not skip_test_, everywhere.
|
|
* tests/ls/stat-free-color: This test recently began to fail on
rawhide because dynamic library start-up code now stats "/selinux",
making the total number of calls 2 rather than the prior 1.
Create two more dangling symlinks, so that any erroneous stat-
or lstat-calling code will get at least those three.
|
|
* tests/ls/stat-free-color: Also check for stat64 and lstat64 syscalls.
This fixes a test failure reported by Stefano Lattarini.
|
|
* tests/cp/existing-perm-race: s/mkfifo/mkfifo_or_skip_/
* tests/cp/file-perm-race: Likewise.
* tests/cp/parent-perm-race: Likewise.
* tests/cp/special-f: Likewise.
* tests/dd/reblock: Likewise.
* tests/ls/file-type: Likewise.
* tests/misc/cat-buf: Likewise.
* tests/misc/mknod: Likewise.
* tests/misc/printf-surprise: Likewise.
* tests/misc/selinux: Likewise.
* tests/misc/sort-spinlock-abuse: Likewise.
* tests/misc/stdbuf: Likewise.
* tests/misc/tac-continue: Likewise.
* tests/init.cfg: Improve the error message when skipping.
|
|
Even on a system with d_type support, the default use of --color
makes ls stat every file in order to be able to honor settings like
EXEC, STICKY, ORPHAN, SETUID, etc., because those settings require
information that is not provided by dirent.d_type. However, if
for a potentially large performance gain, you are willing to disable
those settings, you can now make ls --color give type-related coloring
and perform no stat calls at all (other than the unavoidable call-per-
command-line argument). Before this change, even with all of those
attributes disabled, ls --color would still stat every directory.
Now, we're down to the minimum of one stat call per command-line arg.
* src/ls.c (gobble_file): With --color, don't stat a
non-command-line-specified directory when no directory-coloring
attribute is enabled.
* tests/init.cfg (require_dirent_d_type_): New function.
* tests/d_type-check: New script, mostly from Pádraig Brady.
* tests/Makefile.am (EXTRA_DIST): Add it.
* tests/ls/stat-free-color: New test.
* tests/Makefile.am (TESTS): Add it.
* doc/coreutils.texi (General output formatting): Describe how
to use dircolors to make ls --color refrain from calling stat
on a d_type-enabled file system.
Prompted by a query from Josef Bacik.
|
|
* tests/ls/color-norm: s/to to/to/
* gl/lib/mbsalign.h (mbs_align_t): s/or or/or/
* src/extent-scan.c (extent_scan_read): s/the the/the/
* src/libstdbuf.c: s/the the/the/
* tests/misc/stdbuf: s/on on/on/
* ChangeLog-2005: s/for\n\tfor /for\n\t/
|
|
Run "make update-copyright".
|
|
* cfg.mk (LINE_LEN_MAX, FILTER_LONG_LINES): New macros.
(sc_long_lines): New rule.
* HACKING: Use shorter URLs to the same material.
* doc/Makefile.am, doc/coreutils.texi, m4/boottime.m4:
* man/help2man, man/stdbuf.x, src/Makefile.am, src/cat.c, src/copy.c:
* src/cp.c, src/dd.c, src/df.c, src/du.c, src/groups.c, src/install.c:
* src/ls.c, src/md5sum.c, src/mv.c, src/od.c, src/pinky.c, src/ptx.c:
* src/readlink.c, src/remove.c, src/rmdir.c, src/setuidgid.c:
* src/sort.c, src/tail.c, src/touch.c, tests/Coreutils.pm:
* tests/cp/existing-perm-race, tests/cp/perm, tests/cp/preserve-gid:
* tests/du/2g, tests/du/long-from-unreadable, tests/init.sh:
* tests/install/basic-1, tests/ls/nameless-uid:
* tests/ls/readdir-mountpoint-inode, tests/misc/chroot-credentials:
* tests/misc/cut, tests/misc/date, tests/misc/join, tests/misc/md5sum:
* tests/misc/sha1sum, tests/misc/sha224sum, tests/misc/sort:
* tests/misc/sort-continue, tests/misc/sort-files0-from:
* tests/misc/sort-rand, tests/misc/stdbuf, tests/misc/tr:
* tests/misc/uniq, tests/mv/atomic, tests/mv/part-fail:
* tests/mv/part-symlink, tests/mv/sticky-to-xpart, tests/pr/pr-tests:
* tests/rm/fail-2eperm, tests/rm/interactive-always:
Reformat to fit within 80 columns.
* doc/Makefile.am (BAD_POSIX_PERL): New macro.
* doc/coreutils.texi: Reword slightly, to make menus and
index lines shorter.
* src/md5sum.c: Redo --help output so that it fits within 79
columns, since that's a bit more portable and all the other --help
strings fit in 79 columns.
|
|
E.g.,
-test "$VERBOSE" = yes && { env -- pwd --version; readlink --version; }
+print_ver_ pwd readlink
-test "$VERBOSE" = yes && { stdbuf --version; mv --version; }
+print_ver_ stdbuf mv
Use this command:
git grep -l 'VERBOSE.*--version'|xargs perl -ni \
-e '/^test "\$VERBOSE" = yes && { .*--version/ or print,next;' \
-e 's/env -- //g;' \
-e 's/test "\$VERBOSE" = yes && { /print_ver_ /;' \
-e ' s/(\w+) --version;/$1/g; s/ *}$//; print'
|
|
Automatically make all of the changes like this:
-test "$VERBOSE" = yes && chgrp --version
+print_ver_ chgrp
git grep -l 'VERBOSE.*--version'|xargs perl -pi -e \
's/test "\$VERBOSE" = yes && (\w+) --version/print_ver_ $1/'
|
|
RHS='. "\${srcdir=.}/init.sh"; path_prepend_ ../src'
git grep -l test-lib.sh \
| xargs perl -pi -e 's,^\. \$srcdir/test-lib\.sh$,'"$RHS",
|
|
|
|
Initially, I did this,
git grep -l srcdir/test-lib.sh|xargs perl -p0i -e '~180-byte script'
but that line would have been much longer than the maximum permitted
by coreutils' commit hook, and wasn't readable besides, so here's a
more readable version:
lhs=$(printf '%s\\n' \
'if test "$VERBOSE" = yes; then' \
' set -x' \
' touch --version' \
'fi' \
'' \
'. $srcdir/test-lib.sh' \
| sed 's/\$/\\\$/g;s/touch/(\\w+)/')
rhs=$(printf '%s\\n' \
'. "${srcdir=.}/init.sh"; path_prepend_ ../src' \
'test "$VERBOSE" = yes && FIXME --version' \
| sed 's/\$/\\\$/g;s/FIXME/\$1/')
git grep -l srcdir/test-lib.sh|xargs perl -p0i -e "s,$lhs,$rhs,"
|
|
* tests/ls/stat-free-symlinks: strace currently outputs an
informational message about arch difference to stdout.
Therefore we need to strip that before comparison.
|
|
* tests/init.cfg (retry_delay_): Describe
the backoff method used.
* tests/ls/readdir-mountpoint-inode: Add a timeout
to the stat call to eliminate the chance of hangups.
* tests/mv/i-3: Change the timeout required to pass
from 1 second to a range of .1s - 3.1s.
* tests/rm/dangling-symlink: Likewise.
|
|
* tests/ls/readdir-mountpoint-inode: Check to see if skip_test_ is
called in a helper function via $() instead of mistakenly failing.
* THANKS: Update.
|
|
* tests/ls/color-norm: Use the "time" output by `ls -l`
to check normal style. Previously we used the size from `ls -s`,
but the size of "empty" files can vary depending on whether
SELinux is enabled for example.
|
|
* tests/ls/capability: Adjust this test not to expect the no-op escape
sequence that was removed from all other tests by 2010-01-30 commit
5d43617e, "ls --color: don't emit a final no-op escape sequence".
|
|
Output the NORMAL attribute before non file name text.
This attribute will continue into file names that would
not otherwise be colored unless FILE is also set.
The regression was introduced with commit 483297d5, 28-02-2009,
"ls --color no longer outputs unnecessary escape sequences".
* src/ls.c (set_normal_color): A new function to output the
NORMAL attribute sequence if it's enabled.
(print_current_files): Output NORMAL before printing long format info.
(print_file_name_and_frills): Output NORMAL before printing file name.
(print_color_indicator): Reset the attributes before a file name with
attributes so that NORMAL attributes will not combine with them.
(print_name_with_quoting): Ensure attributes are reset after printing
the file name if NORMAL attributes were output.
* tests/ls/color-norm: A new test for NORMAL and FILE combinations.
* tests/Makefile.am: Reference the new test.
* NEWS: Mention the fix.
Reported in https://savannah.gnu.org/bugs/?26512
|
|
Prompted by the continuous integration build failure at:
http://hydra.nixos.org/build/277485
* tests/misc/timeout: Set all expected timeouts to 1s and all
unexpected timeouts to 10s. In this way, tests normally proceed
quickly but may delay up to 10s before reporting failures.
* tests/ls/infloop: Likewise.
* tests/tail-2/pid: Likewise.
* tests/tail-2/pipe-f: Likewise.
* tests/tail-2/wait: Likewise.
* tests/dd/skip-seek-past-dev: Likewise.
|
|
* src/ls.c (main): With --color, avoid emitting the final color-
resetting escape sequence when it would be a no-op.
* tests/ls/color-clear-to-eol: Adjust expected output accordingly.
* tests/ls/color-dtype-dir: Likewise.
* tests/ls/multihardlink: Likewise.
* tests/ls/stat-free-symlinks: Likewise.
* tests/misc/ls-misc: Likewise.
* NEWS (Changes in behavior): Mention it.
C de-Avillez rebased and adapted four of the new sl-dangle*
tests in tests/misc/ls-misc.
Reported by Jim Avera in
http://bugs.launchpad.net/ubuntu/+source/coreutils/+bug/494663
|
|
* tests/cp/acl: Support USE_ACL not being defined.
* tests/mv/acl: Likewise. Also fix typo in skip message.
* tests/cp/preserve-slink-time: Support HAVE_UTIMENSAT being 0.
* tests/touch/no-dereference: Likewise.
* tests/ls/capability: Normalize so 1 is not required to be last char.
|
|
* tests/ls/infloop: OpenBSD4.5's /bin/sh would mistakenly include
"set -x"-output in an application's stderr stream when stderr is
redirected before stdout. This was causing one spurious test failure.
The work-around: redirect stdout first.
Reported by Nelson Beebe.
|
|
Use this command:
git ls-files | grep -v COPYING \
| xargs env UPDATE_COPYRIGHT_USE_INTERVALS=1 \
build-aux/update-copyright
|
|
* tests/ls/readdir-mountpoint-inode: With some systems, stat can
succeed on a mount point and report that the inode number is 0.
Since ls displays "?" for those, that would otherwise show up as a
difference. Skip such mount points. Reported by Sergei Steshenko
in http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/19142
|
|
Capability checking was incorrectly done on just the base name
rather than on the whole path. Consequently there could be both
false positives and negatives when coloring files with capabilities.
Also capability checking was not done at all in certain cases for
non executable files. Note passing absolute rather than relative
names to cap_get_file() reduces the has_capability() overhead
from around 33% to 30%. I.E. ls --color is now around 3% faster.
* src/ls.c (struct fileinfo): Add a has_capability member.
(print_color_indicator): Refactor to pass just a fileinfo pointer
and a flag to say if we're dealing with a symlink target.
(print_name_with_quoting): Likewise.
(gobble_file): Set has_capability in the fileinfo struct. Also do
a capability check even if executable coloring is disabled.
Ditto for SETUID and SETUID coloring.
Comment on how expensive has_capability() is.
(print_long_format): Adjust to refactored print_name_with_quoting.
(quote_name): Likewise.
(print_file_name_and_frills): Likewise.
* tests/ls/capability: Test the various false positive and negatives.
* THANKS: Add reporter (Ivan Labath).
* NEWS: Mention the fix.
|
|
Run this command to remove the factored-out "fail=0" lines.
perl -ni -e '/^fail=0$/ or print' $(g grep -l '^fail=0$')
* tests/test-lib.sh: Initialize fail=0 here, not in 300+ scripts.
* tests/...: nearly all bourne shell scripts
Suggested by Eric Blake.
|
|
* tests/ls/abmon-align: Don't remove (1d;) the first line of output.
That was making the test consider only 11 of 12 month names.
Rewrite not to use \(.*\), as that provoked a malfunction in GNU sed
on powerpc Mac OS X (though we don't know yet whether this is due to a
sed bug, or to miscompilation). Nelson Beebe reported the test failure.
|
|
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.
|
|
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
|
|
* 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.
|
|
* 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."
|
|
* 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.
|
|
* tests/ls/stat-vs-dirent: Avoid test failure when run from a
directory whose name (or ancestor directory name) starts with ".".
|
|
On most unix- and linux-based kernels, ls -i DIR_CONTAINING_MOUNT_POINT
would print the wrong inode number for any entry that is a mount point.
It would do that by relying on readdir's dirent.d_ino values, while
most readdir implementations return the inode number of the underlying,
inaccessible directory. Thus, it is not consistent with what you'd
get when applying stat to the same entry. This bug led to surprising
results like "ls -i" and "ls -i --color" printing different numbers (ls
must usually "stat" a file to colorize its name). This change makes it
so that on offending systems, ls must stat non-command-line-arguments
for which otherwise it would be able to use "for free" dirent.d_ino
values. Regardless of this change, ls is already required to stat every
command-line argument. Note: versions of GNU ls prior to coreutils-6.0
did not perform the invalid optimization, and hence always printed
correct inode numbers. Thus, for the sake of correctness, ls -i is
forgoing the readdir optimization, for any kernel (including linux!)
with POSIX-nonconforming readdir. Note that currently, only Cygwin has
been agile enough to conform.
* src/ls.c (RELIABLE_D_INO): Define.
(print_dir): Use it.
For plenty of discussion, see this long thread:
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/14020
This bug was introduced by the 2006-02-26 commit, 33eb3efe:
"In ls, avoid calling stat for --inode (-i), when possible."
* tests/ls/readdir-mountpoint-inode: New test.
* tests/Makefile.am (TESTS): Add it.
* tests/ls/stat-vs-dirent: Don't suppress failure of this test,
now that ls -i is fixed. Though note that it doesn't test well,
since it compares only the always-stat'd command-line arguments.
* NEWS (Bug fixes): Mention it.
|
|
Transformed via this shell code:
t=$'\t'
git ls-files \
| grep -vE '(^|/)((GNU)?[Mm]akefile|ChangeLog)|\.(am|mk)$' \
| grep -vE 'tests/pr/|help2man' \
| xargs grep -lE "^ *$t" \
| xargs perl -MText::Tabs -ni -le \
'$m=/^( *\t[ \t]*)(.*)/; print $m ? expand($1) . $2 : $_'
|
|
|
|
* tests/ls/multihardlink: Add a test case to demonstrate
and test this non obvious behavior.
|
|
* src/ls.c: Rename hl->mh, do not colorize files with multiple
hard links by default.
* src/dircolors.c: Rename HARDLINK -> MULTIHARDLINK, hl -> mh.
* src/dircolors.hin: Do not colorize files with multiple hard links by
default.
* tests/Makefile.am: Rename the test case accordingly.
* tests/ls/multihardlink: Additionally test ls' default behavior
and factor out some duplication.
* NEWS: Mention the change in behavior.
|
|
Reported by Samuel Thibault and Stéphane Raimbault, as the glibc fr_FR
locale has recently changed to use the official but variable width
abbreviated month names. Other glibc locales also have variable widths.
http://sourceware.org/ml/libc-locales/2008-q1/msg00035.html
http://sourceware.org/bugzilla/show_bug.cgi?id=9859
* NEWS: Mention the fix
* gl/lib/mbsalign.c: A new module to align and truncate a
string in a specified number of screen cells, while handling
multi-byte characters appropriately.
* gl/lib/mbsalign.h: Ditto
* gl/modules/mbsalign: Ditto
* bootstrap.conf: Reference the new module
* src/ls.c (abmon_init): New function, precompute the abbreviated
months aligned left in a minimum width column <= 5 screen cells.
(align_nstrftime): New function, replace the first %b in the
format specification to strftime with the precomputed month string.
Note using the cached month strings speeds up `ls -lU` by around 17%
on glibc-2.7-2 on linux at least. Also if we implement this function
using heap storage rather than automatic storage, and use snprintf
instead of strcpy, ls will slow down by 2% and 1% respectively
(i.e. a net gain of 14% rather than 17%).
* tests/ls/abmon-align: A new test to test ls alignment for
various formats and locales
* tests/Makefile.am: Reference the new test
|
|
* src/ls.c (print_color_indicator): Don't color hard links if disabled
(when there is an empty hl= in the LS_COLORS environment variable).
* tests/ls/hardlink: Add test case for disabled hard link highlighting.
* NEWS: Mention the change.
|
|
* tests/ls/color-clear-to-eol: Use \33, not \e for ascii ESC.
This test failed when using the built-in printf of /bin/sh from
NetBSD 1.6.
|
|
This change addresses a relatively unusual case: ls --color, with
a highlighted name being printed initially in the last row of a
terminal emulator (possibly followed by other lines of output) such
that it is wrapped onto the following line, as the terminal emulator
scrolls the output. That would cause the entire following line to
be highlighted, even if the name happened to use only one position.
The least-invasive patch would have made colorized output larger for
all uses. The approach taken below is more invasive, but limits the
increase in overhead to only those lines that are expected to wrap.
* src/ls.c (enum indicator_no): Add C_CLR_TO_EOL.
(indicator_name): Add "cl".
(color_indicator): Add default escape codes for "cl".
(print_long_format): Propagate width to print_name_with_quoting.
(print_name_with_quoting): Print new C_CLR_TO_EOL string if needed.
Return the width of what we're printing.
(print_file_name_and_frills): Propagate width.
(print_type_indicator): Return bool (aka width).
(print_many_per_line): Pass column position to print_* function.
(print_current_files): Likewise.
(print_horizontal): Likewise.
(print_with_commas): Likewise.
* src/dircolors.c (slack_codes): Add "CLRTOEOL".
(ls_codes): Add "cl".
* tests/ls/color-clear-to-eol: New file. Test for this fix.
* tests/Makefile.am (TESTS): Add ls/color-clear-to-eol.
* THANKS: Update.
Reported by Alexander V. Lukyanov. See thread for details:
http://thread.gmane.org/gmane.linux.kernel/740021/focus=14824
Thanks to Jan Engelhardt for helping me reproduce the problem.
Demonstrate with this in an 80-column xterm:
seq 200 # to start in the "bottom" row
touch zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz.foo
env LS_COLORS='*.foo=0;31;42' ls -og --color=always
Before the fix, you'd see something like this:
(where the file name is printed in red on a green background,
and each "=" denotes a space on a green background)
...
-rw-r--r-- 1 0 Feb 5 11:31 zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\
zzzzzzzzzzzzzz.foo===================================================
After the patch, the trailing green spaces are gone:
-rw-r--r-- 1 0 Feb 5 11:31 zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\
zzzzzzzzzzzzzz.foo
|
|
* tests/ls/no-cap: Remove debugging "tee".
|
|
* src/ls.c (print_color_indicator): Colorize hard linked files.
* src/dircolors.c: Add color for hard link.
* src/dircolors.hin: Add color for hard link.
* tests/ls/hardlink: Test for ls - colorize hard linked files.
* tests/Makefile.am (TESTS): Add ls/hardlink.
* NEWS: Mention the change.
|
|
* tests/ls/stat-failed: Let stderr be recorded, to ease debugging.
|
|
Test for this fix: f3f1ccfd871ee395e7fafc051c1b7dedb39fdfc9.
* tests/Makefile.am (TESTS): Add ls/no-cap.
* tests/ls/no-cap: New file.
|
|
* tests/ls/capability: Test for HAVE_CAP definition in config.h.
|
|
* tests/test-lib.sh (Exit): New function by Ralf Wildenhues in automake
http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=20594c08f63
* tests/**: Convert all uses:
This restrictive change converted the vast majority:
git grep -l '^(exit \$fail); exit \$fail$' \
| xargs perl -pi -e 's/'^\(exit \$fail\); exit \$fail$/Exit \$fail/'
And this did the rest, plus a few undesirable ones, so I manually
backed out the changes to ChangeLog-* and build-aux/check.mk:
git grep -l -E '\(exit [^)]+\); exit ' \
| xargs perl -pi -e 's/\(exit (.+?)\); exit \1/Exit $1/'
|
|
* src/ls.c: [HAVE_CAP] Include <sys/capability.h>.
(has_capability): New function for capability detection.
(print_color_indicator): Colorize file with capability.
* m4/jm-macro.m4: New configure option: --disable-libcap.
Check for libcap usability.
* src/Makefile.am (dir_LDADD, ls_LDADD, ...): Append $(LIB_CAP).
* src/dircolors.c: Update color lists.
* src/dircolors.hin: Mention new CAPABILITY color attribute.
* tests/ls/capability: Test for ls - colorize file with capability.
* tests/Makefile.am (root_tests): Add ls/capability.
* NEWS: Mention the change.
|