OSDN Git Service

Fix the permission setting in common.ZipWriteStr()
authorTao Bao <tbao@google.com>
Wed, 20 May 2015 16:32:18 +0000 (09:32 -0700)
committerTao Bao <tbao@google.com>
Wed, 20 May 2015 20:29:03 +0000 (13:29 -0700)
commit58c1b96165e525808280502581700909d6371715
treea6c12f73a322ad028be04c531d59bd118f2fa1cf
parent74a5606fb409bae3a7212d58e840e6b447f14b22
Fix the permission setting in common.ZipWriteStr()

When passing a ZipInfo instance to common.ZipWriteStr(), the
external_attr attribute should not be overwritten unless specified.
We didn't have the issue previously because we were calling
ZipFile.writestr() directly until [1] merged.

[1] commit 2ed665a033c587b276b1615516e5354e2ace47cd.

Bug: http://b/21309935
Change-Id: I8c0190362c60d7d78965ecfe5e484f8398ddc5f2
(cherry picked from commit 97734654099431bd6c5bd2eeb5d34af0e2dc03e7)
tools/releasetools/common.py
tools/releasetools/test_common.py