[packagekit] yum: detecting file conflicts and using a custom error

Robin Norwood rnorwood at redhat.com
Tue Apr 15 06:02:48 PDT 2008


On Tue, 15 Apr 2008 10:16:41 +0200
Tim Lauridsen <tim.lauridsen at googlemail.com> wrote:

> Richard Hughes wrote:
> > On Mon, 2008-04-14 at 15:48 +0200, Tim Lauridsen wrote:
> >> Not in this case, yum call rpm to test a transaction and rpm
> >> returns a return code and a list of errors, if there is an error
> >> then yum raises a exception with the list of errors generated by
> >> rpm. It didn't knows what kind of errors it is.
> > 
> > Well, we need to parse the proper error types in a fine grained
> > way, see below.
> > 
> >> I don't know all the errors rpm can return in this case, starting
> >> to parse the string, really sucks big time and i don't see the
> >> benefit of doing it, we have an error we can't solve, we cant do
> >> any thing else than abort the task.
> > 
> > Well, instead of presenting "unknown error" we can present "There
> > were file conflicts". Now, you might think that's a waste of time,
> > seeing as you can see that in the error details, but if you
> > localise the UI to German, the description becomes some foreign
> > gibberish.
> 
> We can make a speciel error code for error in test transaction. so we 
> can give a sane messages in the UI,  but trying to parse the messages 
> from rpm is doom, it is just like doing screenscraping.
> Test Transaction errors is rare, so it is not worth the effort, you
> have to track down all cases of error that can occur in a rpm
> transaction, by digging into the rpm source code (DOOM) and you have
> to track message changes in the rpm error (DOOM) and if rpm start to
> use localized errors , like we have introduced in yum, then we are
> doomed again.
> 
> We can do something like
> error(ERROR_TRANSACTION_ERROOR,msgs)
> 
> And present it as
> 
> :----------------[ERROR]------------------------:
> : There is error in the transaction ..........  :
> :                                               :
> : Details:                                      :
> :                                               :
> : <rpm error messages>                          :
> :                                               :
> :-----------------------------------------------:
> 
> We can translate the first text but leave the details
> i the original. Like we don't try to translate Tracebacks
> 
> The idea about cut some errors out is very bad idea, rpm transaction 
> error are cause be some packaging errors in the repos, and it make it 
> hard to find the errors and report it, if we not get all the error 
> messages, and it will also be hard for the developers/packagers to
> see what is wrong if the error messages is translated to Japanese.

This agrees with my impression, too - I can add the new
TRANSACTION_ERROR if we want to go that way.

-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