[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

oops: a letter to the rpm dev team:



Ok,
	This morning I was thoughter than I drunk (burp!)
I did manage to cover #1 (which is the harder part; seeing
as #2 is probably just a #define and an if (flag...) ).

the end result is something like this:

	
typedef struct {
    pkgStage goal;  // what we're we trying to do ?
    pkgStage root;  // what was the lowest-level "stage" that caused the
error ?
} psmErrPair;



if ((rc = rpmtsRun(ts)) > 0) {
    register int i = -1;    
    psmErrPair **errs = ts->accum_errs;
    if (errs) {
        while (errs[++i]) {
    	    errcode((errs[i])->goal, errs[i]->root);
        }
    }
}


So programaticly I can know what happend without
parsing stdout :)

if (err->goal == PSM_PKGINSTALL && 
    err->root == PSM_SCRIPT) {
	error = not so bad.... if I'm reverting
	to a version before an erronous upgrade.
}



I'm going to play around with this this weekend;
If anyone can hear me... I can be reached 
at scrabble@users.sf.net on the weekend.
still hopeing to get some feedback.

Cheers all!
		-Tristan



Tristan Van Berkom wrote:
> 
> Good morning everyone!
> 
>         Its me again; my automatic software updater
> is almost rock solid. There is just one or two
> problems that I have that logicly shouldn't be
> or can't be fixed outside librpm.
> 
>         I'm going to lunch and then after that
> I'll make theese changes (this could take me 15 min.
> or it could take me an hour or two to do it *well*).
> My boss might tell me otherwise but I'm prepared
> to spend an extra hour or two on this if you
> are interested in the changes I'll make and/or have
> opinions on how to proceed.
> 
>         1. when rpmtsRun() returns `-1' I have no
>         clue as to why. (prescript ? opendb ? install ? post ?...)
> 
>         2. unless I construct my own loop and create
>         single no-dep transactions; librpm will continue
>         to execute transactions after one or more have failed.
> 
> I am proceeding to work around #1 right now in
> transactions.c/psm.c (so at least I know that
> the failure was due to a post/pre[un]install script).
> I'm thinking of going with something like
> rpmSetErrorCode(REASON) method.
> 
> And as for #2, I was thinking of adding a
> `transaction' flag that would mean in effect
>         RPMTRANS_QUIT_ON_FIRST_ERROR
> (not sure if it should look more like
> PROBFILTER_CONTINUE_ON_ERRORS but that
> would take alot more effort for a little
> more logic/readability).
> 
> Cheers all,
>                 -Tristan
> 
> _______________________________________________
> Rpm-list mailing list
> Rpm-list@redhat.com
> https://listman.redhat.com/mailman/listinfo/rpm-list





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []