summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2010-05-25 15:38:15 +0300
committerPanu Matilainen <pmatilai@redhat.com>2010-05-25 15:38:15 +0300
commit2c54c6abbf4c6ee44d0693133a2f373621832ffb (patch)
tree69981d4a59fc24ce856d6eee3e96c8035e989839
parenta2b999df2e71dd7b595ad329e26efe80eabb9d1f (diff)
downloadlibrpm-tizen-2c54c6abbf4c6ee44d0693133a2f373621832ffb.tar.gz
librpm-tizen-2c54c6abbf4c6ee44d0693133a2f373621832ffb.tar.bz2
librpm-tizen-2c54c6abbf4c6ee44d0693133a2f373621832ffb.zip
Move scriptlet statistics collection (back) inside psm
- removes one rpmts dependency from scriptlets
-rw-r--r--lib/psm.c5
-rw-r--r--lib/rpmscript.c2
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/psm.c b/lib/psm.c
index 75cafcb9f..a31a9a6f9 100644
--- a/lib/psm.c
+++ b/lib/psm.c
@@ -414,12 +414,15 @@ static rpmRC runScript(rpmpsm psm, ARGV_const_t prefixes,
rpmRC rc = RPMRC_OK;
int warn_only =(script->tag != RPMTAG_PREIN && script->tag != RPMTAG_PREUN);
+ rpmswEnter(rpmtsOp(psm->ts, RPMTS_OP_SCRIPTLETS), 0);
+ rc = rpmScriptRun(script, arg1, arg2, psm->ts, prefixes, warn_only);
+ rpmswExit(rpmtsOp(psm->ts, RPMTS_OP_SCRIPTLETS), 0);
+
/*
* Notify callback for all errors. "total" abused for warning/error,
* rc only reflects whether the condition prevented install/erase
* (which is only happens with %prein and %preun scriptlets) or not.
*/
- rc = rpmScriptRun(script, arg1, arg2, psm->ts, prefixes, warn_only);
if (rc != RPMRC_OK) {
if (warn_only) {
rc = RPMRC_OK;
diff --git a/lib/rpmscript.c b/lib/rpmscript.c
index 11a78f65e..a808e2e05 100644
--- a/lib/rpmscript.c
+++ b/lib/rpmscript.c
@@ -320,13 +320,11 @@ rpmRC rpmScriptRun(rpmScript script, int arg1, int arg2,
argvAdd(&args, "/bin/sh");
}
- rpmswEnter(rpmtsOp(ts, RPMTS_OP_SCRIPTLETS), 0);
if (rstreq(args[0], "<lua>")) {
rc = runLuaScript(ts, prefixes, script->descr, lvl, &args, script->body, arg1, arg2);
} else {
rc = runExtScript(ts, prefixes, script->descr, lvl, &args, script->body, arg1, arg2);
}
- rpmswExit(rpmtsOp(ts, RPMTS_OP_SCRIPTLETS), 0);
argvFree(args);
return rc;