OLD | NEW |
(Empty) | |
| 1 #!/bin/sh |
| 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 |
| 4 # found in the LICENSE file. |
| 5 |
| 6 treeroot="$(dirname "$0")/.." |
| 7 cd "${treeroot}" |
| 8 |
| 9 cd source/data |
| 10 |
| 11 # Keep only two common calendars. Add locale-specific calendars to Thai. |
| 12 COMMON_CALENDARS="gregorian|generic" |
| 13 for i in locales/*.txt; do |
| 14 CALENDARS="${COMMON_CALENDARS}" |
| 15 case $(basename $i .txt | sed 's/_.*$//') in |
| 16 th) |
| 17 EXTRA_CAL='buddhist' |
| 18 ;; |
| 19 *) |
| 20 EXTRA_CAL='' |
| 21 ;; |
| 22 esac |
| 23 |
| 24 CAL_PATTERN="(${COMMON_CALENDARS}${EXTRA_CAL:+|${EXTRA_CAL}})" |
| 25 echo $CAL_PATTERN |
| 26 |
| 27 echo Overwriting $i... |
| 28 sed -r '/^ calendar\{$/,/^ \}$/ { |
| 29 /^ calendar\{$/p |
| 30 /^ default\{".*"\}$/p |
| 31 /^ '${CAL_PATTERN}'\{$/, /^ \}$/p |
| 32 /^ \}$/p |
| 33 d |
| 34 }' -i $i |
| 35 done |
| 36 |
| 37 echo DONE. |
OLD | NEW |