From 62f0909e4b3a203adda5a9f731be02db63524daa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Str=C3=B6der?= Date: Tue, 13 Jul 2021 15:36:33 +0000 Subject: [PATCH] Accepting request 905731 from home:StevenK:branches:systemsmanagement - If building with Python 3, change the shebang of the test scripts shipped in ansible-test to be /usr/bin/python3. OBS-URL: https://build.opensuse.org/request/show/905731 OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/ansible?expand=0&rev=211 --- ansible.changes | 6 ++++++ ansible.spec | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/ansible.changes b/ansible.changes index 0067430..e63d74b 100644 --- a/ansible.changes +++ b/ansible.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Jul 12 04:59:25 UTC 2021 - Steve Kowalik + +- If building with Python 3, change the shebang of the test scripts + shipped in ansible-test to be /usr/bin/python3. + ------------------------------------------------------------------- Thu Jun 24 15:46:27 UTC 2021 - Michael Ströder diff --git a/ansible.spec b/ansible.spec index 88908eb..c06a034 100644 --- a/ansible.spec +++ b/ansible.spec @@ -300,6 +300,12 @@ find contrib/ -type f -exec chmod 644 {} + find ./ -type f -exec \ sed -i '1s|^#!%{_bindir}/env |#!%{_bindir}/|' {} \; +# Run test fragments under Python 3, if that is our configured Python. +%if %{with python3} + find test -name '*.py' -exec \ + sed -i '1s|^\(#!%{_bindir}/python\)$|\13|' {} \; +%endif + %build %{python} setup.py build %if 0%{?with_docs}