| 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 # Keep only the currencies used by the larget 60 economies in terms of GDP | 6 # Keep only the currencies used by the larget 60 economies in terms of GDP |
| 7 # with several more added in. | 7 # with several more added in. |
| 8 # TODO(jshin): Use ucurr_isAvailable in ICU to drop more currencies. | 8 # TODO(jshin): Use ucurr_isAvailable in ICU to drop more currencies. |
| 9 # See also http://en.wikipedia.org/wiki/List_of_circulating_currencies | 9 # See also http://en.wikipedia.org/wiki/List_of_circulating_currencies |
| 10 # Copied from scripts/trim_data.sh. Need to refactor. | 10 # Copied from scripts/trim_data.sh. Need to refactor. |
| 11 for currency in $(grep -v '^#' currencies.list) | 11 for currency in $(grep -v '^#' currencies.list) |
| 12 do | 12 do |
| 13 OP=${KEEPLIST:+|} | 13 OP=${KEEPLIST:+|} |
| 14 KEEPLIST=${KEEPLIST}${OP}${currency} | 14 KEEPLIST=${KEEPLIST}${OP}${currency} |
| 15 done | 15 done |
| 16 KEEPLIST="(${KEEPLIST})" | 16 KEEPLIST="(${KEEPLIST})" |
| 17 | 17 |
| 18 cd $(dirname $0)/../source/data | 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 |
| 19 | 24 |
| 20 for i in curr/*.txt | 25 for i in curr/*.txt |
| 21 do | 26 do |
| 22 locale=$(basename $i .txt) | 27 locale=$(basename $i .txt) |
| 23 [ $locale == 'supplementalData' ] && continue; | 28 [ $locale == 'supplementalData' ] && continue; |
| 24 echo "Overwriting $i for $locale" | 29 echo "Overwriting $i for $locale" |
| 25 sed -n -r -i \ | 30 sed -n -r -i \ |
| 26 '1, /^'${locale}'\{$/ p | 31 '1, /^'${locale}'\{$/ p |
| 27 /^ "%%ALIAS"\{/p | 32 /^ "%%ALIAS"\{/p |
| 28 /^ %%Parent\{/p | 33 /^ %%Parent\{/p |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 echo Overwriting $i... | 175 echo Overwriting $i... |
| 171 sed -r '/^ calendar\{$/,/^ \}$/ { | 176 sed -r '/^ calendar\{$/,/^ \}$/ { |
| 172 /^ calendar\{$/p | 177 /^ calendar\{$/p |
| 173 /^ '${CAL_PATTERN}'\{$/, /^ \}$/p | 178 /^ '${CAL_PATTERN}'\{$/, /^ \}$/p |
| 174 /^ \}$/p | 179 /^ \}$/p |
| 175 d | 180 d |
| 176 }' -i $i | 181 }' -i $i |
| 177 done | 182 done |
| 178 | 183 |
| 179 echo DONE. | 184 echo DONE. |
| OLD | NEW |