diff options
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | URPM.pm | 1 | ||||
-rw-r--r-- | URPM.xs | 14 |
3 files changed, 16 insertions, 1 deletions
@@ -1,3 +1,5 @@ +- add support for verify callback when installing (mga#15350) + Version 5.18 - 25 June 2018 - Don't select an obsolete package to resolve dependencies/conflicts @@ -874,6 +874,7 @@ Recognized options are: callback_open => sub { ... } callback_trans => sub { ... } callback_uninst => sub { ... } + callback_verify => sub { ... } delta => used for progress callbacks (trans, uninst, inst) excludedocs => 0 / 1 force => 0 / 1 @@ -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)) { |