YUM: how to find out groups?

Panu Matilainen pmatilai at welho.com
Wed May 11 14:37:04 UTC 2005


On Wed, 2005-05-11 at 08:17 -0400, Jeff Spaleta wrote:
> On 5/11/05, shrek-m at gmx.de <shrek-m at gmx.de> wrote:
> http://download.fedora.redhat.com/pub/fedora/linux/core/test/3.92/ppc/os/Fedora/RPMS/eruby-1.0.5-5.ppc.rpm
> > | grep Group
> > Group       : Development/Languages         Source RPM:
> > eruby-1.0.5-5.src.rpm
> 
> The group tag in the rpm header is not equilvalent to the comps.xml
> file groupings that anaconda and yum use.  You can't rely on the
> header Group tag to match the groupings in comps.xml at all.  To know
> which comps groups a package is in, you pretty much have to grep
> through the comps.xml file by hand.
> 
> Atleast until someone clever and with some time to kill starts working
> with the upstream yum-devel list to implement a groupmember function
> equivalent.  Or if not acceptable as a contributed patch to of yum,
> then certaintly as a stand-alone cache delving utility like these:
> http://linux.duke.edu/projects/yum/download/misc/

Might as well go to repoquery I guess... which I should work on some
more one of these days :-/

Digging out that information isn't exactly hard :)

[pmatilai at weasel repoquery]$ ./groupmember.py gcc telnet initscripts
telnet: base
initscripts: core
gcc: development-tools

	- Panu -

---
#!/usr/bin/python

import yum
import sys

class yumQuiet(yum.YumBase):
    def log(self, value, msg):
        pass

def main(args):
    my = yumQuiet()
    my.doConfigSetup()
    my.conf.setConfigOption('cache', 1)
    my.doRepoSetup()
    my.doTsSetup()
    my.doGroupSetup()

    for id in my.groupInfo.grouplist:
        for name in args:
            if name in my.groupInfo.allPkgs(id):
                print "%s: %s" % (name, id)

if __name__ == "__main__":
    main(sys.argv[1:])





More information about the fedora-test-list mailing list