Bugzilla – Bug 1216370
bcache-status assumes python3 is available as `python` and fails to run
Last modified: 2024-03-01 01:19:25 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
A little more convenient workaround, with a small danger of side effects: ln -s /usr/bin/python3 /usr/local/bin/python
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.