From a506123afef6ac0901a92e47b8a3a27c7e3eda29 Mon Sep 17 00:00:00 2001 From: Tomas Hrnciar Date: Fri, 4 Sep 2020 12:31:37 +0200 Subject: [PATCH] Replace pathfix with py3_shebang_fix %pyproject_install currently has: `pathfix%{python3_version}.py -pni "%{__python3}" -k%{?py3_shbang_opts: -a%{py3_shbang_opts_nodash}} %{buildroot}%{_bindir}/*` We should replace it with `%py3_shebang_fix %{buildroot}%{_bindir}/*` which expands to: ~~~~ if [ -f /usr/bin/pathfix%{python3_version}.py ]; then pathfix=/usr/bin/pathfix%{python3_version}.py else # older versions of Python don't have it and must BR /usr/bin/pathfix.py from python3-devel explicitly pathfix=/usr/bin/pathfix.py fi $pathfix -pni %{__python3} -k%{?py3_shebang_flags:a %py3_shebang_flags}} %{buildroot}%{_bindir}/* ~~~~ Mainly so that we: - switch to %py3_shebang_flags - have only one place to fix the invocation Fixes: rhbz#1868347 --- macros.pyproject | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macros.pyproject b/macros.pyproject index d9691b5..51cc8dd 100644 --- a/macros.pyproject +++ b/macros.pyproject @@ -26,7 +26,7 @@ specifier=$(ls %{_pyproject_wheeldir}/*.whl | xargs basename --multiple | sed -E export TMPDIR="${PWD}/%{_pyproject_builddir}" %{__python3} -m pip install --root %{buildroot} --no-deps --disable-pip-version-check --progress-bar off --verbose --ignore-installed --no-warn-script-location --no-index --no-cache-dir --find-links %{_pyproject_wheeldir} $specifier if [ -d %{buildroot}%{_bindir} ]; then - pathfix%{python3_version}.py -pni "%{__python3}" -k%{?py3_shbang_opts: -a%{py3_shbang_opts_nodash}} %{buildroot}%{_bindir}/* + %py3_shebang_fix %{buildroot}%{_bindir}/* rm -rfv %{buildroot}%{_bindir}/__pycache__ fi rm -f %{pyproject_ghost_distinfo}