OLD | NEW |
1 #!/bin/sh | 1 #!/bin/sh |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
| 6 treeroot="$(dirname "$0")/.." |
| 7 cd "${treeroot}" |
| 8 |
| 9 echo "Applying brkitr.patch" |
| 10 patch -p1 < android/brkitr.patch || { echo "failed to patch" >2; exit 1; } |
| 11 |
6 # Keep only the currencies used by the larget 60 economies in terms of GDP | 12 # Keep only the currencies used by the larget 60 economies in terms of GDP |
7 # with several more added in. | 13 # with several more added in. |
8 # TODO(jshin): Use ucurr_isAvailable in ICU to drop more currencies. | 14 # TODO(jshin): Use ucurr_isAvailable in ICU to drop more currencies. |
9 # See also http://en.wikipedia.org/wiki/List_of_circulating_currencies | 15 # See also http://en.wikipedia.org/wiki/List_of_circulating_currencies |
10 # Copied from scripts/trim_data.sh. Need to refactor. | 16 # Copied from scripts/trim_data.sh. Need to refactor. |
11 for currency in $(grep -v '^#' currencies.list) | 17 for currency in $(grep -v '^#' "${treeroot}/android/currencies.list") |
12 do | 18 do |
13 OP=${KEEPLIST:+|} | 19 OP=${KEEPLIST:+|} |
14 KEEPLIST=${KEEPLIST}${OP}${currency} | 20 KEEPLIST=${KEEPLIST}${OP}${currency} |
15 done | 21 done |
16 KEEPLIST="(${KEEPLIST})" | 22 KEEPLIST="(${KEEPLIST})" |
17 | 23 |
18 cd "$(dirname "$0")/.." | |
19 | |
20 echo "Applying brkitr.patch" | |
21 patch -p1 < android/brkitr.patch || { echo "failed to patch"; exit 1; } | |
22 | |
23 cd source/data | 24 cd source/data |
24 | 25 |
25 for i in curr/*.txt | 26 for i in curr/*.txt |
26 do | 27 do |
27 locale=$(basename $i .txt) | 28 locale=$(basename $i .txt) |
28 [ $locale == 'supplementalData' ] && continue; | 29 [ $locale == 'supplementalData' ] && continue; |
29 echo "Overwriting $i for $locale" | 30 echo "Overwriting $i for $locale" |
30 sed -n -r -i \ | 31 sed -n -r -i \ |
31 '1, /^'${locale}'\{$/ p | 32 '1, /^'${locale}'\{$/ p |
32 /^ "%%ALIAS"\{/p | 33 /^ "%%ALIAS"\{/p |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 echo Overwriting $i... | 179 echo Overwriting $i... |
179 sed -r '/^ calendar\{$/,/^ \}$/ { | 180 sed -r '/^ calendar\{$/,/^ \}$/ { |
180 /^ calendar\{$/p | 181 /^ calendar\{$/p |
181 /^ '${CAL_PATTERN}'\{$/, /^ \}$/p | 182 /^ '${CAL_PATTERN}'\{$/, /^ \}$/p |
182 /^ \}$/p | 183 /^ \}$/p |
183 d | 184 d |
184 }' -i $i | 185 }' -i $i |
185 done | 186 done |
186 | 187 |
187 echo DONE. | 188 echo DONE. |
OLD | NEW |