[Yum] how to query the subpackages represented by a meta-package?
James Antill
james-yum at and.org
Tue Apr 7 20:09:18 UTC 2009
"Robert P. J. Day" <rpjday at crashcourse.ca> 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 -- james at and.org
More information about the Yum
mailing list