Bug 1216370 - bcache-status assumes python3 is available as `python` and fails to run
Summary: bcache-status assumes python3 is available as `python` and fails to run
Status: NEW
Alias: None
Product: openSUSE Distribution
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: Leap 15.5
Hardware: x86-64 openSUSE Leap 15.5
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: David Disseldorp
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-18 10:52 UTC by Joachim Wagner
Modified: 2024-03-01 01:19 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joachim Wagner 2023-10-18 10:52:47 UTC
bcache-status is part of the package bcache-tool and installed into /usr/sbin/. It invokes /usr/bin/env python to try to find the system's Python interpreter but on openSUSE 15.5 this does not work as python is not linked to python3:

$ head -n 1 $(which bcache-status)
#!/usr/bin/env python

Actual behaviour:
/usr/bin/env: ‘python’: No such file or directory

Expected behaviour:
Command output lists statistics of the availabe bcache cache devices.

Workaround: run
python3 /usr/sbin/bcache-status
Comment 1 Joachim Wagner 2023-10-23 09:31:19 UTC
A little more convenient workaround, with a small danger of side effects:

ln -s /usr/bin/python3 /usr/local/bin/python
Comment 3 David Disseldorp 2024-03-01 01:19:25 UTC
From https://build.opensuse.org/request/show/1124427 :

56 %make_build all \
57         CFLAGS="%optflags $(pkg-config blkid uuid --cflags) -std=gnu99" \
58         LDFLAGS="$(pkg-config blkid uuid --libs)"
59+perl -i -lpe 's{^#!/usr/bin/env python\b}{#!/usr/bin/python3}' bcache-status

This is a pretty non-standard way to patch the python path. I plan on replacing this logic with a plain downstream patch.