Mangle Python shebangs to Python 3 only

This commit is contained in:
Jeremy Cline 2018-09-18 15:56:33 -04:00
parent f1461c1d71
commit 1a08114a16
No known key found for this signature in database
GPG Key ID: 9223308FA9B246DB

View File

@ -385,6 +385,8 @@ BuildRequires: kmod, patch, bash, tar, git-core
BuildRequires: bzip2, xz, findutils, gzip, m4, perl-interpreter, perl-Carp, perl-devel, perl-generators, make, diffutils, gawk
BuildRequires: gcc, binutils, redhat-rpm-config, hmaccalc, bison, flex
BuildRequires: net-tools, hostname, bc, elfutils-devel
# Used to mangle unversioned shebangs to be Python 3
BuildRequires: /usr/bin/pathfix.py
%if %{with_sparse}
BuildRequires: sparse
%endif
@ -1153,6 +1155,16 @@ find . \( -name "*.orig" -o -name "*~" \) -delete >/dev/null
# remove unnecessary SCM files
find . -name .gitignore -delete >/dev/null
# Mangle /usr/bin/python shebangs to /usr/bin/python3
# Mangle all Python shebangs to be Python 3 explicitly
# -p preserves timestamps
# -n prevents creating ~backup files
# -i specifies the interpreter for the shebang
pathfix.py -pni "%{__python3} %{py3_shbang_opts}" scripts/
pathfix.py -pni "%{__python3} %{py3_shbang_opts}" scripts/diffconfig
pathfix.py -pni "%{__python3} %{py3_shbang_opts}" scripts/bloat-o-meter
pathfix.py -pni "%{__python3} %{py3_shbang_opts}" scripts/show_delta
cd ..
###