From cbe242bdfc9bf3c53147c29723f535dd89178a18 Mon Sep 17 00:00:00 2001 From: Sergey Skripnick Date: Thu, 14 May 2015 00:20:14 +0300 Subject: [PATCH] Install data files in proper path Bash completion script is installed in /usr/local/etc, so install_rally.sh should make a symlink in /etc/bash_completion.d/ Also move `data_files` section from setup.py to setup.cfg Closes-Bug: 1463038 Change-Id: Ifd5f69e41aa8121129d6314130385f48e1690843 --- setup.cfg | 4 ++++ setup.py | 11 ----------- tests/ci/test_install.sh | 2 ++ 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/setup.cfg b/setup.cfg index 289bc105..43614ae1 100644 --- a/setup.cfg +++ b/setup.cfg @@ -23,6 +23,10 @@ classifier = packages = rally +data_files = + etc/bash_completion.d = + etc/rally.bash_completion + [entry_points] console_scripts = rally = rally.cli.main:main diff --git a/setup.py b/setup.py index e1e3cef6..f92d7277 100644 --- a/setup.py +++ b/setup.py @@ -25,17 +25,6 @@ try: except ImportError: pass -import os -if os.getuid() == 0: - data_files = [ - ('/etc/bash_completion.d', ['etc/rally.bash_completion']), - ] -else: - data_files = [ - ('etc/bash_completion.d', ['etc/rally.bash_completion']), - ] - setuptools.setup( setup_requires=['pbr'], - data_files=data_files, pbr=True) diff --git a/tests/ci/test_install.sh b/tests/ci/test_install.sh index 1de853b0..434ed8f5 100755 --- a/tests/ci/test_install.sh +++ b/tests/ci/test_install.sh @@ -19,12 +19,14 @@ env sudo ./install_rally.sh --system --yes rally deployment list +[ -d /etc/bash_completion.d ] && cat /etc/bash_completion.d/rally.bash_completion || true sudo ./install_rally.sh --system --yes rally deployment list sudo ./install_rally.sh --yes -d /tmp/rallytest_root/ /tmp/rallytest_root/bin/rally deployment list +cat /tmp/rallytest_root/etc/bash_completion.d/rally.bash_completion sudo rm -fr ~/.rally