Fixes to the update-tzdata.py tool
We build one too many times. Creating a missing directory
is sufficient.
The tz2icu needs some files in the CWD. Added symlinks.
Bug: 19230091
(cherry-pick of commit 0662c3e5b33840e19f4c14b85bf619c33b3a0d0f)
Change-Id: Ie21d848f1b776ec745473b9122e003fdf0acf105
diff --git a/libc/tools/zoneinfo/update-tzdata.py b/libc/tools/zoneinfo/update-tzdata.py
index 330f166..4847356 100755
--- a/libc/tools/zoneinfo/update-tzdata.py
+++ b/libc/tools/zoneinfo/update-tzdata.py
@@ -117,13 +117,20 @@
# Build the ICU tools.
print 'Configuring ICU tools...'
subprocess.check_call(['%s/runConfigureICU' % icu_dir, 'Linux'])
- print 'Making ICU tools...'
- subprocess.check_call(['make', '-j32'])
# Run the ICU tools.
os.chdir('tools/tzcode')
+
+ # The tz2icu tool only picks up icuregions and icuzones in they are in the CWD
+ for icu_data_file in [ 'icuregions', 'icuzones']:
+ icu_data_file_source = '%s/tools/tzcode/%s' % (icu_dir, icu_data_file)
+ icu_data_file_symlink = './%s' % icu_data_file
+ os.symlink(icu_data_file_source, icu_data_file_symlink)
+
shutil.copyfile('%s/%s' % (original_working_dir, data_filename), data_filename)
print 'Making ICU data...'
+ # The Makefile assumes the existence of the bin directory.
+ os.mkdir('%s/bin' % icu_working_dir)
subprocess.check_call(['make'])
# Copy the source file to its ultimate destination.