run_test.sh 1005 B

12345678910111213141516171819202122232425262728293031
  1. #!/usr/bin/env bash
  2. # Run the tests for tzdata
  3. set -ex
  4. exists() {
  5. FULL_PATH="${PREFIX}/${1}"
  6. if [ -f "${FULL_PATH}" ]; then
  7. echo "Found ${1}"
  8. else
  9. echo "Could not find ${FULL_PATH}"
  10. exit 1
  11. fi
  12. }
  13. for i in share/zoneinfo/{zone,iso3166,zone1970}.tab share/zoneinfo/leapseconds share/zoneinfo/tzdata.zi; do
  14. exists $i
  15. done
  16. # Make sure we only package zoneinfo and nothing else.
  17. dirs="$(find "${PREFIX}" -mindepth 1 -maxdepth 2 ! -path "${PREFIX}/share" ! -path "${PREFIX}/conda-meta*")"
  18. test "${dirs}" = "${PREFIX}/share/zoneinfo"
  19. # Make sure we only package timezone information files.
  20. if [ `uname` == 'Darwin' ]; then
  21. # OSX does not have the '-printf' operator.
  22. heads="$(find "${PREFIX}/share/zoneinfo" -type f ! -name "*.zi" ! -name "*.tab" ! -name leapseconds -exec head -c4 {} ';' -print0 | uniq | cut -c1-4)"
  23. else
  24. heads="$(find "${PREFIX}/share/zoneinfo" -type f ! -name "*.zi" ! -name "*.tab" ! -name leapseconds -exec head -c4 {} ';' -printf \\n | uniq)"
  25. fi
  26. test "${heads}" = TZif