[packagekit] Time to search for a file in the yum backend

Tim Lauridsen tim.lauridsen at googlemail.com
Thu Jan 31 22:27:47 PST 2008


Richard Hughes wrote:
> It seems to take a long time to search for a file in the yum backend:
> 
> [hughsie at hughsie-laptop PackageKit]$ time rpm -qf /usr/share/applications/gnome-ekiga.desktop
> ekiga-2.0.11-1.fc8
> 
> real    0m0.091s
> user    0m0.026s
> sys     0m0.005s
> [hughsie at hughsie-laptop PackageKit]$ pkcon search file /usr/share/applications/gnome-ekiga.desktop
> installed    ekiga                i386    2.0.11-1.fc8    installed    A Gnome based SIP/H323 teleconferencing application              
> search-file runtime was 73.0 seconds
> 
> Surely we can just check the rpmdb before we check the repos? checking
> the rpmdb ~ 1 second, checking using yum takes over 1 minute.
> 
> Thanks.
> 
> Richard.
> 
> 
> _______________________________________________
> PackageKit mailing list
> PackageKit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/packagekit

try to run
sudo ./search-file.py none /usr/share/applications/gnome-ekiga.desktop
in the yum helper dir.
The you will see what is going on.
the install pkg will be signaled pretty fast, and if metadata is upto 
date, the the available pkg will be returned in a couple of sec, but the 
the search continues for a while before completing.

It sucks, it is done in a very basic way.

for pkg in all_pkg:
     for f in pkg.filelist:
	if f == match:
	    signal pkg

This it not the fastest way in the world :)

It shall be remade to use some of the yum provide command it will be 
much faster. I give it a try.

Tim



More information about the PackageKit mailing list