aboutsummaryrefslogtreecommitdiffstats
path: root/Rpmdrake/pkg.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Rpmdrake/pkg.pm')
-rw-r--r--Rpmdrake/pkg.pm30
1 files changed, 28 insertions, 2 deletions
diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm
index 581ed6b8..023694dc 100644
--- a/Rpmdrake/pkg.pm
+++ b/Rpmdrake/pkg.pm
@@ -401,11 +401,15 @@ sub get_updates_list {
# list updates including skiped ones + their deps in MandrivaUpdate:
@$requested_list = uniq(@$requested_list, @$requested_strict);
+ #use Data::Dumper; die Dumper $urpm->{media};
+
# do not pre select updates in rpmdrake:
@$requested_strict = () if !$probe_only_for_updates;
}
sub get_pkgs {
+ use Benchmark;
+ my $t0 = new Benchmark;
my ($opts) = @_;
my $w = $::main_window;
@@ -475,9 +479,27 @@ sub get_pkgs {
my $state = {};
my (@requested, @requested_strict);
+ warn ">> $compute_updates || $::MODE eq 'update'\n";
if ($compute_updates || $::MODE eq 'update') {
+ # faster, ony look at update media for computing updates:
+ use Data::Dumper; output('/tmp/media.pm', Dumper [ \@update_medias, $urpm->{media} ]);
+ my $urpm = $urpm;
+ #my have side effects :-( :
+ $urpm = open_urpmi_db(update => 1) if !is_it_a_devel_distro();
+ #local $urpm->{media} = \@update_medias; # not enough, request_packages_to_upgrade->() will find them anyway due to all packages being known
+
get_updates_list($urpm, $db, $state, $requested, \@requested, \@requested_strict, \%all_pkgs);
}
+ my $t1 = new Benchmark;
+ my $td = timediff($t1, $t0);
+ print "the code took:",timestr($td),"\n";
+ use Data::Dumper;
+ $Data::Dumper::Sortkeys = 1;
+ warn ">> $compute_updates || $::MODE eq 'update'\n";
+ output("/tmp/pkgs_$$.pm", Dumper([ \@requested, \@requested_strict ]));
+ #DIE "DONE\n";
+ $a;
+ #exit 1;
$priority_state = $need_restart ? $state : undef;
$priority_requested = $need_restart ? $requested : undef;
@@ -512,6 +534,7 @@ sub get_pkgs {
}
}
@updates = @requested;
+ #warn Dumper [ \@updates, \@requested, \@requested_strict ];
# selecting updates by default but skipped ones (MandrivaUpdate only):
foreach (@requested_strict) {
$all_pkgs{$_}{selected} = 1;
@@ -651,6 +674,10 @@ sub perform_installation { #- (partially) duplicated from /usr/sbin/urpmi :-(
}
my @to_install = @{$urpm->{depslist}}[keys %{$state->{selected}}];
+ # FIXME: selection are not identical:
+ use Data::Dumper; warn Dumper [ \@to_install,
+ [ grep { $pkgs->{$_}{selected} } keys %$pkgs ],
+ ];
my @pkgs = map { scalar($_->fullname) } sort(grep { $_->flag_selected } @to_install);
@{$urpm->{ask_remove}} = sort(urpm::select::removed_packages($urpm, $urpm->{state}));
@@ -689,7 +716,7 @@ sub perform_installation { #- (partially) duplicated from /usr/sbin/urpmi :-(
my $_gurpm_clean_guard = before_leaving { undef $gurpm };
my $something_installed;
- if (@to_install && $::rpmdrake_options{auto_orphans}) {
+ if (@to_install) {
urpm::orphans::compute_future_unrequested_orphans($urpm, $state);
if (my @orphans = map { scalar $_->fullname } @{$state->{orphans_to_remove}}) {
interactive_msg(N("Orphan packages"), P("The following orphan package will be removed.",
@@ -861,7 +888,6 @@ you may now inspect some in order to take actions:"),
}
N("RPM transaction %d/%d");
- N("Unselect all");
N("Details");
statusbar_msg_remove($statusbar_msg_id); #- XXX maybe remove this