diff options
author | Neil Fuller <nfuller@google.com> | 2014-05-21 16:18:59 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-05-21 16:18:59 +0000 |
commit | 768051405e8d471e06447a5b7223c742022f525a (patch) | |
tree | 3d63a98be8581bad2d47dac3129dbb5b112f51c7 /libc/tools | |
parent | 29f2906bdaf9afe816fc9196437fc07728af98bf (diff) | |
parent | 43f37159532c1ef7218266957cc616f055b4dbac (diff) | |
download | bionic-768051405e8d471e06447a5b7223c742022f525a.zip bionic-768051405e8d471e06447a5b7223c742022f525a.tar.gz bionic-768051405e8d471e06447a5b7223c742022f525a.tar.bz2 |
Merge "Treat zero or >1 dat files as an error"
Diffstat (limited to 'libc/tools')
-rwxr-xr-x | libc/tools/zoneinfo/update-tzdata.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libc/tools/zoneinfo/update-tzdata.py b/libc/tools/zoneinfo/update-tzdata.py index 68c893d..3dcb210 100755 --- a/libc/tools/zoneinfo/update-tzdata.py +++ b/libc/tools/zoneinfo/update-tzdata.py @@ -130,9 +130,14 @@ def BuildIcuToolsAndData(data_filename): os.chdir(icu_working_dir) icu_dat_data_dir = '%s/stubdata' % icu_dir - for file in glob.glob('data/out/tmp/*.dat'): - print 'Copying %s to %s ...' % (file, icu_dat_data_dir) - shutil.copy(file, icu_dat_data_dir) + datfiles = glob.glob('data/out/tmp/icudt??l.dat') + if len(datfiles) != 1: + print 'ERROR: Unexpectedly found %d .dat files (%s). Halting.' % (len(datfiles), datfiles) + sys.exit(1) + + datfile = datfiles[0] + print 'Copying %s to %s ...' % (datfile, icu_dat_data_dir) + shutil.copy(datfile, icu_dat_data_dir) # Switch back to the original working cwd. os.chdir(original_working_dir) |