aboutsummaryrefslogtreecommitdiffstats
path: root/Rpmdrake
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2009-09-25 09:58:21 +0000
committerThierry Vignaud <tv@mandriva.org>2009-09-25 09:58:21 +0000
commit7b65d6633d3afb39ed7c9881e8dc4c3719f567b4 (patch)
tree885872b98b86831049db80f7bed7ae5d41e6f20e /Rpmdrake
parentaac43f2c868478fe1a1064bd4a4891fc104fccd7 (diff)
parent41f8899cfd131dceb4ad55ec2c5d88e9de67197a (diff)
downloadrpmdrake-7b65d6633d3afb39ed7c9881e8dc4c3719f567b4.tar
rpmdrake-7b65d6633d3afb39ed7c9881e8dc4c3719f567b4.tar.gz
rpmdrake-7b65d6633d3afb39ed7c9881e8dc4c3719f567b4.tar.bz2
rpmdrake-7b65d6633d3afb39ed7c9881e8dc4c3719f567b4.tar.xz
rpmdrake-7b65d6633d3afb39ed7c9881e8dc4c3719f567b4.zip
restore good version
Diffstat (limited to 'Rpmdrake')
-rw-r--r--Rpmdrake/gui.pm18
-rw-r--r--Rpmdrake/pkg.pm30
2 files changed, 11 insertions, 37 deletions
diff --git a/Rpmdrake/gui.pm b/Rpmdrake/gui.pm
index 33052285..e1d0abbc 100644
--- a/Rpmdrake/gui.pm
+++ b/Rpmdrake/gui.pm
@@ -398,7 +398,6 @@ sub toggle_all {
my @l = children($w) or return;
my @unsel = grep_unselected(@l);
- # FIXME: ignore unsel according to $_val (val=0 => unselect?, =1 => select?)
my @p = @unsel ?
#- not all is selected, select all if no option to potentially override
(exists $common->{partialsel_unsel} && $common->{partialsel_unsel}->(\@unsel, \@l) ? difference2(\@l, \@unsel) : @unsel)
@@ -511,10 +510,6 @@ sub ask_browse_tree_given_widgets_for_rpmdrake {
$common->{initial_selection} and toggle_nodes($w->{tree}->window, $w->{detail_list_model}, \&set_leaf_state, undef, @{$common->{initial_selection}});
#my $_b = before_leaving { $clear_all_caches->() };
$common->{init_callback}->() if $common->{init_callback};
- use Data::Dumper;
- #output('/tmp/pkgs.pm', Dumper([
- # format_pkg_simplifiedinfo($pkgs, 'basesystem', $urpm, $descriptions)
- #]));
$w->{w}->main;
}
@@ -554,7 +549,15 @@ sub pkgs_provider {
);
my %tmp_filter_methods = (
all => sub { [ keys %$pkgs ] },
- all_updates => sub { $h->{updates} },
+ all_updates => sub {
+ # potential "updates" from media not tagged as updates:
+ if (!$options{pure_updates} && !$Rpmdrake::pkg::need_restart) {
+ [ @{$h->{updates}},
+ difference2([ grep { is_updatable($_) } @{$h->{installable}} ], $h->{backports}) ];
+ } else {
+ $h->{updates};
+ }
+ },
backports => sub { $h->{backports} },
meta_pkgs => sub { $h->{meta_pkgs} },
gui_pkgs => sub { $h->{gui_pkgs} },
@@ -664,8 +667,6 @@ sub toggle_nodes {
\@nodes, \@nodes_with_deps) or @nodes_with_deps = ();
};
- warn ">> old_state=$old_state, new_state=$new_state\n";
-
if (member($old_state, qw(to_remove installed))) { # remove pacckages
if ($new_state) {
my @remove;
@@ -757,7 +758,6 @@ sub toggle_nodes {
packages_selection_ok:
} else {
my @unrequested;
- warn ">> DESELECTING\n";
slow_func($widget,
sub { @unrequested = $urpm->disable_selected(open_rpm_db(), $urpm->{state},
map { $pkgs->{$_}{pkg} } @nodes) });
diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm
index 023694dc..581ed6b8 100644
--- a/Rpmdrake/pkg.pm
+++ b/Rpmdrake/pkg.pm
@@ -401,15 +401,11 @@ 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;
@@ -479,27 +475,9 @@ 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;
@@ -534,7 +512,6 @@ 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;
@@ -674,10 +651,6 @@ 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}));
@@ -716,7 +689,7 @@ sub perform_installation { #- (partially) duplicated from /usr/sbin/urpmi :-(
my $_gurpm_clean_guard = before_leaving { undef $gurpm };
my $something_installed;
- if (@to_install) {
+ if (@to_install && $::rpmdrake_options{auto_orphans}) {
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.",
@@ -888,6 +861,7 @@ 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