]> git.ipfire.org Git - thirdparty/coreutils.git/commit
tests: avoid the :> construct which can hide errors
authorPádraig Brady <P@draigBrady.com>
Wed, 5 Mar 2014 18:41:16 +0000 (18:41 +0000)
committerPádraig Brady <P@draigBrady.com>
Wed, 5 Mar 2014 19:02:20 +0000 (19:02 +0000)
commit056d6de78fcf11a0f404f25faf8cecc9f9ee9c1c
treecd5235d3fd1e8b0142c543541675dd66f26c3d91
parent5dce6bdfafc930dfd17d5d16aea7d1add3472066
tests: avoid the :> construct which can hide errors

On most shells `:>file || framework_failure_` will not evaluate
the framework_failure_ even if there was an error writing the file.
shells which do evaluate the failure are ksh 93u+ and bash 4.2,
while shells wich don't include bash 4.3, solaris, freebsd, dash.

Furthermore this construct is problematic on Solaris 10 sh,
which will try to optimize away a `:' command in a loop
after the first iteration, even if it is redirected.

* tests/cp/link-deref.sh: Remove the leading colon on redirections.
* tests/cp/reflink-perm.sh: Likewise.
* tests/id/zero.sh: Likewise.
* tests/install/install-C.sh: Likewise.
* tests/misc/env.sh: Likewise.
* tests/misc/md5sum-bsd.sh: Likewise.
* tests/misc/runcon-no-reorder.sh: Likewise.
* tests/mv/partition-perm.sh: Likewise.
* tests/rm/r-root.sh: Likewise.
* tests/split/l-chunk.sh: Likewise.
* tests/split/line-bytes.sh: Likewise.
* tests/tail-2/inotify-rotate.sh: Likewise.
* tests/tail-2/retry.sh: Likewise.
* tests/tail-2/symlink.sh: Likewise.
* tests/tail-2/wait.sh: Likewise.
* tests/touch/read-only.sh: Likewise.
+ cfg.mk (sc_prohibit_colon_redirection): A new syntax check
to avoid further instances of this creeping in.
17 files changed:
cfg.mk
tests/cp/link-deref.sh
tests/cp/reflink-perm.sh
tests/id/zero.sh
tests/install/install-C.sh
tests/misc/env.sh
tests/misc/md5sum-bsd.sh
tests/misc/runcon-no-reorder.sh
tests/mv/partition-perm.sh
tests/rm/r-root.sh
tests/split/l-chunk.sh
tests/split/line-bytes.sh
tests/tail-2/inotify-rotate.sh
tests/tail-2/retry.sh
tests/tail-2/symlink.sh
tests/tail-2/wait.sh
tests/touch/read-only.sh