diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2020-09-24 09:47:47 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2020-09-24 10:50:37 -0400 |
commit | d8b54614aa93b42695666bc6bdbc6263da9cbbc0 (patch) | |
tree | 1c2b265a58d228e133024c6cbde4258bfa080182 /tools | |
parent | 896ef66ff3b167a13a5efb128013d5bd53633a79 (diff) | |
download | python-setuptools-git-d8b54614aa93b42695666bc6bdbc6263da9cbbc0.tar.gz |
Extract PPC64LE into script and port to Python.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/ppc64le-patch.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tools/ppc64le-patch.py b/tools/ppc64le-patch.py new file mode 100644 index 00000000..2a8ff8e0 --- /dev/null +++ b/tools/ppc64le-patch.py @@ -0,0 +1,28 @@ +""" +Except on bionic, Travis Linux base image for PPC64LE +platform lacks the proper +permissions to the directory ~/.cache/pip/wheels that allow +the user running travis build to install pip packages. +TODO: is someone tracking this issue? Maybe just move to bionic? +""" + +import subprocess +import collections +import os + + +def patch(): + env = collections.defaultdict(str, os.environ) + if env['TRAVIS_CPU_ARCH'] != 'ppc64le': + return + cmd = [ + 'sudo', + 'chown', + '-Rfv', + '{USER}:{GROUP}'.format_map(env), + os.path.expanduser('~/.cache/pip/wheels'), + ] + subprocess.Popen(cmd) + + +__name__ == '__main__' and patch() |