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 <slaznick@redhat.com>
This commit is contained in:
Martin Basti
2017-06-21 17:59:57 +02:00
committed by Pavel Vomacka
parent 17103e53cb
commit aa1c0cf3e8

View File

@@ -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} \