Age | Commit message (Collapse) | Author |
|
When the combination of the file system options with given files or
devices does not lead to output, "df --total" would exit successfully
although it should not.
Examples:
$ df --total --type=xfs / # when / is not an XFS file system
$ df --total --local -t nfs DIR # nfs is remote per se ...
$ df --total -t qwerty /dev/sdb5 # typo in file system type
Furthermore, "df --total" would not print the error message "no file
systems processed" when the file argument does not exist or is otherwise
not accessible.
Example:
$ df --total __not_exist__
These 2 bugs are present since --total was added by commit
v6.12-166-gea2887b.
* src/df.c (get_dev): Do not set file_systems_processed to true when
force_fsu is true, i.e. when the row for the "total" line is processed.
(main): Don't print totals unless we've processed a file system.
Also only print the "no FS processed" message if there was no
preceding diagnostic.
* tests/df/total-unprocessed: Add a new test.
* tests/Makefile.am: Reference the new test.
* NEWS: Mention the fix.
Improved-by: Jim Meyering
|
|
* test/Makefile.am: Reference the moved tests.
|
|
It's awkward to read and problematic for scripts when
control characters like '\n' are output.
Note other fields are already handled with mbsalign,
which converts non printable chars to the replacement char.
A caveat to note with that, is the replacement char takes
a place in the field and so possibly truncates the field
if it was the widest field in the records.
Note a more general replacement function, that
handles all printable, or non white space characters,
would require more sophisticated support for various
encodings, and the complexity vs benefit was not
deemed beneficial enough at present.
Perhaps in future a more general replacement function
could be shared between the various utilities.
Note <space> is unaffected in any field,
which could impact scripts processing the output.
However any of the number fields at least could have
spaces considering `LANG=fr_FR df -B\'1`, so it's
probably best to leave spaces, which also allows
scripts to handle mount points with spaces without change.
* src/df.c (hide_problematic_chars): Replace control chars with '?'.
* tests/df/problematic-chars: Add a new root only test.
* tests/Makefile.am: Reference the new test.
* NEWS: Mention the fix.
|
|
Run "make update-copyright".
|
|
* tests/df/total-verify: Use require_perl_, so that this test is
skipped when perl is not available.
* tests/rm/deep-2: Likewise, and fix wording in a comment.
Reported by Bruno Haible.
|
|
These changes were mostly mechanical, made by running the
following command:
git grep -lw framework_failure | grep -v ChangeLog \
| xargs perl -pi -e 's/\b(framework_failure)\b/${1}_/'
and then editing init.cfg and `tests/cp/cp-a-selinux' by hand.
* tests/init.cfg (framework_failure): Remove, `framework_failure_'
from init.sh should be used instead in the tests.
Remove now-obsolete "FIXME" comment.
(is_local_dir_, require_strace_, require_membership_in_two_groups_,
require_sparse_support_, skip_if_mcstransd_is_running_,
mkfifo_or_skip_) Use `framework_failure_', not `framework_failure'.
* Many test scripts: Likewise.
|
|
* 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.
|
|
Run "make update-copyright".
|
|
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/'
|
|
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,"
|
|
Use this command:
git ls-files | grep -v COPYING \
| xargs env UPDATE_COPYRIGHT_USE_INTERVALS=1 \
build-aux/update-copyright
|
|
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.
|
|
* src/df.c (main): If open or fstat fails when we're trying to ensure
that all arg-partitions are automounted, fall back on using stat.
Inspired by the report and patch from Olivier Fourdan in
http://bugzilla.redhat.com/520630.
* NEWS (Bug fixes): Mention it.
* tests/df/unreadable: New test for the above.
* tests/Makefile.am (TESTS): Add df/unreadable.
The bug was introduced in coreutils-7.3 via commit dbd17157,
2009-04-28, "df: use open(2), not stat, to trigger automounting".
|
|
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/df/total-verify: Don't use perl's -f option.
Reported by Matthew Woehlke.
|
|
* tests/df/total-verify: Skip the test if df fails.
|
|
* tests/df/total: Remove file.
* tests/Makefile.am (TESTS): Remove df/total.
It is subsumed by df/total-verify.
|
|
|
|
* tests/df/total-verify: Skip upon _df_ failure, not tee failure.
Reported by Ondřej Vašík. Details in
<http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/15028>.
|
|
* tests/df/total: Ignore nonzero exit status from df.
|
|
* tests/df/total-awk: Rewrite to use $PERL, not $AWK.
mawk can't even count above 2^31. Reported by Ed Avis.
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/14792/focus=14802
* tests/df/total-verify: Rename from total-awk.
* tests/Makefile.am (TESTS): Reflect renaming.
|
|
* 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/'
|
|
* tests/df/total-awk: Use df's --block-size=512 option.
|
|
* src/df.c (add_uint_with_neg_flag): New function to add two integral
values with separate negation flag.
(show_dev): New parameter force_fsu to display numbers directly. Collect
summary statistics on each printed device.
(usage): Mention new option --total in --help.
(main): Initialize summary on program start. Handle new option --total.
* tests/df/total: Dummy test case for new --total option.
* tests/df/total-awk: Better test case for new --total option (requires
awk).
* doc/coreutils.texi: Mention new parameter --total.
* NEWS: Mention the change.
* TODO: Removed completed task.
|