Support defining %py3_shebang_flags to %nil

This commit is contained in:
Miro Hrončok 2020-12-08 12:10:29 +01:00
commit 601d83d35a
5 changed files with 52 additions and 15 deletions

View file

@ -6,7 +6,13 @@
%py2_shbang_opts -s
%py2_shbang_opts_nodash %(opts=%{py2_shbang_opts}; echo ${opts#-})
%py2_shebang_flags %(opts=%{py2_shbang_opts}; echo ${opts#-})
%py2_shebang_fix %{expand:/usr/bin/pathfix.py -pni %{__python2} -k%{?py2_shebang_flags:a %py2_shebang_flags}}
%py2_shebang_fix %{expand:\\\
if [ -z "%{?py_shebang_flags}" ]; then
shebang_flags="-k"
else
shebang_flags="-ka%{py2_shebang_flags}"
fi
/usr/bin/pathfix.py -pni %{__python2} $shebang_flags}
# Use the slashes after expand so that the command starts on the same line as
# the macro