[packagekit] Seporating the obsoletes and updates

Patryk Zawadzki patrys at pld-linux.org
Wed May 28 07:38:05 PDT 2008


On Wed, May 28, 2008 at 4:06 PM, Richard Hughes <hughsient at gmail.com> wrote:
> This is the code we use in yumBackend.py

    def _foo(self, list):
        return '^'.join([self._pkg_to_id(x) for x in list])

>    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)
               pkgs =  self.yumbase.rpmdb.searchPkgTuple(installed)
               return self._foo(pkgs)
>        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])
           return self._foo(pkgs)
>        else:
>            return ""

> 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.

Here you go, not sure if that's the solution you were looking for.

-- 
Patryk Zawadzki
PLD Linux Distribution



More information about the PackageKit mailing list