diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2008-10-03 13:00:33 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2008-10-03 13:00:33 +0300 |
commit | ffb886048c55b3a668d873bde7054571763c1058 (patch) | |
tree | 6fdcb4c817ff1890e98b7e8cfef2fac207c9f682 /lib/psm.c | |
parent | 3e687d09717ee8408a781d221f0ce4506b3cef1b (diff) | |
download | rpm-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.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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; |