From 3860a90c5fa9497c1e7858750244e04b25a7d351 Mon Sep 17 00:00:00 2001 From: Brad Schoening <5796692+bschoening@users.noreply.github.com> Date: Sat, 12 Nov 2022 18:31:10 -0500 Subject: [PATCH] Change shebangs of Python scripts to resolve Python 3 from env command patch by Brad Schoening; reviewed by Stefan Miklosovic and Brandon Williams for CASSANDRA-17832 Co-authored-by: Stefan Miklosovic --- CHANGES.txt | 1 + bin/cqlsh.py | 2 +- pylib/setup.py | 2 +- redhat/cassandra.spec | 4 ++-- redhat/noboolean/cassandra.spec | 4 ++-- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index b1b3788dc4..ba7c5a1be4 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 4.2 + * Change shebangs of Python scripts to resolve Python 3 from env command (CASSANDRA-17832) * Add reasons to guardrail messages and consider guardrails in the error message for needed ALLOW FILTERING (CASSANDRA-17967) * Add support for CQL functions on collections, tuples and UDTs (CASSANDRA-17811) * Add flag to exclude nodes from local DC when running nodetool rebuild (CASSANDRA-17870) diff --git a/bin/cqlsh.py b/bin/cqlsh.py index 2d079c0fe1..0b0ee39610 100755 --- a/bin/cqlsh.py +++ b/bin/cqlsh.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file diff --git a/pylib/setup.py b/pylib/setup.py index a9f654a677..f5fd1841b3 100755 --- a/pylib/setup.py +++ b/pylib/setup.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information diff --git a/redhat/cassandra.spec b/redhat/cassandra.spec index 3711dfd85d..5004eed585 100644 --- a/redhat/cassandra.spec +++ b/redhat/cassandra.spec @@ -17,8 +17,8 @@ # %define __jar_repack %{nil} -# Turn off the brp-python-bytecompile script -%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g') +# Turn off the brp-python-bytecompile script and mangling shebangs for Python scripts +%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g' -e 's!/usr/lib[^[:space:]]*/brp-mangle-shebangs[[:space:]].*$!!g') # rpmbuild should not barf when it spots we ship # binary executable files in our 'noarch' package diff --git a/redhat/noboolean/cassandra.spec b/redhat/noboolean/cassandra.spec index 8c04fdb4cf..cc3d630346 100644 --- a/redhat/noboolean/cassandra.spec +++ b/redhat/noboolean/cassandra.spec @@ -17,8 +17,8 @@ # %define __jar_repack %{nil} -# Turn off the brp-python-bytecompile script -%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g') +# Turn off the brp-python-bytecompile script and mangling shebangs for Python scripts +%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g' -e 's!/usr/lib[^[:space:]]*/brp-mangle-shebangs[[:space:]].*$!!g') # rpmbuild should not barf when it spots we ship # binary executable files in our 'noarch' package