rpm/rpm-5.4.10-implement-start-and-stop-callbacks.patch

68 lines
2.3 KiB
Diff
Raw Normal View History

--- rpm-5.4.10/lib/psm.c.cb~ 2013-03-18 03:54:33.548013203 +0100
+++ rpm-5.4.10/lib/psm.c 2013-03-18 03:39:40.643465724 +0100
@@ -842,6 +842,8 @@ assert(he->p.str != NULL);
psm->NVRA = NVRA = he->p.str;
}
+ scriptFd = rpmtsNotify(psm->ts, psm->te, RPMCALLBACK_SCRIPT_START, psm->scriptTag, 0);
+
if (op != NULL)
(void) rpmswEnter(op, 0);
@@ -1003,7 +1006,8 @@ assert(he->p.str != NULL);
break;
}
- scriptFd = rpmtsScriptFd(ts);
+ if (scriptFd == NULL)
+ scriptFd = rpmtsScriptFd(ts);
if (scriptFd != NULL) {
if (rpmIsVerbose()) {
out = fdDup(Fileno(scriptFd));
@@ -1165,6 +1169,8 @@ exit:
if (ix >= 0 && ix < RPMSCRIPT_MAX)
psm->smetrics[ix] += op->usecs / scale;
}
+ rpmtsNotify(psm->ts, psm->te, RPMCALLBACK_SCRIPT_STOP, psm->scriptTag,
+ rc != RPMRC_OK ? RPMRC_NOTFOUND : rc);
if (out)
xx = Fclose(out); /* XXX dup'd STDOUT_FILENO */
--- rpm-5.4.10/lib/rpminstall.c.cb~ 2013-03-18 03:54:48.316206560 +0100
+++ rpm-5.4.10/lib/rpminstall.c 2013-03-17 09:19:38.855870381 +0100
@@ -293,6 +293,10 @@ void * rpmShowProgress(/*@null@*/ const
break;
case RPMCALLBACK_SCRIPT_ERROR:
break;
+ case RPMCALLBACK_SCRIPT_START:
+ break;
+ case RPMCALLBACK_SCRIPT_STOP:
+ break;
case RPMCALLBACK_UNKNOWN:
default:
break;
--- rpm-5.4.10/python/rpmmodule.c.cb~ 2013-03-18 03:55:29.704746913 +0100
+++ rpm-5.4.10/python/rpmmodule.c 2013-03-17 09:19:38.855870381 +0100
@@ -559,6 +559,8 @@ void init_rpm(void)
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);
--- rpm-5.4.10/rpmio/rpmiotypes.h.cb~ 2013-03-18 03:54:05.472641157 +0100
+++ rpm-5.4.10/rpmio/rpmiotypes.h 2013-03-18 03:53:36.692228344 +0100
@@ -138,7 +138,9 @@ typedef enum rpmCallbackType_e {
RPMCALLBACK_REPACKAGE_STOP = (1 << 12),
RPMCALLBACK_UNPACK_ERROR = (1 << 13),
RPMCALLBACK_CPIO_ERROR = (1 << 14),
- RPMCALLBACK_SCRIPT_ERROR = (1 << 15)
+ RPMCALLBACK_SCRIPT_ERROR = (1 << 15),
+ RPMCALLBACK_SCRIPT_START = (1 << 16),
+ RPMCALLBACK_SCRIPT_STOP = (1 << 17)
} rpmCallbackType;
/**