summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2008-10-03 12:49:29 +0300
committerPanu Matilainen <pmatilai@redhat.com>2008-10-03 12:49:29 +0300
commit3e687d09717ee8408a781d221f0ce4506b3cef1b (patch)
tree0f35a6bc6cedf108bc7e27f6ff18ba4c1f7fa152
parent17df5ad61397fb12bb2cc9a94798de97266afd9e (diff)
downloadlibrpm-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.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/psm.c b/lib/psm.c
index 090c3a56c..4f4b66d9f 100644
--- a/lib/psm.c
+++ b/lib/psm.c
@@ -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;
}
/**