]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: convert the multi-prog $VERBOSE/--version uses
authorJim Meyering <meyering@redhat.com>
Wed, 17 Nov 2010 20:38:38 +0000 (21:38 +0100)
committerJim Meyering <meyering@redhat.com>
Wed, 17 Nov 2010 20:46:25 +0000 (21:46 +0100)
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'

17 files changed:
tests/chmod/silent
tests/cp/acl
tests/cp/cp-mv-enotsup-xattr
tests/cp/perm
tests/ls/rt-1
tests/misc/env-null
tests/misc/pwd-unreadable-parent
tests/misc/stdbuf
tests/misc/xattr
tests/mkdir/selinux
tests/mv/acl
tests/mv/childproof
tests/mv/dup-source
tests/mv/hard-2
tests/mv/i-2
tests/mv/part-symlink
tests/mv/update

index 20c232b94a23bcc39269d9bfae2a595cdece7ce9..f56e34774b78f846946cf8ab625b2b581f1c2d65 100755 (executable)
@@ -17,7 +17,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 . "${srcdir=.}/init.sh"; path_prepend_ ../src
-test "$VERBOSE" = yes && { chgrp --version; chmod --version; chown --version; }
+print_ver_ chgrp chmod chown
 
 chmod -f 0   no-such 2> out && fail=1
 chgrp -f 0   no-such 2>> out && fail=1
index a3b909ae446807765a489c17589dcc11dcd9f7c1..392675703db9587b64f0b2a08b3ee28c555cbc85 100755 (executable)
@@ -18,7 +18,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 . "${srcdir=.}/init.sh"; path_prepend_ ../src
-test "$VERBOSE" = yes && { mv --version; getfacl --version; setfacl --version; }
+print_ver_ mv getfacl setfacl
 
 require_acl_
 
index bcee4214f9dae6c8e9f860184584dc870052dea1..d3516f6d6ee4bfc67757498c200f8a2f98287b1e 100755 (executable)
@@ -19,7 +19,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 . "${srcdir=.}/init.sh"; path_prepend_ ../src
-test "$VERBOSE" = yes && { cp --version; mv --version; }
+print_ver_ cp mv
 
 require_root_
 
index cb4709f50582d525b5108d646d17aef0ef2a15a6..e5fdb098d65d9ef1e9413289b3e54c3ac017766e 100755 (executable)
@@ -17,7 +17,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 . "${srcdir=.}/init.sh"; path_prepend_ ../src
-test "$VERBOSE" = yes && { cp --version; mv --version; }
+print_ver_ cp mv
 
 very_expensive_
 
index 909deb161a16cea0930a772d34fc2499dcc81846..56de502dbc4be5a9cb0cb0894c831ce076c690d3 100755 (executable)
@@ -17,7 +17,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 . "${srcdir=.}/init.sh"; path_prepend_ ../src
-test "$VERBOSE" = yes && { ls --version; touch --version; }
+print_ver_ ls touch
 
 date=1998-01-15
 
index c08856c01ec06097e294e869918d8e21bd8df0bd..8d5b85af6906dd68639fc9f7504b66625b46ffda 100755 (executable)
@@ -17,7 +17,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 . "${srcdir=.}/init.sh"; path_prepend_ ../src
-test "$VERBOSE" = yes && { env --version; env -- printenv --version; }
+print_ver_ env printenv
 
 # POSIX is clear that environ may, but need not be, sorted.
 # Environment variable values may contain newlines, which cannot be
index b24a97c89cdfec9cb461dafc54fe47ea3fc3f4d3..9483981b9876831ef1ca8d2a0a9a35aa72750f58 100755 (executable)
@@ -19,7 +19,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 . "${srcdir=.}/init.sh"; path_prepend_ ../src
-test "$VERBOSE" = yes && { env -- pwd --version; readlink --version; }
+print_ver_ pwd readlink
 
 test $host_os != linux-gnu &&
   skip_test_ 'vendor getcwd may be inadequate'
index 4a694c7cde513c8a5ac5e341d86b421054a487b8..59c7803708ecdc7edb183797e0a76f246d8fd7a3 100755 (executable)
@@ -17,7 +17,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 . "${srcdir=.}/init.sh"; path_prepend_ ../src
-test "$VERBOSE" = yes && { stdbuf --version; mv --version; }
+print_ver_ stdbuf mv
 
 getlimits_
 require_built_ stdbuf
index 13e0857a595a983ca66e280b9e37289b79686df4..67dfdef5108e34adee37cc9722d801fa01b2983e 100755 (executable)
@@ -19,7 +19,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 . "${srcdir=.}/init.sh"; path_prepend_ ../src
-test "$VERBOSE" = yes && { cp --version; mv --version; ginstall --version; }
+print_ver_ cp mv ginstall
 
 # Skip this test if cp was built without xattr support:
 touch src dest || framework_failure
index f055cb8ac46f446941da5f4bf24ebd345c3738e6..e7fadf9583610fa68b6fa99522614c6335441c03 100755 (executable)
@@ -17,7 +17,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 . "${srcdir=.}/init.sh"; path_prepend_ ../src
-test "$VERBOSE" = yes && { mkdir --version; mkfifo --version; mknod --version; }
+print_ver_ mkdir mkfifo mknod
 
 # Note: on an SELinux/enforcing system running mcstransd older than
 # mcstrans-0.2.8-1.fc9, the following commands may mistakenly exit
index 75f50078668681cc825ba4de6668ede9b7cbc1d0..4157ab52b1bfdaac81e16d36d4ee6e00aa0808c1 100755 (executable)
@@ -18,7 +18,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 . "${srcdir=.}/init.sh"; path_prepend_ ../src
-test "$VERBOSE" = yes && { mv --version; getfacl --version; setfacl --version; }
+print_ver_ mv getfacl setfacl
 
 require_acl_
 
index ed6c1802e2a1bdd1a584c2d7bfdf9745235fef98..fadf44ed5d15b74e9497a03f672e1fec0e13c594 100755 (executable)
@@ -19,7 +19,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 . "${srcdir=.}/init.sh"; path_prepend_ ../src
-test "$VERBOSE" = yes && { cp --version; mv --version; ln --version; }
+print_ver_ cp mv ln
 
 skip_if_root_
 
index 34ef63332bdfff4727779280d86619958bb90d9f..c70753f064a39dbd4ccdf240cbdd0b2617887797 100755 (executable)
@@ -20,7 +20,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 . "${srcdir=.}/init.sh"; path_prepend_ ../src
-test "$VERBOSE" = yes && { cp --version; mv --version; }
+print_ver_ cp mv
 
 skip_if_root_
 
index eb83b117f20454d71695f6486c09b430017fec18..d86435ab711fce0738dbe0148924974034332e26 100755 (executable)
@@ -18,7 +18,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 . "${srcdir=.}/init.sh"; path_prepend_ ../src
-test "$VERBOSE" = yes && { cp --version; mv --version; }
+print_ver_ cp mv
 
 skip_if_root_
 
index 7e49bcadd51b03fb6e7dd63cc64f521773f3bea2..03082823852db1de67943c97cff70d327c496084 100755 (executable)
@@ -18,7 +18,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 . "${srcdir=.}/init.sh"; path_prepend_ ../src
-test "$VERBOSE" = yes && { cp --version; mv --version; }
+print_ver_ cp mv
 
 skip_if_root_
 
index 3f67d6cdd9d80d653c8b8bce018b9de8ddcd44a5..425718aff7e10301502a10f6013a7622a741bc6b 100755 (executable)
@@ -18,7 +18,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 . "${srcdir=.}/init.sh"; path_prepend_ ../src
-test "$VERBOSE" = yes && { cp --version; mv --version; }
+print_ver_ cp mv
 
 cleanup_() { rm -rf "$other_partition_tmpdir"; }
 . "$abs_srcdir/other-fs-tmpdir"
index 5bee53cb2e1f48236d13cc71289e8ba50a413483..94a892701d6f4a1f33eecffd2490a04b4207f8db 100755 (executable)
@@ -17,7 +17,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 . "${srcdir=.}/init.sh"; path_prepend_ ../src
-test "$VERBOSE" = yes && { cp --version; mv --version; }
+print_ver_ cp mv
 
 echo old > old || framework_failure
 touch -d yesterday old || framework_failure