From aa1c0cf3e8f2a77e27d548f73694d99aa0497459 Mon Sep 17 00:00:00 2001 From: Martin Basti Date: Jul 12 2017 13:41:04 +0000 Subject: py3: run already ported scripts under py3 by default To prevent regressions in py3, all ported scripts should be run by py3 by default. This is temporary and will be removed once porting to py3 is done https://pagure.io/freeipa/issue/4985 Reviewed-By: Stanislav Laznicka --- diff --git a/freeipa.spec.in b/freeipa.spec.in index dc4ba67..72ce4cc 100644 --- a/freeipa.spec.in +++ b/freeipa.spec.in @@ -864,6 +864,25 @@ find \ ! -name '*.pyo' -a \ -type f -exec grep -qsm1 '^#!.*\bpython' {} \; \ -exec sed -i -e '1 s|^#!.*\bpython[^ ]*|#!%{__python2}|' {} \; + +%if 0%{?with_python3} +# TODO: temporary solution until all scripts are ported to python3, +# TODO: workaround: some scripts are copied over, so the are always py2. +# We have to explicitly set python3 here for ported files here +PY3_SUBST_PATHS=' +install/tools/ipa-backup +install/tools/ipa-compat-manage +install/tools/ipa-dns-install +install/tools/ipa-managed-entries +install/tools/ipa-nis-manage +install/tools/ipactl +' +for P in $PY3_SUBST_PATHS; do + sed -i -e '1 s|^#!.*\bpython[^ ]*|#!%{__python3}|' $P +done; + +%endif # with_python3 + %configure --with-vendor-suffix=-%{release} \ %{enable_server_option} \ %{with_ipatests_option} \