aboutsummaryrefslogtreecommitdiffstats
path: root/URPM.xs
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2013-01-29 17:56:18 +0000
committerThierry Vignaud <tv@mageia.org>2013-01-29 17:56:18 +0000
commit31f847ff80562e1a47f4bc87565325243e1e2e3b (patch)
tree0c8dce244b23f4ef16f438d593cb5a1f06256e37 /URPM.xs
parent3fd6b485cbafd6a89a79d6227ec442544827a973 (diff)
downloadperl-URPM-31f847ff80562e1a47f4bc87565325243e1e2e3b.tar
perl-URPM-31f847ff80562e1a47f4bc87565325243e1e2e3b.tar.gz
perl-URPM-31f847ff80562e1a47f4bc87565325243e1e2e3b.tar.bz2
perl-URPM-31f847ff80562e1a47f4bc87565325243e1e2e3b.tar.xz
perl-URPM-31f847ff80562e1a47f4bc87565325243e1e2e3b.zip
add support for callback_error
Diffstat (limited to 'URPM.xs')
-rw-r--r--URPM.xs25
1 files changed, 24 insertions, 1 deletions
diff --git a/URPM.xs b/URPM.xs
index 59258ab..c6baa8a 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -70,6 +70,7 @@ struct s_TransactionData {
SV* callback_trans;
SV* callback_uninst;
SV* callback_inst;
+ SV* callback_error;
long min_delta;
SV *data; /* chain with another data user provided */
};
@@ -1243,6 +1244,17 @@ static void *rpmRunTransactions_callback(__attribute__((unused)) const void *h,
callback = td->callback_inst;
callback_type = "inst";
break;
+ case RPMCALLBACK_SCRIPT_START:
+ case RPMCALLBACK_SCRIPT_STOP:
+ callback = td->callback_inst;
+ callback_type = "script";
+ break;
+ case RPMCALLBACK_CPIO_ERROR:
+ case RPMCALLBACK_SCRIPT_ERROR:
+ case RPMCALLBACK_UNPACK_ERROR:
+ callback = td->callback_error;
+ callback_type = "error";
+ break;
default:
break;
}
@@ -1270,6 +1282,15 @@ static void *rpmRunTransactions_callback(__attribute__((unused)) const void *h,
case RPMCALLBACK_UNINST_STOP:
callback_subtype = "stop";
break;
+ case RPMCALLBACK_CPIO_ERROR:
+ callback_subtype = "cpio";
+ break;
+ case RPMCALLBACK_SCRIPT_ERROR:
+ callback_subtype = "script";
+ break;
+ case RPMCALLBACK_UNPACK_ERROR:
+ callback_subtype = "unpack";
+ break;
default:
break;
}
@@ -2661,7 +2682,7 @@ Trans_run(trans, data, ...)
URPM::Transaction trans
SV *data
PREINIT:
- struct s_TransactionData td = { NULL, NULL, NULL, NULL, NULL, 100000, data };
+ struct s_TransactionData td = { NULL, NULL, NULL, NULL, NULL, NULL, 100000, data };
rpmtransFlags transFlags = RPMTRANS_FLAG_NONE;
int probFilter = 0;
int translate_message = 0, raw_message = 0;
@@ -2716,6 +2737,8 @@ Trans_run(trans, data, ...)
if (SvROK(ST(i+1))) td.callback_uninst = 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+4 && !memcmp(s+9, "errror", 6)) {
+ if (SvROK(ST(i+1))) td.callback_error = ST(i+1);
}
}
}