Hi!
It turns out that calling YumBase.update() from the depsolver in not save -
as Seth already suspected. Problem is that the whole TsInfo infrastructure
doesn't return reliable values of what has been added to the transaction or not.
The current code relies on the list of transaction members that is returned
by YumBase.update(). As a work around this patch switches to monitoring the
size of tsInfo. (Test case is in my gold branch)
The big scale solution would be to fix the TransactionData class. But it is
unclear to me what these methods should return at all. For setting the
dependencies it would be good if they would return the txmbrs that actually
are in the tsInfo (should addUpdate return two?). This could do comparably
easy if .add() would just return the txmbr so .add*() could pass them out.
For methods like update() (and the calling depsolving code) a list of the
new txmbrs would be needed. But may be this should be solved completely
different.
Comments?
Florian
>From 736f6028811014c003ec516e3382671f98c01b8c Mon Sep 17 00:00:00 2001
From: Florian Festi <[EMAIL PROTECTED]>
Date: Wed, 14 Nov 2007 11:08:04 +0100
Subject: [PATCH] Work around unreliable result of .update()
Add test cases that got wrong
---
test/operationstests.py | 19 ++++++++++++++++++-
yum/depsolve.py | 5 +++--
2 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/yum/depsolve.py b/yum/depsolve.py
index cde96f1..7ac563f 100644
--- a/yum/depsolve.py
+++ b/yum/depsolve.py
@@ -491,9 +491,10 @@ class Depsolve(object):
# find the best one
# try updating the already install pkgs
+ length = len(self.tsInfo)
for pkg in provSack.returnNewestByName():
- txmbrs = self.update(name=pkg.name, epoch=pkg.epoch, version=pkg.version, rel=pkg.rel)
- if txmbrs:
+ self.update(name=pkg.name, epoch=pkg.epoch, version=pkg.version, rel=pkg.rel)
+ if len(self.tsInfo) != length:
checkdeps = True
return checkdeps, missingdep
--
1.5.3.3
_______________________________________________
Yum-devel mailing list
[email protected]
https://lists.dulug.duke.edu/mailman/listinfo/yum-devel