diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/psm.c | 12 | ||||
-rw-r--r-- | lib/rpmcallback.h | 3 | ||||
-rw-r--r-- | lib/rpminstall.c | 2 |
3 files changed, 15 insertions, 2 deletions
@@ -525,8 +525,11 @@ static rpmRC runLuaScript(rpmpsm psm, Header h, rpmTag stag, { char buf[BUFSIZ]; xx = snprintf(buf, BUFSIZ, "%s(%s-%s-%s)", sln, n, v, r); - if (rpmluaRunScript(lua, script, buf) == -1) + if (rpmluaRunScript(lua, script, buf) == -1) { + void *ptr = rpmtsNotify(ts, psm->te, RPMCALLBACK_SCRIPT_ERROR, + stag, 1); rc = RPMRC_FAIL; + } } rpmluaDelVar(lua, "arg"); @@ -853,7 +856,10 @@ static rpmRC runScript(rpmpsm psm, Header h, rpmTag stag, /* XXX filter order dependent multilib "other" arch helper error. */ if (!(psm->sq.reaped >= 0 && !strcmp(argv[0], "/usr/sbin/glibc_post_upgrade") && WEXITSTATUS(psm->sq.status) == 110)) { + void *ptr = NULL; if (psm->sq.reaped < 0) { + ptr = rpmtsNotify(ts, psm->te, RPMCALLBACK_SCRIPT_ERROR, + stag, WTERMSIG(psm->sq.child)); rpmlog(RPMLOG_ERR, _("%s(%s-%s-%s.%s) scriptlet failed, waitpid(%d) rc %d: %s\n"), sln, n, v, r, a, psm->sq.child, psm->sq.reaped, strerror(errno)); @@ -861,10 +867,14 @@ static rpmRC runScript(rpmpsm psm, Header h, rpmTag stag, } else if (!WIFEXITED(psm->sq.status) || WEXITSTATUS(psm->sq.status)) { if (WIFSIGNALED(psm->sq.status)) { + ptr = rpmtsNotify(ts, psm->te, RPMCALLBACK_SCRIPT_ERROR, + stag, WTERMSIG(psm->sq.status)); rpmlog(RPMLOG_ERR, _("%s(%s-%s-%s.%s) scriptlet failed, signal %d\n"), sln, n, v, r, a, WTERMSIG(psm->sq.status)); } else { + ptr = rpmtsNotify(ts, psm->te, RPMCALLBACK_SCRIPT_ERROR, + stag, WEXITSTATUS(psm->sq.status)); rpmlog(RPMLOG_ERR, _("%s(%s-%s-%s.%s) scriptlet failed, exit status %d\n"), sln, n, v, r, a, WEXITSTATUS(psm->sq.status)); diff --git a/lib/rpmcallback.h b/lib/rpmcallback.h index 444fa48b3..eda212af5 100644 --- a/lib/rpmcallback.h +++ b/lib/rpmcallback.h @@ -26,7 +26,8 @@ typedef enum rpmCallbackType_e { RPMCALLBACK_REPACKAGE_START = (1 << 11), RPMCALLBACK_REPACKAGE_STOP = (1 << 12), RPMCALLBACK_UNPACK_ERROR = (1 << 13), - RPMCALLBACK_CPIO_ERROR = (1 << 14) + RPMCALLBACK_CPIO_ERROR = (1 << 14), + RPMCALLBACK_SCRIPT_ERROR = (1 << 15) } rpmCallbackType; /** diff --git a/lib/rpminstall.c b/lib/rpminstall.c index 885f666cc..586849d23 100644 --- a/lib/rpminstall.c +++ b/lib/rpminstall.c @@ -211,6 +211,8 @@ void * rpmShowProgress(const void * arg, break; case RPMCALLBACK_CPIO_ERROR: break; + case RPMCALLBACK_SCRIPT_ERROR: + break; case RPMCALLBACK_UNKNOWN: default: break; |