Skip to contentSkip to conversation

tools: hv: lsvmbus: change shebang to use python3

PATCH Applied Anthony Nandaa 3 participants 3 messages Jul 2, 2024 – Aug 3, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 tools: hv: lsvmbus: change shebang to use python3

In many modern Linux distros, running lsvmbus returns the error:

```
/usr/bin/env: 'python': No such file or directory
```

because 'python' doesn't point anywhere.

Now that python2 has reached EOL as of January 1, 2020 and is no longer maintained[1], these distros have python3 instead.

Also, the script isn't executable by default because the permissions are set to mode 644.

Fix this by updating the shebang in the lsvmbus to use python3 instead of python. Also fix the permissions to be 755 so that is executable by default, which matches other similar scripts in tools/hv.

The script is also tested and verified that is compatible with python3.

[1] https://www.python.org/doc/sunset-python-2/

---
v2:
* change the commit message body to conform to guidelines.

---
 tools/hv/lsvmbus | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 mode change 100644 => 100755 tools/hv/lsvmbus
tools/hv/lsvmbus +1 -1
old mode 100644
new mode 100755
index 55e7374bade0..23dcd8e705be
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # SPDX-License-Identifier: GPL-2.0
 
 import os
Signature · 1 line
2.39.4
Reviewed-by on v2 1/1
#1 lore raw

From: Anthony Nandaa <[email protected]> Sent: Tuesday, July 2, 2024 3:23 AM

Quoted 40 lines

In many modern Linux distros, running lsvmbus returns the error:

```
/usr/bin/env: 'python': No such file or directory
```

because 'python' doesn't point anywhere.

Now that python2 has reached EOL as of January 1, 2020 and is no longer maintained[1], these distros have python3 instead.

Also, the script isn't executable by default because the permissions are set to mode 644.

Fix this by updating the shebang in the lsvmbus to use python3 instead of python. Also fix the permissions to be 755 so that is executable by default, which matches other similar scripts in tools/hv.

The script is also tested and verified that is compatible with python3.

[1] https://www.python.org/doc/sunset-python-2/

---
v2:
* change the commit message body to conform to guidelines.

---
 tools/hv/lsvmbus | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 mode change 100644 => 100755 tools/hv/lsvmbus
tools/hv/lsvmbus +0 -0
old mode 100644
new mode 100755
index 55e7374bade0..23dcd8e705be

tools/hv/lsvmbus

Quoted 6 lines
tools/hv/lsvmbus +1 -2
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # SPDX-License-Identifier: GPL-2.0
 
 import os
--