aboutsummaryrefslogtreecommitdiffstats
path: root/URPM.xs
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2018-09-14 10:59:37 +0200
committerThierry Vignaud <thierry.vignaud@gmail.com>2018-09-14 15:42:25 +0200
commitffd6d10ee61b986340939c364c4a44a64882610d (patch)
treef58f6bbc725d4eaa98aeff1d6ba2bf46f6820158 /URPM.xs
parent1ef694894b813f69959072fc0acbab285adcbd70 (diff)
downloadperl-URPM-ffd6d10ee61b986340939c364c4a44a64882610d.tar
perl-URPM-ffd6d10ee61b986340939c364c4a44a64882610d.tar.gz
perl-URPM-ffd6d10ee61b986340939c364c4a44a64882610d.tar.bz2
perl-URPM-ffd6d10ee61b986340939c364c4a44a64882610d.tar.xz
perl-URPM-ffd6d10ee61b986340939c364c4a44a64882610d.zip
add support for verify callback when installing
Resolves: mga#15350
Diffstat (limited to 'URPM.xs')
-rw-r--r--URPM.xs14
1 files changed, 13 insertions, 1 deletions
diff --git a/URPM.xs b/URPM.xs
index 2d52299..c8d4364 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -72,6 +72,7 @@ struct s_TransactionData {
SV* callback_inst;
SV* callback_error;
SV* callback_elem;
+ SV* callback_verify;
long min_delta;
SV *data; /* chain with another data user provided */
};
@@ -1252,6 +1253,12 @@ static void *rpmRunTransactions_callback(__attribute__((unused)) const void *h,
callback = td->callback_uninst;
callback_type = "uninst";
break;
+ case RPMCALLBACK_VERIFY_START:
+ case RPMCALLBACK_VERIFY_PROGRESS:
+ case RPMCALLBACK_VERIFY_STOP:
+ callback = td->callback_verify;
+ callback_type = "verify";
+ break;
case RPMCALLBACK_INST_START:
case RPMCALLBACK_INST_PROGRESS:
case RPMCALLBACK_INST_STOP:
@@ -1284,12 +1291,14 @@ static void *rpmRunTransactions_callback(__attribute__((unused)) const void *h,
case RPMCALLBACK_INST_START:
case RPMCALLBACK_TRANS_START:
case RPMCALLBACK_UNINST_START:
+ case RPMCALLBACK_VERIFY_START:
callback_subtype = "start";
gettimeofday(&tprev, NULL);
break;
case RPMCALLBACK_INST_PROGRESS:
case RPMCALLBACK_TRANS_PROGRESS:
case RPMCALLBACK_UNINST_PROGRESS:
+ case RPMCALLBACK_VERIFY_PROGRESS:
callback_subtype = "progress";
gettimeofday(&tcurr, NULL);
delta = 1000000 * (tcurr.tv_sec - tprev.tv_sec) + (tcurr.tv_usec - tprev.tv_usec);
@@ -1301,6 +1310,7 @@ static void *rpmRunTransactions_callback(__attribute__((unused)) const void *h,
case RPMCALLBACK_INST_STOP:
case RPMCALLBACK_TRANS_STOP:
case RPMCALLBACK_UNINST_STOP:
+ case RPMCALLBACK_VERIFY_STOP:
callback_subtype = "stop";
break;
case RPMCALLBACK_CPIO_ERROR:
@@ -2690,7 +2700,7 @@ Trans_run(trans, data, ...)
URPM::Transaction trans
SV *data
PREINIT:
- struct s_TransactionData td = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, 100000, data };
+ struct s_TransactionData td = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 100000, data };
rpmtransFlags transFlags = RPMTRANS_FLAG_NONE;
int probFilter = 0;
int translate_message = 0, raw_message = 0;
@@ -2745,6 +2755,8 @@ Trans_run(trans, data, ...)
if (SvROK(ST(i+1))) td.callback_trans = ST(i+1);
} else if (len == 9+6 && !memcmp(s+9, "uninst", 6)) {
if (SvROK(ST(i+1))) td.callback_uninst = ST(i+1);
+ } else if (len == 9+6 && !memcmp(s+9, "verify", 6)) {
+ if (SvROK(ST(i+1))) td.callback_verify = ST(i+1);
} else if (len == 9+4 && !memcmp(s+9, "inst", 4)) {
if (SvROK(ST(i+1))) td.callback_inst = ST(i+1);
} else if (len == 9+5 && !memcmp(s+9, "error", 5)) {