From 351fdbee9aacb2f8c4b9829e228bd48e2dacdc90 Mon Sep 17 00:00:00 2001 From: Dohyung Kim Date: Thu, 4 May 2017 10:19:10 +0900 Subject: [PATCH] print warning message for detecting rpm post script failed ... [05/04 01:13:18 UTC] Installing: libstdc++ [05/04 01:13:18 UTC] (libstdc++) Post script failed ... Signed-off-by: Dohyung Kim Change-Id: I8efc466b3a18e9c9f2bde05ad26d058178cf90b8 --- mic/utils/rpmmisc.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/mic/utils/rpmmisc.py b/mic/utils/rpmmisc.py index f2e5585..135e458 100644 --- a/mic/utils/rpmmisc.py +++ b/mic/utils/rpmmisc.py @@ -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. """ -- 2.7.4