Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 573030 - app-portage/gentoolkit: equery meta GLEP 67 support
Summary: app-portage/gentoolkit: equery meta GLEP 67 support
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-26 17:04 UTC by Paul Varner (RETIRED)
Modified: 2022-07-10 23:10 UTC (History)
2 users (show)

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 Paul Varner (RETIRED) gentoo-dev 2016-01-26 17:04:20 UTC
equery meta needs to be updated to process projects and not herds in accordance with GLEP 67
Comment 1 Patrick Lauer gentoo-dev 2016-02-11 18:55:21 UTC
A local patch I hacked up that might do the trick:

--- /usr/lib64/python2.7/site-packages/gentoolkit/metadata.py   2012-12-20 11:43:22.000000000 +0000
+++ gentoolkit-fix      2016-02-11 18:50:58.743441714 +0000
@@ -229,7 +229,7 @@
                """
 
                result = []
-               for elem in self._xml_tree.findall('herd'):
+               for elem in self._xml_tree.findall("./maintainer/[@type='project']"):
                        text = elem.text
                        if text is None:
                                text = ''
@@ -267,7 +267,7 @@
                        return self._maintainers
 
                self._maintainers = []
-               for node in self._xml_tree.findall('maintainer'):
+               for node in self._xml_tree.findall("./maintainer/[@type='person']"):
                        self._maintainers.append(_Maintainer(node))
 
                return self._maintainers
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-02-12 19:53:27 UTC
Any reason not to reuse portage.xml.metadata module?
Comment 3 Paul Varner (RETIRED) gentoo-dev 2016-02-12 21:05:02 UTC
(In reply to Michał Górny from comment #2)
> Any reason not to reuse portage.xml.metadata module?

I recall that the original intent was to use portage.xml.metadata, but at the time it didn't do everything that was needed. It is probably time to re-look at it.
Comment 4 Brian Dolbec (RETIRED) gentoo-dev 2016-02-13 03:42:06 UTC
Actually the portage.xml.metadata routines came from gentoolkit (compare the code, I think Zac has made a few minor changes to it from the original gentoolkit code).  We intended to migrate to it instead as that way it is only one location to edit.

But we haven't seemed to get "a round To-It" ;)

So go ahead and update portage's code and have gentoolkit use it.
Comment 5 Brian Dolbec (RETIRED) gentoo-dev 2022-07-10 07:53:06 UTC
Portage's metadata handling code still references herds.xml instead of projects.xml.

I've migrated equery to use portage's MetaDataXML class, passing it the projects.xml filepath instead of the herds.xml like emerge code still does.  But this does not affect maintainer listings as the needed info is already listed in metadata.xml.

I plan to add a projects listing capability at some future date.
Comment 6 Larry the Git Cow gentoo-dev 2022-07-10 07:53:34 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=eb9a4d026ef453e392faff35925537bee74c9d80

commit eb9a4d026ef453e392faff35925537bee74c9d80
Author:     Brian Dolbec <dolsen@gentoo.org>
AuthorDate: 2022-07-10 07:45:34 +0000
Commit:     Brian Dolbec <dolsen@gentoo.org>
CommitDate: 2022-07-10 07:49:28 +0000

    equery meta: Migrate to portage's MetadataXML class
    
    Portage's metadata handling code was originally ported from gentoolkit.
    Finally get around to migrating, eliminating duplicate code.
    
    Bug: https://bugs.gentoo.org/573030
    Signed-off-by: Brian Dolbec <dolsen@gentoo.org>

 pym/gentoolkit/metadata.py | 256 ---------------------------------------------
 pym/gentoolkit/package.py  |  10 +-
 2 files changed, 7 insertions(+), 259 deletions(-)