Bug 570615

Summary: RFE: make yum.rpmsack.RPMInstalledPackage subscriptable
Product: [Fedora] Fedora Reporter: Till Maas <opensource>
Component: yumAssignee: Seth Vidal <skvidal>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: ffesti, james.antill, maxamillion, opensource, pmatilai, tim.lauridsen
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: yum-3.2.27-1.fc12 Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-03-13 02:24:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Till Maas 2010-03-04 21:13:33 UTC
Description of problem:

I would like to have this work:
my = yum.YumBase()
pkg = my.rpmdb.returnPackages()[0]
print "%(name)s-%(version)s-%(release)s.%(arch)s.rpm" % pkg

It only requires a __getitem__ function like this:
yum.rpmsack.RPMInstalledPackage.__getitem__ = lambda self, key: getattr(self, key)

Comment 1 James Antill 2010-03-05 00:05:16 UTC
 We might well make that work, for both installed/available packages however note that you can do:

print "%(name)s-%(version)s-%(release)s.%(arch)s.rpm" % pkg.__dict__

...which has probably worked for a long time.

Comment 2 Fedora Update System 2010-03-11 15:27:14 UTC
yum-3.2.26-6.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/yum-3.2.26-6.fc13

Comment 3 Fedora Update System 2010-03-13 02:24:17 UTC
yum-3.2.26-6.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 4 Fedora Update System 2010-03-18 19:02:09 UTC
yum-3.2.27-1.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/yum-3.2.27-1.fc13

Comment 5 Fedora Update System 2010-03-18 19:02:19 UTC
yum-3.2.27-1.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/yum-3.2.27-1.fc12

Comment 6 Fedora Update System 2010-03-23 02:16:09 UTC
yum-3.2.27-1.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.