After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 318225 - program is unusable for Gentoo users
program is unusable for Gentoo users
Status: RESOLVED FIXED
Product: dogtail
Classification: Deprecated
Component: Framework
CVS HEAD
Other All
: Normal major
: ---
Assigned To: Dogtail Maintainers
Dogtail Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-10-07 17:20 UTC by Brent Smith (smitten)
Modified: 2005-10-07 23:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
hack to let it work for gentoo users (1.48 KB, patch)
2005-10-07 17:23 UTC, Brent Smith (smitten)
none Details | Review
patch to get version numbers from portage (3.04 KB, patch)
2005-10-07 23:26 UTC, Brent Smith (smitten)
none Details | Review
changed the erroneous import sys.path to import sys (3.04 KB, patch)
2005-10-07 23:31 UTC, Brent Smith (smitten)
committed Details | Review

Description Brent Smith (smitten) 2005-10-07 17:20:11 UTC
Please describe the problem:
The distro.py script doesn't have an implementation of packageDb for gentoo users.

Since emerge/portage is python based it shouldn't be too hard to cook up a patch
to get the version number of a currently installed application.  I'll look into it.

Steps to reproduce:
1. install dogtail on gentoo and try to run one of example scripts

Actual results:
Stacktrace that says "Gentoo is not supported. Send patches to bugzilla"

Expected results:


Does this happen every time?
yes

Other information:
Comment 1 Brent Smith (smitten) 2005-10-07 17:23:46 UTC
Created attachment 53190 [details] [review]
hack to let it work for gentoo users

This is just a hack to let the examples run anyway without support for gentoo
Comment 2 Brent Smith (smitten) 2005-10-07 17:27:16 UTC
It seems that importing the portage module and using the following syntax
will get you the distribution specific version number for a package in gentoo.

smitten@home /usr/lib/portage/pym $ python
Python 2.4.1 (#1, Jul 13 2005, 18:58:56)
[GCC 3.3.5-20050130 (Gentoo 3.3.5.20050130-r1, ssp-3.3.5.20050130-1, pie-8.7.7.
on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path.append ('/usr/lib/portage/pym')
>>> sys.path
['', '/usr/lib/portage/pym', '/opt/gnome2/lib/python24.zip',
'/opt/gnome2/lib/python2.4', '/opt/gnome2/lib/python2.4/plat-linux2',
'/opt/gnome2/lib/python2.4/lib-tk', '/opt/gnome2/lib/python2.4/lib-dynload',
'/opt/gnome2/lib/python2.4/site-packages',
'/opt/gnome2/lib/python2.4/site-packages/dbus',
'/opt/gnome2/lib/python2.4/site-packages/gtk-2.0', '/usr/lib/portage/pym']
>>> import portage
>>> portage.db["/"]["vartree"].dbapi.match("mail-client/mozilla-thunderbird")
['mail-client/mozilla-thunderbird-1.0.6-r4']
>>>
Comment 3 Brent Smith (smitten) 2005-10-07 23:26:39 UTC
Created attachment 53212 [details] [review]
patch to get version numbers from portage

This uses the portage module to get the version number for a packageName.  The
only caveat here is that in the case of slotted packages (i.e. autoconf), it
gets
the version of the first package returned in the list.	Not sure how to make
this better.
Comment 4 Brent Smith (smitten) 2005-10-07 23:31:32 UTC
Created attachment 53213 [details] [review]
changed the erroneous import sys.path to import sys
Comment 5 Zack Cerza 2005-10-07 23:38:05 UTC
Committed.