summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2009-03-05 17:52:53 +0000
committerThierry Vignaud <tv@mandriva.org>2009-03-05 17:52:53 +0000
commit8e6331eb9188e4080d511cc1f52364122b42b71d (patch)
treebab1bc8cf830c0c0a2e6764a3ca5dc77b3109699 /perl-install
parent5c6a1e4681751dbc0585b33a4196170415cf9b6b (diff)
downloaddrakx-8e6331eb9188e4080d511cc1f52364122b42b71d.tar
drakx-8e6331eb9188e4080d511cc1f52364122b42b71d.tar.gz
drakx-8e6331eb9188e4080d511cc1f52364122b42b71d.tar.bz2
drakx-8e6331eb9188e4080d511cc1f52364122b42b71d.tar.xz
drakx-8e6331eb9188e4080d511cc1f52364122b42b71d.zip
(_unselect_package) split it out of _install_raw()
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/install/pkgs.pm32
1 files changed, 15 insertions, 17 deletions
diff --git a/perl-install/install/pkgs.pm b/perl-install/install/pkgs.pm
index 233955154..58a552c16 100644
--- a/perl-install/install/pkgs.pm
+++ b/perl-install/install/pkgs.pm
@@ -697,27 +697,25 @@ sub install {
fs::loopback::save_boot($loop_boot);
}
+sub _unselect_package {
+ my ($pkg) = @_;
+ #- update flag associated to package.
+ $pkg->set_flag_installed(1);
+ $pkg->set_flag_upgrade(0);
+ #- update obsoleted entry.
+ my $rejected = $packages->{state}{rejected};
+ foreach (keys %$rejected) {
+ if (delete $rejected->{$_}{closure}{$pkg->fullname}) {
+ %{$rejected->{$_}{closure}} or delete $rejected->{$_};
+ }
+ }
+}
+
sub _install_raw {
my ($packages, $isUpgrade, $callback, $LOG, $noscripts) = @_;
- my $close = sub {
- my ($pkg) = @_;
- #- update flag associated to package.
- $pkg->set_flag_installed(1);
- $pkg->set_flag_upgrade(0);
- #- update obsoleted entry.
- my $rejected = $packages->{state}{rejected};
- foreach (keys %$rejected) {
- if (delete $rejected->{$_}{closure}{$pkg->fullname}) {
- %{$rejected->{$_}{closure}} or delete $rejected->{$_};
- }
- }
- };
-
my $db = open_rpm_db_rw() or die "error opening RPM database: ", URPM::rpmErrorString();
-
-
# let's be urpmi's compatible:
local $packages->{options}{noscripts} = $noscripts;
$urpm::args::options{force_transactions} = 1;
@@ -749,7 +747,7 @@ sub _install_raw {
}
$check_installed or log::l($pkg->name . " not installed, " . URPM::rpmErrorString());
- $check_installed and $close->($pkg);
+ $check_installed and _unselect_package($pkg);
}, inst => $callback,
trans => $callback,
# FIXME: implement already_installed_or_not_installable