summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2005-09-01 17:26:32 +0000
committerPascal Rigaux <pixel@mandriva.com>2005-09-01 17:26:32 +0000
commit4264ef38561bacd72025147fa775bf55bb2a67dd (patch)
treefa5e40ba15a89f2aea13369f8b2e6a78cd700769
parent47cc4246f1ed1a70a90363bfc212aa2a787a9261 (diff)
downloaddrakx-4264ef38561bacd72025147fa775bf55bb2a67dd.tar
drakx-4264ef38561bacd72025147fa775bf55bb2a67dd.tar.gz
drakx-4264ef38561bacd72025147fa775bf55bb2a67dd.tar.bz2
drakx-4264ef38561bacd72025147fa775bf55bb2a67dd.tar.xz
drakx-4264ef38561bacd72025147fa775bf55bb2a67dd.zip
create remove_raw(), remove() now retries with option noscripts
-rw-r--r--perl-install/pkgs.pm18
1 files changed, 14 insertions, 4 deletions
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm
index 6da959071..873e965fe 100644
--- a/perl-install/pkgs.pm
+++ b/perl-install/pkgs.pm
@@ -1229,13 +1229,13 @@ sub remove_marked_ask_remove {
#- we are not checking depends since it should come when
#- upgrading a system. although we may remove some functionalities ?
- remove(\@to_remove, $callback);
+ remove(\@to_remove, $callback, force => 1);
delete $packages->{state}{ask_remove}{$_} foreach @to_remove;
}
-sub remove {
- my ($to_remove, $callback) = @_;
+sub remove_raw {
+ my ($to_remove, $callback, %run_transaction_options) = @_;
log::l("removing: " . join(' ', @$to_remove));
@@ -1247,7 +1247,17 @@ sub remove {
$callback->($db, user => undef, remove => scalar @$to_remove);
- if (my @pbs = $trans->run(undef, force => 1)) {
+ $trans->run(undef, %run_transaction_options);
+}
+sub remove {
+ my ($_to_remove, $_callback, %run_transaction_options) = @_;
+
+ my @pbs = &remove_raw;
+ if (@pbs && !$run_transaction_options{noscripts}) {
+ $run_transaction_options{noscripts} = 1;
+ @pbs = &remove_raw;
+ }
+ if (@pbs) {
die "removing of old rpms failed:\n ", join("\n ", @pbs);
}
}