tests: more automated quote adjustment
commitae2b0d2ddca458eb282bb0458987e75e1875a659
authorJim Meyering <meyering@redhat.com>
Sat, 7 Jan 2012 19:55:10 +0000 (7 20:55 +0100)
committerJim Meyering <meyering@redhat.com>
Mon, 9 Jan 2012 20:50:08 +0000 (9 21:50 +0100)
treede928bfafb577a20963be45b4b6d97488c0b5e24
parentdd0e4c5621ca2fa9255aef4eee0e7cf41cd335d2
tests: more automated quote adjustment

Relax initial regexp to match more instances, but add a
filter to avoid some invalid conversions.  Run this:

git grep -l "\`[^']*'" tests | xargs perl -pi -e '$q=q"'\''";' \
  -e '$q="$q\\$q$q"; /(= ?\`|\`expr|\`echo|\Q$q\E)/ and next;' \
  -e ' s/\`([^'\''"]*?'\'')/'\''$1/g'
The last disjunct in the above (...) filter is to exempt
any line that contains this string: '\''
With quoting like that, converting a ` to ' is likely to cause trouble,
so we'll handle those manually.  Here are three examples where
the exemption is required:

  *': `link-to-dir/'\'': hard link not allowed for directory'*) ;;
  printf 'creating file `%s'\''\n' $f
  'mv: inter-device move failed: `%s'\'' to `%s'\'';'\
48 files changed:
tests/Coreutils.pm
tests/CuTmpdir.pm
tests/check.mk
tests/chgrp/basic
tests/chgrp/deref
tests/chmod/no-x
tests/cp/fiemap-empty
tests/cp/fiemap-perf
tests/du/files0-from
tests/du/two-args
tests/install/create-leading
tests/misc/basename
tests/misc/cat-proc
tests/misc/comm
tests/misc/date-sec
tests/misc/dirname
tests/misc/factor
tests/misc/fmt
tests/misc/join
tests/misc/mktemp
tests/misc/nohup
tests/misc/od
tests/misc/printf-cov
tests/misc/seq
tests/misc/sha1sum-vec
tests/misc/sort
tests/misc/sort-compress
tests/misc/sort-files0-from
tests/misc/sort-merge
tests/misc/stdbuf
tests/misc/tac
tests/misc/tail
tests/misc/test
tests/misc/test-diag
tests/misc/timeout
tests/misc/tr
tests/misc/tsort
tests/misc/tty-eof
tests/misc/wc-files0-from
tests/misc/xstrtol
tests/mv/hard-3
tests/mv/i-1
tests/pr/pr-tests
tests/rm/deep-1
tests/rm/empty-name
tests/rm/fail-eperm
tests/rm/no-give-up
tests/split/lines