Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 48915 - cpuspeedy fails to find it's own modules
Summary: cpuspeedy fails to find it's own modules
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High major (vote)
Assignee: Daniel Black (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-24 23:17 UTC by Priit Laes (IRC: plaes)
Modified: 2004-04-26 05:52 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Priit Laes (IRC: plaes) 2004-04-24 23:17:36 UTC
When trying to execute cpuspeedy:

decoder root # cpuspeedy
Traceback (most recent call last):
  File "/usr/sbin/cpuspeedy", line 25, in ?
    import pycpufreq,messages,errors
ImportError: No module named pycpufreq


Reproducible: Always
Steps to Reproduce:

Actual Results:  
Here is the list of cpuspeedy files:

decoder root # qpkg -l cpuspeedy
sys-apps/cpuspeedy-0.3.0 *
CONTENTS:
/usr
/usr/lib
/usr/lib/cpuspeedy
/usr/lib/cpuspeedy/pycpufreq_sysfs.py
/usr/lib/cpuspeedy/messages.py
/usr/lib/cpuspeedy/pycpufreq.py
/usr/lib/cpuspeedy/pycpufreq_api24.py
/usr/lib/cpuspeedy/pycpufreq_proc.py
/usr/lib/cpuspeedy/errors.py
/usr/man
/usr/man/man1
/usr/man/man1/cpuspeedy.1.gz
/usr/sbin
/usr/sbin/cpuspeedy
/usr/share
/usr/share/doc
/usr/share/doc/cpuspeedy
/usr/share/doc/cpuspeedy/README
/usr/share/doc/cpuspeedy/AUTHORS
/usr/share/doc/cpuspeedy/INSTALL
/usr/share/doc/cpuspeedy/ChangeLog
/usr/share/doc/cpuspeedy/COPYING
Comment 1 Daniel Black (RETIRED) gentoo-dev 2004-04-26 02:26:52 UTC
# strace -fe trace=file -o/dev/stdout  cpuspeedy | fgrep /usr/lib/cpuspeedy 2>&1

13617 stat64("/usr/lib/cpuspeedy", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
13617 stat64("/usr/lib/cpuspeedy/pycpufreq", 0xbfffe710) = -1 ENOENT (No such file or directory)
13617 open("/usr/lib/cpuspeedy/pycpufreq.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
13617 open("/usr/lib/cpuspeedy/pycpufreqmodule.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
13617 open("/usr/lib/cpuspeedy/pycpufreq.py", O_RDONLY|O_LARGEFILE) = 3
13617 open("/usr/lib/cpuspeedy/pycpufreq.pyc", O_RDONLY|O_LARGEFILE) = 4
13617 stat64("/usr/lib/cpuspeedy/errors", 0xbfffd720) = -1 ENOENT (No such file or directory)
13617 open("/usr/lib/cpuspeedy/errors.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
13617 open("/usr/lib/cpuspeedy/errorsmodule.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
13617 open("/usr/lib/cpuspeedy/errors.py", O_RDONLY|O_LARGEFILE) = 4
13617 open("/usr/lib/cpuspeedy/errors.pyc", O_RDONLY|O_LARGEFILE) = 5
13617 stat64("/usr/lib/cpuspeedy/messages", 0xbfffe710) = -1 ENOENT (No such file or directory)
13617 open("/usr/lib/cpuspeedy/messages.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
13617 open("/usr/lib/cpuspeedy/messagesmodule.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
13617 open("/usr/lib/cpuspeedy/messages.py", O_RDONLY|O_LARGEFILE) = 3
13617 open("/usr/lib/cpuspeedy/messages.pyc", O_RDONLY|O_LARGEFILE) = 4
^^^^^ seems to be finding the modules ^^^^^^^^^

I've got the same file list as you

python -V
Python 2.3.3

Does the /usr/sbin/cpuspeed contain:

sys.path=[os.curdir,'/usr/lib/cpuspeedy']+sys.path
up the top?

File permissions?

I'm out of guesses at this point.

Note to self:
/usr/share/doc/cpuspeed should be /usr/share/doc/cpuspeedy-${PV}
Comment 2 Priit Laes (IRC: plaes) 2004-04-26 03:27:07 UTC
Hm.. /usr/sbin/cpuspeedy contains:
sys.path=[os.curdir,'/home/root/tmp/portage/cpuspeedy-0.3.0/image//usr/lib/cpuspeedy']+sys.path
Comment 3 Priit Laes (IRC: plaes) 2004-04-26 03:29:38 UTC
The problem is in this line in ebuild:
sed -i -e 's:/var/tmp/portage/cpuspeedy-0.3.0/image/::' ${D}/usr/sbin/cpuspeedy

This shouldn't be hardcoded, because I have PORTAGE_TMPDIR changed...
Comment 4 Priit Laes (IRC: plaes) 2004-04-26 03:36:53 UTC
Change this line to - works for me :D
sed -i -e "s:${D}::" ${D}/usr/sbin/cpuspeedy
Comment 5 Daniel Black (RETIRED) gentoo-dev 2004-04-26 05:52:49 UTC
fantastic - thankyou - change commited.