summaryrefslogtreecommitdiff
path: root/lib/psm.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2008-10-03 13:00:33 +0300
committerPanu Matilainen <pmatilai@redhat.com>2008-10-03 13:00:33 +0300
commitffb886048c55b3a668d873bde7054571763c1058 (patch)
tree6fdcb4c817ff1890e98b7e8cfef2fac207c9f682 /lib/psm.c
parent3e687d09717ee8408a781d221f0ce4506b3cef1b (diff)
downloadrpm-ffb886048c55b3a668d873bde7054571763c1058.tar.gz
rpm-ffb886048c55b3a668d873bde7054571763c1058.tar.bz2
rpm-ffb886048c55b3a668d873bde7054571763c1058.zip
Similar semantics for <lua> scriptlets
- missing <lua> support is always an error - otherwise permit non-pre scriptlets to fail
Diffstat (limited to 'lib/psm.c')
-rw-r--r--lib/psm.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/psm.c b/lib/psm.c
index 4f4b66d9f..144fcda5a 100644
--- a/lib/psm.c
+++ b/lib/psm.c
@@ -503,6 +503,7 @@ static rpmRC runLuaScript(rpmpsm psm, Header h, rpmTag stag, ARGV_t argv,
const char *script, int arg1, int arg2)
{
rpmRC rc = RPMRC_FAIL;
+ int warn_only = 0;
#ifdef WITH_LUA
const rpmts ts = psm->ts;
char *nevra, *sname = NULL;
@@ -552,6 +553,8 @@ static rpmRC runLuaScript(rpmpsm psm, Header h, rpmTag stag, ARGV_t argv,
if (rpmluaRunScript(lua, script, sname) == 0) {
rc = RPMRC_OK;
+ } else if ((stag != RPMTAG_PREIN && stag != RPMTAG_PREUN)) {
+ warn_only = 1;
}
rpmluaDelVar(lua, "arg");
@@ -570,6 +573,9 @@ static rpmRC runLuaScript(rpmpsm psm, Header h, rpmTag stag, ARGV_t argv,
#endif
if (rc != RPMRC_OK) {
+ if (warn_only) {
+ rc = RPMRC_OK;
+ }
(void) rpmtsNotify(ts, psm->te, RPMCALLBACK_SCRIPT_ERROR, stag, rc);
}
return rc;