update.sh 1.1 KB

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