[packagekit] 'native' search filter

Anders F Björklund afb at algonet.se
Mon Sep 13 01:52:10 PDT 2010


Richard Hughes wrote:

> At the moment, we define the 'native' filter as "only return packages
> in the computer native architecture" -- this ensures that users don't
> "find" i386 packages on x64 and download a *ton* of library deps just
> to install them.
>
> This resulted in a RHEL bug, where users on x64 were searching for
> acroread and the binary flash player and getting no results. It was
> suggested we change the semantics to be: "only return packages in the
> computer native architecture when a native architecture package
> exists"

Like: if the arch ("native") filter doesn't return any results, then
try again and refilter using some other ad-hoc criteria instead... ?

     def _samearch(self, arch1, arch2):
         if arch1 == arch2:
             return True
         if arch1 == 'noarch' or arch2 == 'noarch':
             return True
         x86 = re.compile(r'i[3456]86')
         if x86.search(arch1) and x86.search(arch2):
             return True
         # <--- new custom logic would go here
         return False


Would this be done on the frontend/client, or is it something for
backends to worry about. Does it apply to other searches as well ?

"No free software found, trying with non-free too". (and so on)


It's doable when package names match. It's worse when they don't.
(that would be for the "native architecture package exist" thing)

Some packages are renamed, like with a "32" or "64" suffix or so.
So it would need some heuristics like that, for the extra search.

--anders




More information about the PackageKit mailing list