From 39ded460e62b38efa26ec665d48e661f7d425a80 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Fri, 26 Mar 2010 13:20:17 +0200 Subject: [PATCH] Change the problem data arrangement for dependency problems - pkgNEVR in problems is now always the NEVR of the transaction element triggering the problem, and altNEVR is the other affected package, dependency string is stored in the problem string attribute - no user visible changed, except for somebody crazy enough to try to do something other than print the problem message strings - we wouldn't really need to strdup() the pkgNEVR in problems now, but leaving that alone for the moment... --- lib/rpmprob.c | 12 ++++++------ lib/rpmte.c | 4 ++-- python/rpm/transaction.py | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/rpmprob.c b/lib/rpmprob.c index 225e4b9..5412ca7 100644 --- a/lib/rpmprob.c +++ b/lib/rpmprob.c @@ -158,18 +158,18 @@ char * rpmProblemString(rpmProblem prob) break; case RPMPROB_REQUIRES: rc = rasprintf(&buf, _("%s is needed by %s%s"), - altNEVR+2, - (prob->num1 ? "" : _("(installed) ")), pkgNEVR); + prob->str1, + (prob->num1 ? "" : _("(installed) ")), altNEVR); break; case RPMPROB_CONFLICT: rc = rasprintf(&buf, _("%s conflicts with %s%s"), - altNEVR+2, - (prob->num1 ? "" : _("(installed) ")), pkgNEVR); + prob->str1, + (prob->num1 ? "" : _("(installed) ")), altNEVR); break; case RPMPROB_OBSOLETES: rc = rasprintf(&buf, _("%s is obsoleted by %s%s"), - altNEVR+2, - (prob->num1 ? "" : _("(installed) ")), pkgNEVR); + prob->str1, + (prob->num1 ? "" : _("(installed) ")), altNEVR); break; default: rc = rasprintf(&buf, diff --git a/lib/rpmte.c b/lib/rpmte.c index 10e9bee..43d42ac 100644 --- a/lib/rpmte.c +++ b/lib/rpmte.c @@ -749,7 +749,7 @@ void rpmteAddProblem(rpmte te, rpmProblemType type, } } -void rpmteAddDepProblem(rpmte te, const char * pkgNEVR, rpmds ds, +void rpmteAddDepProblem(rpmte te, const char * altNEVR, rpmds ds, fnpyKey * suggestedKeys, int adding) { if (te != NULL) { @@ -764,7 +764,7 @@ void rpmteAddDepProblem(rpmte te, const char * pkgNEVR, rpmds ds, case 'R': type = RPMPROB_REQUIRES; break; } - appendProblem(te, type, pkgNEVR, key, DNEVR, NULL, adding); + appendProblem(te, type, rpmteNEVRA(te), key, altNEVR, DNEVR+2, adding); } } diff --git a/python/rpm/transaction.py b/python/rpm/transaction.py index ba8c5b0..0e4272d 100644 --- a/python/rpm/transaction.py +++ b/python/rpm/transaction.py @@ -113,11 +113,11 @@ class TransactionSet(_rpmts): continue # strip arch, split to name, version, release - nevr = p.pkgNEVR.rsplit('.', 1)[0] + nevr = p.altNEVR.rsplit('.', 1)[0] n, v, r = nevr.rsplit('-', 2) # extract the dependency information - needs = p.altNEVR.split()[1:] + needs = p._str.split()[1:] needname = needs[0] needflags = rpm.RPMSENSE_ANY if len(needs) == 3: -- 2.7.4