[yum-git] yum/__init__.py

Seth Vidal skvidal at linux.duke.edu
Mon Apr 14 20:34:16 UTC 2008


 yum/__init__.py |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

New commits:
commit d21198a3a834f1daeb937dee562ee16621425c75
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Mon Apr 14 16:32:30 2008 -0400

    merged patch from Panu from rh bug: #427866

diff --git a/yum/__init__.py b/yum/__init__.py
index 6bffd6d..e939060 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -772,7 +772,18 @@ class YumBase(depsolve.Depsolve):
         self.plugins.run('pretrans')
 
         errors = self.ts.run(cb.callback, '')
-        if errors:
+        # ts.run() exit codes are, hmm, "creative": None means all ok, empty 
+        # list means some errors happened in the transaction and non-empty 
+        # list that there were errors preventing the ts from starting...
+        if errors is None:
+            pass
+        elif len(errors) == 0:
+            errstring = _('Warning: errors occurred during transaction.')
+            raise Errors.YumBaseError, errstring
+        else:
+            errstring = '\n'.join(map(_tup2str, errors))
+                          raise Errors.YumBaseError, errstring
+                          
             errstring = '\n'.join(map(_tup2str, errors))
             raise Errors.YumBaseError, errstring
 



More information about the Yum-cvs-commits mailing list