Re: how to query the subpackages represented by a meta-package?

James Antill <[email protected]>
Newsgroups gmane.linux.rpm.yum
Message-ID <[email protected]>
"Robert P. J. Day" <[email protected]> writes:

>   what's the incantation to query the subpackages represented by a
> meta package?  for example, "qemu", which would end up installing a
> number of individual qemu-related package.  thanks.

 As Seth says, you can look at the deps., which is the answer you
asked for. But maybe what you really want is "list of pkgs coming
from a source rpm".
 Which we don't have a pre-built command to do, but this works:

% cat /tmp/list-source.py
#! /usr/bin/python -tt

import sys
import yum

yb = yum.YumBase()

ret = {}
for pkg in yb.pkgSack.returnPackages(patterns=sys.argv[1:]):
    ret[pkg.sourcerpm] = []
for pkg in yb.pkgSack:
    if pkg.sourcerpm in ret:
        ret[pkg.sourcerpm].append(pkg)
for srcrpm in ret:
    ret[srcrpm].sort()
for srcrpm in sorted(ret, key=lambda x: ret[x][-1]):
    print srcrpm
    for pkg in ret[srcrpm]:
        print " " * 3, pkg

% /tmp/list-source.py qemu
Loaded plugins: Avahi, auto-update-debuginfo
qemu-0.9.1-10.fc10.src.rpm
    qemu-0.9.1-10.fc10.x86_64
    qemu-img-0.9.1-10.fc10.x86_64


-- 
James Antill -- [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.