FS#58476 - [libsmbios] Python imports are pointing to wrong directory

Attached to Project: Arch Linux
Opened by David White (dwhite54) - Sunday, 06 May 2018, 19:38 GMT
Last edited by Jan de Groot (JGC) - Tuesday, 25 October 2022, 09:59 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Jan de Groot (JGC)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
Python imports broken for all smbios-* commands in /usr/bin

After changing these two lines in each smbios-* command, things are fixed:

old:
pythondir=os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), "..", "python")
clidir=os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), "..", "py-cli")

new:
pythondir=os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), "../share/smbios-utils")
clidir=os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), "../share/smbios-utils")


Additional info:
* package version: latest
* config: default

Steps to reproduce:
$ pacman -S libsmbios
$ smbios-sys-info
Traceback (most recent call last):
File "/usr/bin/smbios-token-ctl", line 36, in <module>
import cli
ModuleNotFoundError: No module named 'cli'
This task depends upon

Closed by  Jan de Groot (JGC)
Tuesday, 25 October 2022, 09:59 GMT
Reason for closing:  Fixed
Additional comments about closing:  Should work ok in current version.
Comment by David White (dwhite54) - Sunday, 06 May 2018, 19:41 GMT
First bug and I already messed up...is there a way to edit the summary after the bug report is created?
Or, if this must be done by someone else, please change the summary to "Python imports are pointing to wrong directory."
I would also be happy to change "package version" to "2.4.1-1"
Comment by deusstultus (deusstultus) - Sunday, 06 May 2018, 21:16 GMT
This was a bad build, substitutions did not occur for path or versions in these files. Bump pkgrel++ and rebuild should fix this. Tested on fresh chroot build date of post -10minutes.
Comment by David White (dwhite54) - Sunday, 06 May 2018, 22:06 GMT
That worked! Thanks.

Loading...