diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2012-01-03 13:10:26 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2012-01-03 15:15:24 +0200 |
commit | ce2ce4c19724879b9ea469e7760c7922660b9698 (patch) | |
tree | 340e5d3f99aa4aa3137f18d324b4bf53aaeed830 /python | |
parent | c4b78515d68fce43bf08c2ed0cdc0703713385b1 (diff) | |
download | librpm-tizen-ce2ce4c19724879b9ea469e7760c7922660b9698.tar.gz librpm-tizen-ce2ce4c19724879b9ea469e7760c7922660b9698.tar.bz2 librpm-tizen-ce2ce4c19724879b9ea469e7760c7922660b9698.zip |
Implement scriptlet start and stop callbacks (RhBug:606239)
- Adds two new transaction callbacks: RPMCALLBACK_SCRIPT_START and
RPMCALLBACK_SCRIPT_STOP which get issued for every scriptlet we run.
- On script start, callback can optionally return an FD which will
override transaction-wide script fd to make it easier to accurately
collect per-scriptlet output (eg per-scriptlet temporary file).
Callback is also responsible for closing the fd if it returns one.
- For both callbacks, "amount" holds the script tag number. On stop
callback, "total" holds the scriptlet exit status mapped into
OK/NOTFOUND/FAIL for success/non-fatal/fatal errors. Abusing "notfound"
for warning result is ugly but differentiating it from the other
cases allows callers to ignore SCRIPT_ERROR if they choose to
implement stop and start.
Diffstat (limited to 'python')
-rw-r--r-- | python/rpmmodule.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/python/rpmmodule.c b/python/rpmmodule.c index f2e0ed746..fdbb05ca5 100644 --- a/python/rpmmodule.c +++ b/python/rpmmodule.c @@ -449,6 +449,8 @@ static int initModule(PyObject *m) REGISTER_ENUM(RPMCALLBACK_UNPACK_ERROR); REGISTER_ENUM(RPMCALLBACK_CPIO_ERROR); REGISTER_ENUM(RPMCALLBACK_SCRIPT_ERROR); + REGISTER_ENUM(RPMCALLBACK_SCRIPT_START); + REGISTER_ENUM(RPMCALLBACK_SCRIPT_STOP); REGISTER_ENUM(RPMPROB_BADARCH); REGISTER_ENUM(RPMPROB_BADOS); |