From 1a08114a16e719c1339d7602099085cbe816bfc5 Mon Sep 17 00:00:00 2001 From: Jeremy Cline Date: Tue, 18 Sep 2018 15:56:33 -0400 Subject: [PATCH] Mangle Python shebangs to Python 3 only --- kernel.spec | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/kernel.spec b/kernel.spec index c726d1229..14ded1f54 100644 --- a/kernel.spec +++ b/kernel.spec @@ -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 .. ###