diff options
author | Steve Kondik <shade@chemlab.org> | 2012-12-05 23:26:51 -0800 |
---|---|---|
committer | Gerrit Code Review <gerrit@review.cyanogenmod.com> | 2012-12-05 23:26:51 -0800 |
commit | 554c1ce09343cb452d86f2805ffa06e4f24590ac (patch) | |
tree | 721698d04e014068a47b1cf8ddbef82c25dcbe20 | |
parent | 92816a9a675e88ea658e13039e27c49a13deb729 (diff) | |
parent | 4f0cb4136f9f45014befb5ce37d68cef20bcb683 (diff) | |
download | bionic-554c1ce09343cb452d86f2805ffa06e4f24590ac.zip bionic-554c1ce09343cb452d86f2805ffa06e4f24590ac.tar.gz bionic-554c1ce09343cb452d86f2805ffa06e4f24590ac.tar.bz2 |
Merge "timezone: data file should be 32 bit aligned" into mr1-staging
-rw-r--r-- | libc/tools/zoneinfo/ZoneCompactor.java | 7 | ||||
-rwxr-xr-x | libc/tools/zoneinfo/generate | 5 | ||||
-rw-r--r-- | libc/zoneinfo/zoneinfo.dat | bin | 499422 -> 500840 bytes | |||
-rw-r--r-- | libc/zoneinfo/zoneinfo.idx | bin | 29848 -> 29848 bytes | |||
-rw-r--r-- | libc/zoneinfo/zoneinfo.version | 2 |
5 files changed, 11 insertions, 3 deletions
diff --git a/libc/tools/zoneinfo/ZoneCompactor.java b/libc/tools/zoneinfo/ZoneCompactor.java index b657748..cc77c94 100644 --- a/libc/tools/zoneinfo/ZoneCompactor.java +++ b/libc/tools/zoneinfo/ZoneCompactor.java @@ -55,11 +55,13 @@ public class ZoneCompactor { InputStream in = new FileInputStream(inFile); byte[] buf = new byte[8192]; + int length = 0; while (true) { int nbytes = in.read(buf); if (nbytes == -1) { break; } + length += nbytes; out.write(buf, 0, nbytes); byte[] nret = new byte[ret.length + nbytes]; @@ -67,6 +69,8 @@ public class ZoneCompactor { System.arraycopy(buf, 0, nret, ret.length, nbytes); ret = nret; } + if (length%4 != 0) + out.write(new byte[] {00,00,00,00}, 0, 4 - length % 4); out.flush(); return ret; } @@ -105,6 +109,9 @@ public class ZoneCompactor { lengths.put(s, new Integer((int)length)); start += length; + if (start % 4 != 0) + start += 4 - start % 4; + byte[] data = copyFile(f, zoneInfo); TimeZone tz = ZoneInfo.make(s, data); diff --git a/libc/tools/zoneinfo/generate b/libc/tools/zoneinfo/generate index ab2617f..7017e90 100755 --- a/libc/tools/zoneinfo/generate +++ b/libc/tools/zoneinfo/generate @@ -92,7 +92,7 @@ def upgrade_to(ftp, filename): subprocess.check_call(['javac', '-d', '.', '%s/ZoneCompactor.java' % bionic_libc_tools_zoneinfo_dir, '%s/ZoneInfo.java' % bionic_libc_tools_zoneinfo_dir]) - subprocess.check_call(['java', 'ZoneCompactor', 'setup', 'data']) + subprocess.check_call(['java', '-classpath', '.', 'ZoneCompactor', 'setup', 'data']) print 'Updating bionic from %s to %s...' % (current_tzdata_version(), version) # Move the .dat and .idx files... @@ -116,7 +116,8 @@ ftp.cwd('tz/releases') tzdata_filenames = [] for filename in ftp.nlst(): if filename.startswith('tzdata20'): - tzdata_filenames.append(filename) + if filename.endswith('tar.gz'): + tzdata_filenames.append(filename) tzdata_filenames.sort() # If you're several releases behind, we'll walk you through the upgrades one by one. diff --git a/libc/zoneinfo/zoneinfo.dat b/libc/zoneinfo/zoneinfo.dat Binary files differindex cb0507a..cd4b4cc 100644 --- a/libc/zoneinfo/zoneinfo.dat +++ b/libc/zoneinfo/zoneinfo.dat diff --git a/libc/zoneinfo/zoneinfo.idx b/libc/zoneinfo/zoneinfo.idx Binary files differindex c93b637..1f5f538 100644 --- a/libc/zoneinfo/zoneinfo.idx +++ b/libc/zoneinfo/zoneinfo.idx diff --git a/libc/zoneinfo/zoneinfo.version b/libc/zoneinfo/zoneinfo.version index 73bb417..0bbfa63 100644 --- a/libc/zoneinfo/zoneinfo.version +++ b/libc/zoneinfo/zoneinfo.version @@ -1 +1 @@ -2012h +2012j |