README.zoneinfo 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. testdata/zoneinfo contains time-zone data files that may be used with CCTZ.
  2. Install them in a location referenced by the ${TZDIR} environment variable.
  3. Symbolic and hard links have been eliminated for portability.
  4. On Linux systems the distribution's versions of these files can probably
  5. already be found in the default ${TZDIR} location, /usr/share/zoneinfo.
  6. New versions can be generated using the following shell script.
  7. #!/bin/sh -
  8. set -e
  9. DESTDIR=$(mktemp -d)
  10. trap "rm -fr ${DESTDIR}" 0 2 15
  11. (
  12. cd ${DESTDIR}
  13. git clone https://github.com/eggert/tz.git
  14. make --directory=tz \
  15. install DESTDIR=${DESTDIR} \
  16. DATAFORM=vanguard \
  17. TZDIR=/zoneinfo \
  18. REDO=posix_only \
  19. LOCALTIME=Factory \
  20. TZDATA_TEXT= \
  21. ZONETABLES=zone1970.tab
  22. tar --create --dereference --hard-dereference --file tzfile.tar \
  23. --directory=tz tzfile.h
  24. tar --create --dereference --hard-dereference --file zoneinfo.tar \
  25. --exclude=zoneinfo/posixrules zoneinfo \
  26. --directory=tz version
  27. )
  28. tar --extract --directory src --file ${DESTDIR}/tzfile.tar
  29. tar --extract --directory testdata --file ${DESTDIR}/zoneinfo.tar
  30. exit 0
  31. To run the CCTZ tests using the testdata/zoneinfo files, execute:
  32. bazel test --test_env=TZDIR=${PWD}/testdata/zoneinfo ...