Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 136932 - [PATCH] migrate emerge internals into the portage api
Summary: [PATCH] migrate emerge internals into the portage api
Status: CONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Enhancement/Feature Requests (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: PATCH
: 79288 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-06-15 14:41 UTC by David-John Miller
Modified: 2023-03-08 05:02 UTC (History)
1 user (show)

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


Attachments
Proposed patch (emerge.patch,97.51 KB, patch)
2006-06-16 09:08 UTC, David-John Miller
Details | Diff
Proposed solution 2 (emerge.patch,99.09 KB, patch)
2006-06-16 11:45 UTC, David-John Miller
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David-John Miller 2006-06-15 14:41:05 UTC
I've been playing around with the emerge script, specifically looking to use the features that are included in the script, such as the package depgraph creation

In the emerge script itself there is a depgraph class which does this with relative accuracy (as it is able to use the empty-tree option)

in the past with an older portage, NOTE: MUCH OLDER PORTAGE, i was able to import the emerge script and use it like a normal python class, which doesn't work in python: (import imp; imp.load_source('emerge', '/usr/lib/portage/bin/emerge') ) which allowed this behaviour.

I was wondering if the depgraph creation should be moved into the portage so that 3rd party tools can also make use of the depgraph generator emerge uses, or would this be a silly request?

Thanks
Comment 1 solar (RETIRED) gentoo-dev 2006-06-15 14:51:41 UTC
Yes it should be moved out of the emerge.. 
patches welcome!
Comment 2 Zac Medico gentoo-dev 2006-06-15 15:21:02 UTC
Ideally, the bulk of the code in emerge would be accessible via the portage api.  We just haven't gotten around to cleaning it all up yet.  Last year I refactored emerge from the (new dead) 2.1-experimental branch:

http://dev.gentoo.org/~zmedico/portage/branches/2.1-experimental/bin/emerge

I've been thinking about doing it again for current 2.1 and then migrating pieces into the portage api.
Comment 3 David-John Miller 2006-06-16 09:08:25 UTC
Created attachment 89319 [details, diff]
Proposed patch

patch against:
# emerge -V
Portage 2.1 (default-linux/amd64/2006.0, gcc-3.4.4, glibc-2.3.5-r2, 2.6.16-gentoo-r9 x86_64)

This is my first-attempt, it works as far as i've tested (which isn't much, cause my linux is broken)

Hope more can be stripped from emerge in the future!
Comment 4 David-John Miller 2006-06-16 11:45:53 UTC
Created attachment 89325 [details, diff]
Proposed solution 2

Ok, after much testing breaking and finally getting things to emerge (like pychecker), and finally running pychecker, i've discovered a few fucntions and classes that depgraph relies on!

Emerge needs a bot more refactoring work before this class can be set free, but the basics of pulling it out are here (hopefully)

Also had a bit of a mission finding "syslist" which seems to only be defined in special cases, pulling it out might have broken other features of emerge which i have not been able to test, also myopts and myparams seem to be used throughout the script and are NOT passed to the depgraph object, the few cases have been make to use an internal representation of it (self.myparams and self.myopts), myfavorites is also a problem here, because it's also only created in certain cases!

I think i need to find a few portage Devs to help unravel these objects
Comment 5 Marius Mauch (RETIRED) gentoo-dev 2008-03-02 16:23:47 UTC
*** Bug 79288 has been marked as a duplicate of this bug. ***