Nothing in yum cares for the dependency-tuples-of-doom that the
rpm-level ts.check() returns, having this in transaction wrapper check()
method seems like a more sensible place than in yum base class with
a funny name
(this requires the earlier ts population patch)
---
cli.py | 2 +-
rpmUtils/transaction.py | 13 ++++++++++++-
yum/__init__.py | 13 +------------
3 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/cli.py b/cli.py
index 23ef686..9cee6a6 100644
--- a/cli.py
+++ b/cli.py
@@ -514,7 +514,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
rcd_st = time.time()
self.verbose_logger.log(yum.logginglevels.INFO_2,
_('Running rpm_check_debug'))
- msgs = self._run_rpm_check_debug()
+ msgs = self.ts.check()
if msgs:
rpmlib_only = True
for msg in msgs:
diff --git a/rpmUtils/transaction.py b/rpmUtils/transaction.py
index e8f4459..4c4a420 100644
--- a/rpmUtils/transaction.py
+++ b/rpmUtils/transaction.py
@@ -13,6 +13,7 @@
import rpm
import miscutils
+from yum.i18n import to_str
read_ts = None
ts = None
@@ -23,7 +24,6 @@ class TransactionWrapper:
def __init__(self, root='/'):
self.ts = rpm.TransactionSet(root)
self._methods = ['dbMatch',
- 'check',
'order',
'addErase',
'addInstall',
@@ -54,6 +54,17 @@ class TransactionWrapper:
self.ts = None
self.open = False
+ def check(self):
+ results = []
+ self.ts.check()
+ for prob in self.ts.problems():
+ # Newer rpm (4.8.0+) has problem objects, older have just strings.
+ # Should probably move to using the new objects, when we can. For
+ # now just be compatible.
+ results.append(to_str(prob))
+
+ return results
+
def __getattr__(self, attr):
if attr in self._methods:
return self.getMethod(attr)
diff --git a/yum/__init__.py b/yum/__init__.py
index 4147678..02b4780 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -4814,7 +4814,7 @@ class YumBase(depsolve.Depsolve):
if self.conf.rpm_check_debug:
self.verbose_logger.log(logginglevels.INFO_2,
_('Running rpm_check_debug'))
- msgs = self._run_rpm_check_debug()
+ msgs = self.ts.check()
if msgs:
rpmlib_only = True
for msg in msgs:
@@ -4867,17 +4867,6 @@ class YumBase(depsolve.Depsolve):
cb.display = display
self.runTransaction( cb=cb )
- def _run_rpm_check_debug(self):
- results = []
- self.ts.check()
- for prob in self.ts.problems():
- # Newer rpm (4.8.0+) has problem objects, older have just strings.
- # Should probably move to using the new objects, when we can. For
- # now just be compatible.
- results.append(to_str(prob))
-
- return results
-
def add_enable_repo(self, repoid, baseurls=[], mirrorlist=None, **kwargs):
"""add and enable a repo with just a baseurl/mirrorlist and repoid
requires repoid and at least one of baseurl and mirrorlist
--
1.7.4
_______________________________________________
Yum-devel mailing list
[email protected]
http://lists.baseurl.org/mailman/listinfo/yum-devel