zypp: Catch more error msg from rpm transaction results
authorZhang Qiang <qiang.z.zhang@intel.com>
Sat, 8 Oct 2011 05:28:42 +0000 (13:28 +0800)
committerZhang Qiang <qiang.z.zhang@intel.com>
Sat, 8 Oct 2011 05:28:42 +0000 (13:28 +0800)
plugins/backend/zypppkgmgr.py

index d605306..3bc00f2 100644 (file)
@@ -511,7 +511,16 @@ class Zypp(BackendPlugin):
         if not unresolved_dependencies:
             self.ts.order()
             cb = rpmmisc.RPMInstallCallback(self.ts)
-            self.ts.run(cb.callback, '')
+            errors = self.ts.run(cb.callback, '')
+            if errors is None:
+                pass
+            elif len(errors) == 0:
+                msger.warning('scriptlet or other non-fatal errors occurred during transaction.')
+            else:
+                for e in errors:
+                    msger.warning(e[0])
+                msger.error('Could not run transaction.')
+             
             self.ts.closeDB()
             self.ts = None
         else: