From 9909e7e834d63062ee9833effc58d48f53f6ac76 Mon Sep 17 00:00:00 2001 From: Cleber Rosa Date: Tue, 20 Mar 2018 00:54:29 -0400 Subject: [PATCH] SPEC: make bash package independent of Python version And favor a system wide path for `avocado exec-path`, in the same way we prefer the `/etc/avocado` files. If not running from packages, the Python version specific location will be used. Signed-off-by: Cleber Rosa --- avocado/plugins/exec_path.py | 8 +++++++- python-avocado.spec | 6 +++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/avocado/plugins/exec_path.py b/avocado/plugins/exec_path.py index 5701bc89..d050ea37 100644 --- a/avocado/plugins/exec_path.py +++ b/avocado/plugins/exec_path.py @@ -14,6 +14,8 @@ Libexec PATHs modifier """ +import os + from pkg_resources import resource_filename from avocado.core.output import LOG_UI from avocado.core.plugin_interfaces import CLICmd @@ -34,4 +36,8 @@ class ExecPath(CLICmd): :param args: Command line args received from the run subparser. """ - LOG_UI.debug(resource_filename("avocado", "libexec")) + system_wide = '/usr/libexec/avocado' + if os.path.isdir(system_wide): + LOG_UI.debug(system_wide) + else: + LOG_UI.debug(resource_filename("avocado", "libexec")) diff --git a/python-avocado.spec b/python-avocado.spec index aa5d3824..4f6ad651 100644 --- a/python-avocado.spec +++ b/python-avocado.spec @@ -203,8 +203,8 @@ popd %{__cp} -r examples/yaml_to_mux %{buildroot}%{_datadir}/avocado %{__cp} -r examples/yaml_to_mux_loader %{buildroot}%{_datadir}/avocado %{__cp} -r examples/varianter_pict %{buildroot}%{_datadir}/avocado -%{__mkdir} -p %{buildroot}%{_libexecdir}/ -ln -s %{python_sitelib}/avocado/libexec/ %{buildroot}%{_libexecdir}/avocado +%{__mkdir} -p %{buildroot}%{_libexecdir}/avocado +%{__mv} %{buildroot}%{python_sitelib}/avocado/libexec/* %{buildroot}%{_libexecdir}/avocado %check %if %{with_tests} @@ -479,7 +479,6 @@ A small set of utilities to interact with Avocado from the Bourne Again Shell code (and possibly other similar shells). %files bash -%{python_sitelib}/avocado/libexec* %{_libexecdir}/avocado* %changelog @@ -488,6 +487,7 @@ Again Shell code (and possibly other similar shells). - Removed extra dependencies on Fedora 24 for runner-remote - Added python-avocado requirement for golang plugin - Added new common sub-package +- Make bash package independent of Python version * Thu Mar 8 2018 Cleber Rosa - 59.0-1 - Remove backward compatibility with name avocado -- GitLab