Bug 570615 - RFE: make yum.rpmsack.RPMInstalledPackage subscriptable
Summary: RFE: make yum.rpmsack.RPMInstalledPackage subscriptable
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: yum
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Seth Vidal
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-03-04 21:13 UTC by Till Maas
Modified: 2014-01-21 23:13 UTC (History)
6 users (show)

Fixed In Version: yum-3.2.27-1.fc12
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-03-13 02:24:22 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.