From 0b599ca428832584b8ef93346d94be4305d2f378 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 19 Sep 2019 20:43:49 -0700 Subject: [PATCH] Merge pull request #1369 from wxWidgets/fix-issue1363 Explicitly set permissions of the files and folders in source tarball (cherry picked from commit 4c3e4296f9b6e3f3df762b7f1ae0b7af0c00b9ed) --- build.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/build.py b/build.py index a30ebe73..8f72d88e 100755 --- a/build.py +++ b/build.py @@ -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