Bug 1310733 - Part 0: Rename tzdata svn directory to "source" instead of using version name. r=Waldo
authorAndré Bargull <andre.bargull@gmail.com>
Tue, 18 Oct 2016 11:46:21 -0700
changeset 318543 04d607a4816550a043fabb1934adfb5f7cfd754a
parent 318542 4abaf0bda1fec7cf54cb4cb8f6b7cf19e62ae879
child 318544 9b2529d5681611a8ced08e977d59638cf77c7382
push id30843
push usercbook@mozilla.com
push dateWed, 19 Oct 2016 15:02:57 +0000
treeherdermozilla-central@f40960c63bfa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersWaldo
bugs1310733
milestone52.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1310733 - Part 0: Rename tzdata svn directory to "source" instead of using version name. r=Waldo
intl/tzdata/2015f/be/metaZones.res
intl/tzdata/2015f/be/timezoneTypes.res
intl/tzdata/2015f/be/windowsZones.res
intl/tzdata/2015f/be/zoneinfo64.res
intl/tzdata/2015f/ee/metaZones.res
intl/tzdata/2015f/ee/timezoneTypes.res
intl/tzdata/2015f/ee/windowsZones.res
intl/tzdata/2015f/ee/zoneinfo64.res
intl/tzdata/2015f/le/metaZones.res
intl/tzdata/2015f/le/timezoneTypes.res
intl/tzdata/2015f/le/windowsZones.res
intl/tzdata/2015f/le/zoneinfo64.res
intl/tzdata/2015f/metaZones.txt
intl/tzdata/2015f/timezoneTypes.txt
intl/tzdata/2015f/windowsZones.txt
intl/tzdata/2015f/zoneinfo64.txt
intl/tzdata/source/be/metaZones.res
intl/tzdata/source/be/timezoneTypes.res
intl/tzdata/source/be/windowsZones.res
intl/tzdata/source/be/zoneinfo64.res
intl/tzdata/source/ee/metaZones.res
intl/tzdata/source/ee/timezoneTypes.res
intl/tzdata/source/ee/windowsZones.res
intl/tzdata/source/ee/zoneinfo64.res
intl/tzdata/source/le/metaZones.res
intl/tzdata/source/le/timezoneTypes.res
intl/tzdata/source/le/windowsZones.res
intl/tzdata/source/le/zoneinfo64.res
intl/tzdata/source/metaZones.txt
intl/tzdata/source/timezoneTypes.txt
intl/tzdata/source/windowsZones.txt
intl/tzdata/source/zoneinfo64.txt
intl/update-tzdata.sh
rename from intl/tzdata/2015f/be/metaZones.res
rename to intl/tzdata/source/be/metaZones.res
rename from intl/tzdata/2015f/be/timezoneTypes.res
rename to intl/tzdata/source/be/timezoneTypes.res
rename from intl/tzdata/2015f/be/windowsZones.res
rename to intl/tzdata/source/be/windowsZones.res
rename from intl/tzdata/2015f/be/zoneinfo64.res
rename to intl/tzdata/source/be/zoneinfo64.res
rename from intl/tzdata/2015f/ee/metaZones.res
rename to intl/tzdata/source/ee/metaZones.res
rename from intl/tzdata/2015f/ee/timezoneTypes.res
rename to intl/tzdata/source/ee/timezoneTypes.res
rename from intl/tzdata/2015f/ee/windowsZones.res
rename to intl/tzdata/source/ee/windowsZones.res
rename from intl/tzdata/2015f/ee/zoneinfo64.res
rename to intl/tzdata/source/ee/zoneinfo64.res
rename from intl/tzdata/2015f/le/metaZones.res
rename to intl/tzdata/source/le/metaZones.res
rename from intl/tzdata/2015f/le/timezoneTypes.res
rename to intl/tzdata/source/le/timezoneTypes.res
rename from intl/tzdata/2015f/le/windowsZones.res
rename to intl/tzdata/source/le/windowsZones.res
rename from intl/tzdata/2015f/le/zoneinfo64.res
rename to intl/tzdata/source/le/zoneinfo64.res
rename from intl/tzdata/2015f/metaZones.txt
rename to intl/tzdata/source/metaZones.txt
rename from intl/tzdata/2015f/timezoneTypes.txt
rename to intl/tzdata/source/timezoneTypes.txt
rename from intl/tzdata/2015f/windowsZones.txt
rename to intl/tzdata/source/windowsZones.txt
rename from intl/tzdata/2015f/zoneinfo64.txt
rename to intl/tzdata/source/zoneinfo64.txt
--- a/intl/update-tzdata.sh
+++ b/intl/update-tzdata.sh
@@ -44,17 +44,16 @@ if [ $# -ne 1 -a $check_version = false 
 fi
 
 tzdata_version=$1
 
 icudata_dir=`dirname "$0"`/../config/external/icu/data
 icu_dir=`dirname "$0"`/icu
 tzdata_dir=`dirname "$0"`/tzdata
 tzdata_files="${tzdata_dir}"/files.txt
-tzdata_version_dir="${tzdata_dir}"/${tzdata_version}
 tzdata_url=https://ssl.icu-project.org/repos/icu/data/trunk/tzdata/icunew/${tzdata_version}/44/
 icu_tzdata_version=`grep --only-matching --perl-regexp --regexp="tz version:\s+\K.*$" "${icu_dir}"/source/data/misc/zoneinfo64.txt`
 local_tzdata_version=
 if [ -f "${tzdata_dir}"/SVN-INFO ]; then
   local_tzdata_version=`grep --only-matching --perl-regexp --regexp="^URL: .*tzdata/icunew/\K[0-9a-z]+" "${tzdata_dir}"/SVN-INFO`
 fi
 
 # Check ICU and current local tzdata versions.
@@ -114,53 +113,59 @@ fi
 icudata_file_be=`find "${icudata_dir}" -type f -name 'icudt*b.dat'`
 if [ -f "${icudata_file_be}" ]; then
   icudata_file_be=`cd "$(dirname "${icudata_file_be}")" && pwd -P`/`basename "${icudata_file_be}"`
   echo "INFO: ICU data file (big endian): ${icudata_file_be}"
 else
   echo "INFO: ICU data file (big endian) not found, skipping..."
 fi
 
-# Retrieve tzdata from svn, unless already present.
-if [ ! -d "$tzdata_version_dir" ]; then
-  if [ $dry = false ]; then
-    echo "INFO: Downloading tzdata${tzdata_version}"
-    svn export "${tzdata_url}" "${tzdata_version_dir}"
-  fi
-else
-  echo "INFO: Skip downloading tzdata${tzdata_version}, directory already present"
+# Retrieve tzdata from svn.
+if [ $dry = false ]; then
+  echo "INFO: Downloading tzdata${tzdata_version}"
+
+  # Remove intl/tzdata/source, then replace it with a clean export.
+  rm -r "${tzdata_dir}"/source
+  svn export "${tzdata_url}" "${tzdata_dir}"/source
 fi
 
 # Record `svn info`, eliding the line that changes every time the entire ICU
 # tzdata repository (not just the path within it we care about) receives a
 # commit.
 if [ $dry = false ]; then
   svn info "${tzdata_url}" | grep --invert-match '^Revision: [[:digit:]]\+$' > "${tzdata_dir}"/SVN-INFO
 fi
 
 # Update ICU data.
 update_icu_data() {
   set +e
 
   local type="$1"
   local file="$2"
-  local cmd="${icu_pkg} --add ${tzdata_files} --sourcedir ${tzdata_version_dir}/${type} ${file}"
+  local cmd="${icu_pkg} --add ${tzdata_files} --sourcedir ${tzdata_dir}/source/${type} ${file}"
   eval "${cmd}"
 
   local exit_status=$?
 
   if [ $exit_status -ne 0 ]; then
     echo >&2 "ERROR: Error updating tzdata"
     echo >&2 "ERROR: If you see an error message like 'format version 03.00 not supported',\n"\
               "      ensure your icupkg version matches the current ICU version."
     exit $exit_status
   fi
+
+  set -e
 }
 
 if [ $dry = false ]; then
   update_icu_data "le" "${icudata_file_le}"
   if [ -n "${icudata_file_be}" ]; then
     update_icu_data "be" "${icudata_file_be}"
   fi
 
+  hg addremove "${tzdata_dir}" "${icudata_file_le}"
+  if [ -n "${icudata_file_be}" ]; then
+    hg addremove "${icudata_file_be}"
+  fi
+
   echo "INFO: Successfully updated tzdata!"
   echo "INFO: Please run js/src/builtin/make_intl_data.py to update additional time zone files for SpiderMonkey."
 fi