Fix handling of shebangs
- Use new _py3_shebang_s macro - Allow %pyproject_install to handle shebang fixing where appropriate
This commit is contained in:
parent
c33bf4a3b5
commit
d03b7e96f1
@ -108,8 +108,16 @@ This package includes shell completions files for ansible-core.
|
|||||||
%prep
|
%prep
|
||||||
%autosetup -p1 -n ansible-%{version}
|
%autosetup -p1 -n ansible-%{version}
|
||||||
find \( -name '.git_keep' -o -name '.rstcheck.cfg' \) -delete
|
find \( -name '.git_keep' -o -name '.rstcheck.cfg' \) -delete
|
||||||
sed -i -s 's|/usr/bin/env python|%{python3}|' test/lib/ansible_test/_util/target/cli/ansible_test_cli_stub.py bin/*
|
|
||||||
sed -i -e '1{\@^#!.*@d}' lib/ansible/cli/*.py lib/ansible/modules/hostname.py lib/ansible/cli/scripts/ansible_connection_cli_stub.py
|
# ansible-test is executed directly by the Makefile, so we need to fix the shebang.
|
||||||
|
sed -i -s 's|/usr/bin/env python|%{python3}|' \
|
||||||
|
bin/ansible-test \
|
||||||
|
test/lib/ansible_test/_util/target/cli/ansible_test_cli_stub.py
|
||||||
|
|
||||||
|
|
||||||
|
# TODO: Investigate why hostname is the only module that still has a shebang
|
||||||
|
# and file an upstream issue if needed.
|
||||||
|
sed -i -e '1{\@^#!.*@d}' lib/ansible/modules/hostname.py
|
||||||
|
|
||||||
%generate_buildrequires
|
%generate_buildrequires
|
||||||
temp=$(mktemp)
|
temp=$(mktemp)
|
||||||
@ -118,11 +126,7 @@ sed '/^mock$/d' test/lib/ansible_test/_data/requirements/units.txt > ${temp}
|
|||||||
|
|
||||||
%build
|
%build
|
||||||
# disable the python -s shbang flag as we want to be able to find non system modules
|
# disable the python -s shbang flag as we want to be able to find non system modules
|
||||||
%global py3_shebang_flags %(echo %{py3_shebang_flags} | sed 's/s//')
|
%undefine _py3_shebang_s
|
||||||
%py3_shebang_fix .
|
|
||||||
|
|
||||||
# Build manpages
|
|
||||||
make PYTHON=%{python3} docs
|
|
||||||
|
|
||||||
%pyproject_wheel
|
%pyproject_wheel
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user