From 45f8f07d1378a9cfe8c37a08fee62ad4516a31f8 Mon Sep 17 00:00:00 2001 From: Jeremy Cline Date: Sep 24 2018 19:50:12 +0000 Subject: Explicitly mangle unversioned Python shebangs This is now an error in Rawhide, so mangle all the Python shebangs to Python 3. --- diff --git a/kernel-tools.spec b/kernel-tools.spec index 0ba70a6..37beec1 100644 --- a/kernel-tools.spec +++ b/kernel-tools.spec @@ -72,6 +72,8 @@ BuildRequires: net-tools, hostname, bc, elfutils-devel BuildRequires: zlib-devel binutils-devel newt-devel python2-devel python3-docutils perl(ExtUtils::Embed) bison flex xz-devel BuildRequires: audit-libs-devel glibc-devel glibc-static python3-devel BuildRequires: asciidoc xmlto +# Used to mangle unversioned shebangs to be Python 3 +BuildRequires: /usr/bin/pathfix.py %ifnarch s390x %{arm} BuildRequires: numactl-devel %endif @@ -202,6 +204,12 @@ cd linux-%{kversion} # END OF PATCH APPLICATIONS +# Mangle /usr/bin/python shebangs to /usr/bin/python3 +# -p preserves timestamps +# -n prevents creating ~backup files +# -i specifies the interpreter for the shebang +pathfix.py -pni "%{__python3} %{py3_shbang_opts}" tools/ + cp -a tools/perf tools/python3-perf ###