diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2008-10-03 12:49:29 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2008-10-03 12:49:29 +0300 |
commit | 3e687d09717ee8408a781d221f0ce4506b3cef1b (patch) | |
tree | 0f35a6bc6cedf108bc7e27f6ff18ba4c1f7fa152 | |
parent | 17df5ad61397fb12bb2cc9a94798de97266afd9e (diff) | |
download | librpm-tizen-3e687d09717ee8408a781d221f0ce4506b3cef1b.tar.gz librpm-tizen-3e687d09717ee8408a781d221f0ce4506b3cef1b.tar.bz2 librpm-tizen-3e687d09717ee8408a781d221f0ce4506b3cef1b.zip |
Always perform callback notify of lua scriptlet errors too
-rw-r--r-- | lib/psm.c | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -502,11 +502,11 @@ static pid_t psmWait(rpmpsm psm) static rpmRC runLuaScript(rpmpsm psm, Header h, rpmTag stag, ARGV_t argv, const char *script, int arg1, int arg2) { + rpmRC rc = RPMRC_FAIL; #ifdef WITH_LUA const rpmts ts = psm->ts; char *nevra, *sname = NULL; int rootFd = -1; - rpmRC rc = RPMRC_OK; int xx; rpmlua lua = NULL; /* Global state. */ rpmluav var; @@ -550,10 +550,8 @@ static rpmRC runLuaScript(rpmpsm psm, Header h, rpmTag stag, ARGV_t argv, var = rpmluavFree(var); rpmluaPop(lua); - if (rpmluaRunScript(lua, script, sname) == -1) { - void * ptr; - ptr = rpmtsNotify(ts, psm->te, RPMCALLBACK_SCRIPT_ERROR, stag, 1); - rc = RPMRC_FAIL; + if (rpmluaRunScript(lua, script, sname) == 0) { + rc = RPMRC_OK; } rpmluaDelVar(lua, "arg"); @@ -567,11 +565,14 @@ static rpmRC runLuaScript(rpmpsm psm, Header h, rpmTag stag, ARGV_t argv, xx = rpmtsSetChrootDone(ts, 0); } free(sname); - - return rc; #else - return RPMRC_FAIL; + rpmlog(RPMLOG_ERR, _("<lua> scriptlet support not built in\n")); #endif + + if (rc != RPMRC_OK) { + (void) rpmtsNotify(ts, psm->te, RPMCALLBACK_SCRIPT_ERROR, stag, rc); + } + return rc; } /** |