[packagekit] yum2 error fixes

Robin Norwood rnorwood at redhat.com
Fri Feb 15 14:22:25 PST 2008


On Fri, 15 Feb 2008 15:42:15 -0500
Robin Norwood <rnorwood at redhat.com> wrote:

> On Fri, 15 Feb 2008 20:30:32 +0100
> Tim Lauridsen <tim.lauridsen at googlemail.com> wrote:
> 
> > Robin Norwood wrote:
> > > o Is 'yum cache invalid' a correct description for any RepoError,
> > > or are there other error cases that throw RepoErrors?
> > > 
> > 
> > RepoError is raised, if there is something wrong with metadate, i 
> > cacheonly mode, then it is because some need metadata is missing.
> > There is some other cases when not in cacheonly mode, but this is
> > thing we cant solve any way. (Ex. bad configuration i .repo files)
> > 
> > > o Is there anything we can do inside PK to recover from this?
> > 
> > We can refreshcache and try again.
> 
> Ok.  That takes almost a minute on my system.  What's the best way to
> notify the engine so the user
> 
>         except yum.Errors.RepoError,e:
>             self.ErrorCode(ERROR_NO_CACHE,"Yum cache is invalid.
> Rebuilding.") self.Finished(EXIT_FAILED)
>             self.StatusChanged(STATUS_WAIT)
>             self._refresh_yum_cache()
>             return

Actually, it's probably better to send the ErrorCode, set
StatusChanged(STATUS_REFRESH_CACHE), refresh the cache, then call
Finished, and Finally exit.

Which is what I've done in change
5ee5983f3adbea2b1c76c765a3e255d5ef9add3c

Next, I'll look into not Exit-ing the daemon after we do this.

-RN

-- 
Robin Norwood
Red Hat, Inc.

"The Sage does nothing, yet nothing remains undone."
-Lao Tzu, Te Tao Ching



More information about the PackageKit mailing list