print warning message for detecting rpm post script failed 07/128007/1
authorDohyung Kim <dohyung2.kim@samsung.com>
Thu, 4 May 2017 01:19:10 +0000 (10:19 +0900)
committerDohyung Kim <dohyung2.kim@samsung.com>
Thu, 4 May 2017 01:22:01 +0000 (10:22 +0900)
  ...
  [05/04 01:13:18 UTC] Installing: libstdc++
  [05/04 01:13:18 UTC] (libstdc++) Post script failed
  ...

Signed-off-by: Dohyung Kim <dohyung2.kim@samsung.com>
Change-Id: I8efc466b3a18e9c9f2bde05ad26d058178cf90b8

mic/utils/rpmmisc.py

index a3b166c88378b858d3249450dbf46dfdf2afaa3b..c8cee546c62779c18536c192e55491f866d1352f 100644 (file)
@@ -188,6 +188,20 @@ class RPMInstallCallback:
 
         elif what == rpm.RPMCALLBACK_REPACKAGE_PROGRESS:
             pass
+        elif what == rpm.RPMCALLBACK_SCRIPT_ERROR:
+            if h is not None:
+                try:
+                    hdr, rpmloc = h
+                except:
+                    rpmloc = h
+
+                m = re.match("(.*)-(\d+.*)-(\d+\.\d+)\.(.+)\.rpm", os.path.basename(rpmloc))
+                if m:
+                    pkgname = m.group(1)
+                else:
+                    pkgname = os.path.basename(rpmloc)
+
+                msger.warning('(%s) Post script failed' % pkgname)
 
 def readRpmHeader(ts, filename):
     """ Read an rpm header. """