| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
# Change version.txt before run this script. |
| 4 |
|
| 5 |
THIS_DIR=`readlink -f $0` |
| 6 |
THIS_DIR=`dirname $THIS_DIR` |
| 7 |
|
| 8 |
TMP_DIR=`mktemp -d` |
| 9 |
VERSION=`cat $THIS_DIR/version.txt` |
| 10 |
BASE_URL=https://github.com/unicode-org/icu-data/raw/main/tzdata/icunew/$VERSION/44 |
| 11 |
|
| 12 |
echo Building update-ids... |
| 13 |
cd $THIS_DIR |
| 14 |
g++ -o $TMP_DIR/update-ids update-ids.cpp -licui18n -licuuc |
| 15 |
|
| 16 |
echo Downloading and updating little-endian files... |
| 17 |
mkdir $TMP_DIR/le |
| 18 |
cd $TMP_DIR/le |
| 19 |
curl -OLs $BASE_URL/le/metaZones.res |
| 20 |
curl -OLs $BASE_URL/le/timezoneTypes.res |
| 21 |
curl -OLs $BASE_URL/le/windowsZones.res |
| 22 |
curl -OLs $BASE_URL/le/zoneinfo64.res |
| 23 |
ICU_TIMEZONE_FILES_DIR=. $TMP_DIR/update-ids ids.dat $THIS_DIR/../../../src/common/TimeZones.h $THIS_DIR/../../../src/include/firebird/TimeZones.h |
| 24 |
rm $THIS_DIR/le.zip |
| 25 |
zip $THIS_DIR/le.zip *.res ids.dat |
| 26 |
|
| 27 |
echo Downloading and updating big-endian files... |
| 28 |
mkdir $TMP_DIR/be |
| 29 |
cd $TMP_DIR/be |
| 30 |
curl -OLs $BASE_URL/be/metaZones.res |
| 31 |
curl -OLs $BASE_URL/be/timezoneTypes.res |
| 32 |
curl -OLs $BASE_URL/be/windowsZones.res |
| 33 |
curl -OLs $BASE_URL/be/zoneinfo64.res |
| 34 |
cp $TMP_DIR/le/ids.dat . |
| 35 |
rm $THIS_DIR/be.zip |
| 36 |
zip $THIS_DIR/be.zip *.res ids.dat |
| 37 |
|
| 38 |
rm -r $TMP_DIR |