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 | |
| parent | 896ef66ff3b167a13a5efb128013d5bd53633a79 (diff) | |
| download | python-setuptools-git-d8b54614aa93b42695666bc6bdbc6263da9cbbc0.tar.gz | |
Extract PPC64LE into script and port to Python.
| -rw-r--r-- | .travis.yml | 10 | ||||
| -rw-r--r-- | tools/ppc64le-patch.py | 28 |
2 files changed, 29 insertions, 9 deletions
diff --git a/.travis.yml b/.travis.yml index d12a9ece..62da9b20 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,15 +39,7 @@ jobs: cache: pip before_install: - - | - # 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? - if [[ "$TRAVIS_CPU_ARCH" == "ppc64le" ]]; then - sudo chown -Rfv $USER:$GROUP ~/.cache/pip/wheels - fi +- python tools/ppc64le-patch.py install: 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() |
