coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

quoting conversion: `...' to '...'


From: Jim Meyering
Subject: quoting conversion: `...' to '...'
Date: Mon, 09 Jan 2012 20:21:51 +0100

Here are some change-sets to convert most `...' quoting to '...'.

I tried to automate as much as possible.
The commits labeled "maint:..." will be merged into the preceding
ones since they usually just denote "run the same command again".

Here are the summaries.
When there is an itemized file list in the ChangeLog,
it usually means I made manual changes.

Compressed git format-print output attached at the end.


commit a63d93974a6024756fd123c509719965f7d9a7ce
Author: Jim Meyering <address@hidden>
Date:   Sun Jan 8 21:03:22 2012 +0100

    maint: convert more `...' to '...'

    Run this:
      git grep -E -l '`.+'\' src/*.c \
        |xargs perl -pi -e 's/`(.+?'\'')/'\''$1/'

commit 43031936b50dac6e375a6fc853c5573d12f03fa7
Author: Jim Meyering <address@hidden>
Date:   Sun Jan 8 21:02:58 2012 +0100

    maint: use '...', not `...` to quote commands in comments

    * src/truncate.c (main): Tweak quoting in comments to use '...',
    not `...`, for consistency with the rest of comments in coreutils.

commit f25857044dad06be22077f001de054d948553795
Author: Jim Meyering <address@hidden>
Date:   Sun Jan 8 15:12:58 2012 +0100

    maint:...

commit e1d7b4e8702577a2f0172781961c85259cc280b8
Author: Jim Meyering <address@hidden>
Date:   Sun Jan 8 15:08:30 2012 +0100

    maint: src/*.c: change remaining quotes (without embedded spaces)

    Run this:
      git grep -E -l '`[^ ]+'\' src/*.c \
        |xargs perl -pi -e 's/`([^ ]+'\'')/'\''$1/'

commit 24b208689b88b3ecffe3f917c0360d8207984933
Author: Jim Meyering <address@hidden>
Date:   Sun Jan 8 15:05:04 2012 +0100

    maint:...

commit 4237ce560d5dab591780d2c241c977a2d9c5784f
Author: Jim Meyering <address@hidden>
Date:   Sun Jan 8 15:04:45 2012 +0100

    maint: and manual chroot+join tweaks

commit 2bde3a606961d321c3ab3611e11b204f9d6b0513
Author: Jim Meyering <address@hidden>
Date:   Sun Jan 8 14:50:25 2012 +0100

    maint:...

commit 061a22427575974663cd916adf0ebd053d6bc94b
Author: Jim Meyering <address@hidden>
Date:   Sun Jan 8 14:08:03 2012 +0100

    maint: convert `...' to '...' in --help output

    All affected lines end with \ or \n\, so run this command
    until it produces no new changes (4 times):
      git grep -E -l '`[^ ]+'\''.*\\' src \
        |xargs perl -pi -e 's/`([^ ]+'\''.*\\)/'\''$1/'

commit 6d150e0810dfdaa8838f9781b8fecbb30f53edb7
Author: Jim Meyering <address@hidden>
Date:   Sun Jan 8 12:53:09 2012 +0100

    maint: prepare to change more `...' uses

    * src/fmt.c (isopen): Change `' to '` in list of bytes, so that
    a subsequent change can safely perform the `...' to '...' conversion.

commit d9a7d9f3e8928ee52249fa58057a6327f5fe1aed
Author: Jim Meyering <address@hidden>
Date:   Sat Jan 7 18:30:14 2012 +0100

    maint: adjust quoting: emit '...', not `...' in diagnostics

    * src/csplit.c (parse_repeat_count, extract_regexp): As above.
    * src/date.c (main): Likewise.
    * src/ls.c (decode_switches): Likewise.
    * src/od.c (decode_one_format, main): Likewise.
    * src/pathchk.c (no_leading_hyphen): Likewise.
    * src/pr.c (main, getoptarg): Likewise.
    * src/rm.c (diagnose_leading_hyphen): Likewise.
    * src/sort.c (key_warnings, incompatible_options, main): Likewise.
    * src/stat.c (print_esc_char): Print '\x', not `\x' in diagnostic.
    * src/test.c (main): Likewise.
    * src/touch.c (main): Likewise.
    * src/tr.c (build_spec_list, validate, append_range): Likewise.
    * tests/misc/mktemp: This is an unusual case, since the affected
    string contains only the ` of an `...' string.  So we change
    the long ` to a lone '.
    * tests/pr/pr-tests: Manual quote adapting fix-up.
    * tests/ln/hard-to-sym: Likewise.
    * tests/split/suffix-length: Likewise.
    * tests/mv/part-fail: Likewise.
    * tests/misc/chcon: Likewise.
    * tests/misc/stat-printf: Likewise.

commit 935e93604516f6a52785011efdd4c336aad61d94
Author: Jim Meyering <address@hidden>
Date:   Sat Jan 7 20:55:10 2012 +0100

    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'\'';'\

commit b22917df7745a253656ea6c9c3f5937fc0084635
Author: Jim Meyering <address@hidden>
Date:   Sat Jan 7 17:47:58 2012 +0100

    tests: change `...' to '...' on lines not matching /[=\$]/

    Exempt lines with '$' or '=', since those are prone to improper
    conversion.  Run this:
      git grep -l "\`[^']*'" tests \
       |xargs perl -pi -e '/[=\$]/ and next;s/\`([^'\''"]*?'\'')/'\''$1/g'

commit 8098f23eb71b3c03cdd6b100644880af5ca9276c
Author: Jim Meyering <address@hidden>
Date:   Sat Jan 7 17:43:50 2012 +0100

    tests: adjust \`...' quoting to '...' to adapt to latest gnulib

    Run this:
      git grep -l "\\\\\`[^']*'" tests \
        |xargs perl -pi -e 's/\\\`(.*?'\'')/'\''$1/g

commit aa785f1baa0f663d4217d9b4d8bdb69ff383357f
Author: Jim Meyering <address@hidden>
Date:   Sat Jan 7 17:23:17 2012 +0100

    build: update gnulib submodule to latest (quoting change)

    This pulls in changes to the quote and quotearg modules that
    render quoted strings in diagnostics.  `Old' vs 'new'.

Attachment: k.xz
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]