diff options
author | Toshio Kuratomi <a.badger@gmail.com> | 2017-04-03 08:55:55 -0700 |
---|---|---|
committer | Toshio Kuratomi <a.badger@gmail.com> | 2017-04-04 11:19:27 -0700 |
commit | 57a7d7704ff091f5f9b957c12826435829b1c892 (patch) | |
tree | 7cb0e2fb14f6e91de54094512a62de27cae700be /setup.py | |
parent | 3180b4757e694475452be35442e42315887720b7 (diff) | |
download | ansible-57a7d7704ff091f5f9b957c12826435829b1c892.tar.gz |
Make scripts into symlinks
pip can't handle zip files with symlinks. Attempt to workaround that by
transforming the bin scripts into symlinks after the zip file has been
unarchived into the build tree.
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -1,4 +1,5 @@ import os +import os.path import sys sys.path.insert(0, os.path.abspath('lib')) @@ -18,6 +19,25 @@ with open('requirements.txt') as requirements_file: "That indicates this copy of the source code is incomplete.") sys.exit(2) +SYMLINKS = {'ansible': frozenset(('ansible-console', + 'ansible-doc', + 'ansible-galaxy', + 'ansible-playbook', + 'ansible-pull', + 'ansible-vault'))} + +for source in SYMLINKS: + for dest in SYMLINKS[source]: + dest_path = os.path.join('bin', dest) + if not os.path.islink(dest_path): + try: + os.unlink(dest_path) + except OSError as e: + if e.errno == 2: + # File does not exist which is all we wanted + pass + os.symlink(source, dest_path) + setup( name='ansible', version=__version__, |