Bug 1411010 - Update internal timezone database to version 2018b (update script). r=philipp
authorMartin Schroeder <mschroeder@mozilla.x-home.org>
Sun, 21 Jan 2018 23:58:57 +0100
changeset 31030 81cedc2be843d5bf938b2e09fac3a159e998d98e
parent 31029 7350e693cbb52a581f7c0874457ea6344e16a549
child 31031 c931f111d6bc4a2a0d84dbe25d6699d0865399bc
push id383
push userclokep@gmail.com
push dateMon, 07 May 2018 21:52:48 +0000
reviewersphilipp
bugs1411010
Bug 1411010 - Update internal timezone database to version 2018b (update script). r=philipp
calendar/timezones/update-zones.py
--- a/calendar/timezones/update-zones.py
+++ b/calendar/timezones/update-zones.py
@@ -39,21 +39,21 @@ class TimezoneUpdater(object):
         self.tzdata_path = tempfile.mkdtemp(prefix="zones")
         sys.stderr.write("Extracting %s to %s\n" % (tzdata_download_path, self.tzdata_path))
         tarfile.open(tzdata_download_path).extractall(path=self.tzdata_path)
         os.unlink(tzdata_download_path)
 
     def get_tzdata_version(self):
         """Extract version number of tzdata files."""
         version = None
-        with open(os.path.join(self.tzdata_path, "Makefile"), "r") as makefile:
-            for line in makefile:
-                match = re.search(r"VERSION=\s*(\w+)", line)
+        with open(os.path.join(self.tzdata_path, "version"), "r") as versionfile:
+            for line in versionfile:
+                match = re.match(r"\w+", line)
                 if match is not None:
-                    version = "2." + match.group(1)
+                    version = "2." + match.group(0)
                     break
         return version
 
     def run_vzic(self, vzic_path):
         """Use vzic to create ICS versions of the data."""
 
         # Use `vzic` to create 'pure' and 'non-pure' zone files.
         sys.stderr.write("Exporting zone info to %s\n" % self.zoneinfo_path)