Feature or bug? (strange?) yum behaviour
seth vidal
skvidal at fedoraproject.org
Tue Apr 1 20:44:11 UTC 2008
On Tue, 2008-04-01 at 16:31 -0400, David Mansfield wrote:
> On F8:
>
> [root at localhost ~]# time rpm -q gimp
> gimp-2.4.4-1.fc8
>
> real 0m0.102s
> user 0m0.032s
> sys 0m0.008s
>
> [root at localhost ~]# time yum -C list installed gimp
> Installed Packages
> gimp.i386 2:2.4.4-1.fc8
> installed
>
> real 0m3.450s
> user 0m2.829s
> sys 0m0.394s
>
> As you can see, it's about the same on my machine.
on rawhide:
time rpm -q gimp
gimp-2.4.5-1.fc9.i386
real 0m0.222s
user 0m0.093s
sys 0m0.024s
time yum -C list installed gimp
Installed Packages
gimp.i386 2:2.4.5-1.fc9
installed
real 0m1.835s
user 0m1.468s
sys 0m0.181s
Remember, yum isn't just executing a one call, it is doing A LOT more
than rpm does.
However, doing it in 1.8s seems pretty reasonable to me.
And that's a pentium M speedstepped to 600mhz.
here, I'll write a script that does just what rpm -q does using the yum
modules:
import yum
my = yum.YumBase()
for p in my.rpmdb.searchNevra(name='gimp'):
print p
time python foo.py
2:gimp-2.4.5-1.fc9.i386
real 0m0.711s
user 0m0.533s
sys 0m0.046s
Of course that's not parsing any arguments, checking for any excludes
or any other config a user may have set.
Here I'll do it direct to the rpm python bindings:
import rpm
ts = rpm.TransactionSet()
mi = ts.dbMatch('name', 'gimp')
for h in mi:
print '%s-%s-%s.%s' % (h['name'], h['version'], h['release'],
h['arch'])
time python foo.py
gimp-2.4.5-1.fc9.i386
real 0m0.358s
user 0m0.136s
sys 0m0.024s
Again - no parsing, no handling of all the oddball stuff that rpm spits
back at you, and no integration with the rest of the interfaces we have
to deal with.
-sv
More information about the fedora-devel-list
mailing list