[packagekit] Seporating the obsoletes and updates

Tim Lauridsen tim.lauridsen at googlemail.com
Wed May 28 11:50:05 PDT 2008


Richard Hughes wrote:
> This is the code we use in yumBackend.py
> 
>     def _get_obsoleted(self,name):
>         obsoletes = self.yumbase.up.getObsoletesTuples(newest=1)
>         for (obsoleting,installed) in obsoletes:
>             if obsoleting[0] == name:
>                 pkg =  self.yumbase.rpmdb.searchPkgTuple(installed)[0]
>                 return self._pkg_to_id(pkg)
>         return ""
> 
>     def _get_updated(self,pkg):
>         updated = None
>         pkgs = self.yumbase.rpmdb.searchNevra(name=pkg.name)
>         if pkgs:
>             return self._pkg_to_id(pkgs[0])
>         else:
>             return ""
> 
> We need to return the list delimited with "^". In 0.3.x we'll switch
> obsoletes and updates to be a proper 'as' (rather than 's') types, but I
> don't want to break API in 0.2.x again for just this reason.
> 
> Robin/Luke/Tim, could you fix up that yum and yum2 code to do the right
> thing pls, and I'll patch the daemon and client tools.
> 
> Thanks.
> 
> Richard
> 
> 
> _______________________________________________
> PackageKit mailing list
> PackageKit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/packagekit

I am not sure i understand what you what.
get_updated return the installed package there is getting updated (There 
can only be on)
get_obsoleted return a installed package being replaced by a package 
with another name. There can more than one package here, do you want it 
to return pkg_id1^pkgid_id2 ?
Patryk's code should do it, _foo needs a better name :)

Tim


More information about the PackageKit mailing list