Show pkgid when install pkg error
authorJiankang Fan <jiankang.fan@samsung.com>
Tue, 20 Dec 2016 00:53:00 +0000 (08:53 +0800)
committerSoonKyu Park <sk7.park@samsung.com>
Wed, 28 Dec 2016 13:15:57 +0000 (22:15 +0900)
Change-Id: I8bb5737b82f956a6eeccbc994c6a8c48ecde002a
Signed-off-by: Jiankang Fan <jiankang.fan@samsung.com>
mic/imager/baseimager.py

index 5ace0e2..9585991 100644 (file)
@@ -1004,7 +1004,15 @@ class BaseImageCreator(object):
                         continue
              
             return False
                         continue
              
             return False
-            
+
+        def showErrorInfo(filepath):
+            if os.path.isfile(filepath):
+                msger.info("The error install package info:")
+                for line in open(filepath):
+                    msger.info(line)
+            else:
+                msger.info("%s is not found." % filepath)
+
         def get_ssl_verify(ssl_verify=None):
             if ssl_verify is not None:
                 return not ssl_verify.lower().strip() == 'no'
         def get_ssl_verify(ssl_verify=None):
             if ssl_verify is not None:
                 return not ssl_verify.lower().strip() == 'no'
@@ -1086,6 +1094,7 @@ class BaseImageCreator(object):
             pkg_manager.close()
 
         if checkScriptletError(self._instroot + "/tmp/.postscript/error/", "_error"):
             pkg_manager.close()
 
         if checkScriptletError(self._instroot + "/tmp/.postscript/error/", "_error"):
+            showErrorInfo(self._instroot + "/tmp/.preload_install_error")
             raise CreatorError('scriptlet errors occurred')
             
         # hook post install
             raise CreatorError('scriptlet errors occurred')
             
         # hook post install