mstflint/SOURCES/0001-Fix-shebang-for-python-scripts.patch

43 lines
1.1 KiB
Diff
Raw Normal View History

2019-08-02 12:50:18 +00:00
From 8a54316a15c76154d307ba53be5d98b8503a5d5f Mon Sep 17 00:00:00 2001
From: Honggang Li <honli@redhat.com>
Date: Thu, 13 Jun 2019 20:58:50 -0400
Subject: [PATCH] Fix shebang for python scripts
rhel-8 does not support python2. User '#!/usr/bin/python3' for all
python scripts which with a shebang.
The substitution was done with following bash script.
====
pys=$(find . -type f -name '*.py')
for f in $pys; do
sed -ne '1p' $f | grep -q -E '^#!/usr/bin'
if [ $? -eq 0 ]; then
echo $f
sed -e '/^#!\/usr\/bin/d' -i $f
sed -e '1 i\#!/usr/bin/python3' -i $f
fi
done
===
Signed-off-by: Honggang Li <honli@redhat.com>
---
tracers/fwtrace/mstfwtrace.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tracers/fwtrace/mstfwtrace.py b/tracers/fwtrace/mstfwtrace.py
index 3c3ef8f..5193a31 100755
--- a/tracers/fwtrace/mstfwtrace.py
+++ b/tracers/fwtrace/mstfwtrace.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
# --
#
# Copyright (C) 2019 Mellanox Technologies Ltd. All rights reserved.
--
2.20.1