Merge pull request #1369 from wxWidgets/fix-issue1363

Explicitly set permissions of the files and folders in source tarball

(cherry picked from commit 4c3e4296f9)
This commit is contained in:
Robin Dunn
2019-09-19 20:43:49 -07:00
parent b45e5a7435
commit 0b599ca428

View File

@@ -914,6 +914,18 @@ def do_regenerate_sysconfig():
del pwd
def _setTarItemPerms(tarinfo):
"""
Used to set permissions of the files and fodlers in the source tarball
"""
if tarinfo.isdir():
tarinfo.mode = 0o755
else:
tarinfo.mode = 0o644
return tarinfo
#---------------------------------------------------------------------------
# Command functions and helpers
#---------------------------------------------------------------------------
@@ -1994,7 +2006,7 @@ def cmd_sdist(options, args):
tarball = tarfile.open(name=tarfilename, mode="w:gz")
pwd = pushDir(PDEST)
for name in glob.glob('*'):
tarball.add(name, os.path.join(rootname, name))
tarball.add(name, os.path.join(rootname, name), filter=_setTarItemPerms)
tarball.close()
msg('Cleaning up...')
del pwd