diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2010-03-12 19:41:10 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2010-03-12 19:46:06 +0200 |
commit | e696b409fe836bf39cbf639bac4321d658d0952d (patch) | |
tree | ebfa62f8ecfacd82aaefa0c7aa87cf007c5a23f2 /lib/rpmts.c | |
parent | 1d98830819727c385731ef6fafcaa6f3ba5cf216 (diff) | |
download | rpm-e696b409fe836bf39cbf639bac4321d658d0952d.tar.gz rpm-e696b409fe836bf39cbf639bac4321d658d0952d.tar.bz2 rpm-e696b409fe836bf39cbf639bac4321d658d0952d.zip |
Record problems into the transaction elements causing them
- Any problem found in transaction processing is caused, or at least
triggered by, some transaction element. Having the problems in
elements lets API users easily determine which package caused which
problem instead of having to parse problem strings in vain.
- No problem set stored in transaction set itself now, rpmtsProblems() API p
reserved by making it collect problems from our transaction elements
into a new set. The problem set fiddling in rpmtsRun() wrt %pretrans
and all is a bit crazy - always was, now its just more visible...
- Make rpmtsCheck() pass the associated transaction elements into
the lower level functions. rpmdsProblem() removed from API, it's
not particularly useful outside rpmtsCheck() internals.
- rpmts struct is now opaque within depends.c except for solve callback
- This breaks --badreloc, need to figure out something saner for the
problem filtering
Diffstat (limited to 'lib/rpmts.c')
-rw-r--r-- | lib/rpmts.c | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/lib/rpmts.c b/lib/rpmts.c index 1c4bc1779..c9e63cad4 100644 --- a/lib/rpmts.c +++ b/lib/rpmts.c @@ -476,19 +476,34 @@ int rpmtsSetSolveCallback(rpmts ts, rpmps rpmtsProblems(rpmts ts) { - rpmps ps = NULL; - if (ts) { - if (ts->probs) - ps = rpmpsLink(ts->probs, RPMDBG_M("rpmtsProblems")); + rpmps ps = rpmpsCreate(); + rpmtsi pi = rpmtsiInit(ts); + rpmte p; + + /* XXX TODO this cries for rpmpsMerge() */ + while ((p = rpmtsiNext(pi, 0)) != NULL) { + rpmps teprobs = rpmteProblems(p); + if (teprobs) { + rpmpsi psi = rpmpsInitIterator(teprobs); + while (rpmpsNextIterator(psi) >= 0) { + rpmProblem prob = rpmpsGetProblem(psi); + rpmpsAppendProblem(ps, prob); + } + rpmpsFreeIterator(psi); + rpmpsFree(teprobs); + } } + pi = rpmtsiFree(pi); return ps; } void rpmtsCleanProblems(rpmts ts) { - if (ts && ts->probs) { - ts->probs = rpmpsFree(ts->probs); - } + rpmte p; + rpmtsi pi = rpmtsiInit(ts); + while ((p = rpmtsiNext(pi, 0)) != NULL) + rpmteCleanProblems(p); + pi = rpmtsiFree(pi); } void rpmtsClean(rpmts ts) @@ -921,8 +936,6 @@ rpmts rpmtsCreate(void) ts->selinuxEnabled = is_selinux_enabled(); - ts->probs = NULL; - ts->keyring = NULL; ts->nrefs = 0; |