forked from openkylin/platform_build
Fix the permission in common.ZipWriteStr().
common.ZipWriteStr() should set a default file permission to 0o100644 instead of 0o644. Change-Id: I8c89d8442b095b56ad3a0d47afdfa73ce55ad0c8
This commit is contained in:
parent
c881249354
commit
2a410587e8
|
@ -908,7 +908,7 @@ def ZipWriteStr(zip_file, zinfo_or_arcname, data, perms=None,
|
||||||
zinfo = zipfile.ZipInfo(filename=zinfo_or_arcname)
|
zinfo = zipfile.ZipInfo(filename=zinfo_or_arcname)
|
||||||
zinfo.compress_type = zip_file.compression
|
zinfo.compress_type = zip_file.compression
|
||||||
if perms is None:
|
if perms is None:
|
||||||
perms = 0o644
|
perms = 0o100644
|
||||||
else:
|
else:
|
||||||
zinfo = zinfo_or_arcname
|
zinfo = zinfo_or_arcname
|
||||||
|
|
||||||
|
@ -918,6 +918,9 @@ def ZipWriteStr(zip_file, zinfo_or_arcname, data, perms=None,
|
||||||
|
|
||||||
# If perms is given, it has a priority.
|
# If perms is given, it has a priority.
|
||||||
if perms is not None:
|
if perms is not None:
|
||||||
|
# If perms doesn't set the file type, mark it as a regular file.
|
||||||
|
if perms & 0o770000 == 0:
|
||||||
|
perms |= 0o100000
|
||||||
zinfo.external_attr = perms << 16
|
zinfo.external_attr = perms << 16
|
||||||
|
|
||||||
# Use a fixed timestamp so the output is repeatable.
|
# Use a fixed timestamp so the output is repeatable.
|
||||||
|
|
Loading…
Reference in New Issue