~rvb/maas/bug-1384001-redux-2

« back to all changes in this revision

Viewing changes to utilities/normalize-spelling

  • Committer: Tarmac
  • Author(s): Gavin Panella
  • Date: 2012-03-15 17:10:38 UTC
  • mfrom: (288.2.5 MaaS-to-MAAS)
  • Revision ID: ed@carob-20120315171038-vwgdkkyodun9fqo4
[r=rvb][bug=][author=allenap] MaaS is now known as MAAS.

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
# Treat unset variables as an error when substituting.
8
8
set -o nounset
9
9
 
10
 
# Normalize the spelling of MaaS to either MaaS or maas, depending on
11
 
# the capitalization of the first letter.
12
 
bzr ls -VR --kind=file --null \
13
 
    | xargs -r0 grep -Iil maas --null \
14
 
    | xargs -r0 sed -i 's/M[Aa][Aa][Ss]/MAAS/g;s/m[Aa][Aa][Ss]/maas/g'
 
10
cat <<EOF
 
11
This will normalize spelling of MAAS to either 'MAAS' or 'maas'
 
12
depending on the capitalization of the first letter. It pays no heed
 
13
to word boundaries, and will process *all* files in the tree. This
 
14
means two things:
 
15
 
 
16
1. Think very hard before using this on a tree with uncommitted
 
17
   changes.
 
18
 
 
19
2. Review the changes *carefully* before committing them. At _least_
 
20
   run the test suite.
 
21
 
 
22
EOF
 
23
 
 
24
read -e -p "Do you really want to run this? [yes/no] " yes_or_no
 
25
 
 
26
if [ "${yes_or_no}" == "yes" ]
 
27
then
 
28
    bzr ls -VR --kind=file --null \
 
29
        | xargs -r0 grep -Iil maas --null \
 
30
        | xargs -r0 sed -i 's/M[Aa][Aa][Ss]/MAAS/g;s/m[Aa][Aa][Ss]/maas/g'
 
31
fi