print warning message for detecting rpm post script failed
authorDohyung Kim <dohyung2.kim@samsung.com>
Thu, 4 May 2017 01:19:10 +0000 (10:19 +0900)
committerxiaojuan.mao <xiaojuan.mao@samsung.com>
Thu, 13 Jul 2017 03:19:25 +0000 (11:19 +0800)
  ...
  [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 f2e5585..135e458 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. """