aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xrpmdrake51
-rw-r--r--rpmdrake.spec3
2 files changed, 20 insertions, 34 deletions
diff --git a/rpmdrake b/rpmdrake
index 0275c36d..77869d2e 100755
--- a/rpmdrake
+++ b/rpmdrake
@@ -377,12 +377,6 @@ sub run_treeview_dialog {
$choices->[interactive_list_(N("Please choose"), N("One of the following packages is needed:"),
[ map { my_fullname($_) } @$choices ], $callback)];
};
- my $choices_auto;
- my $callback_choices_auto = sub {
- my (undef, $db, $state, $choices) = @_;
- member(my_fullname($_), @$choices_auto) and return $_ foreach @$choices;
- return $choices->[0]; #- theoretically unreachable, but at least try to fallback on something usable
- };
my $closure_removal = sub {
$urpm->{state}{ask_remove} = {};
my $db = db();
@@ -532,34 +526,29 @@ or you already installed all of them."));
}
@nodes = difference2(\@nodes, \@bad_i18n_pkgs);
}
+ my @requested;
slow_func($tree->window,
- sub { $urpm->resolve_requested(db(), $urpm->{state}, { map { $pkgs->{$_}{pkg}->id => 1 } @nodes },
- callback_choices => $callback_choices, no_flag_update => 1, keep_state => 1) });
+ sub { @requested = $urpm->resolve_requested(db(), $urpm->{state},
+ { map { $pkgs->{$_}{pkg}->id => 1 } @nodes },
+ callback_choices => $callback_choices) });
my @conflict;
- my $pkg_sel_after_selection = sub {
- if (%{$urpm->{state}{ask_unselect} || {}}) {
- foreach my $p (keys %{$urpm->{state}{ask_unselect}}) {
- push @conflict, [ my_fullname($urpm->{depslist}[$p]),
- [ map { my_fullname($urpm->{depslist}[$_]) } keys %{$urpm->{state}{ask_unselect}{$p}} ] ];
- }
- delete @{$urpm->{state}{selected}}{keys %{delete $urpm->{state}{ask_unselect}}};
+ if (%{$urpm->{state}{ask_unselect} || {}}) {
+ print "ask_unselect! (currently unavailable!?)\n";
+ foreach my $p (keys %{$urpm->{state}{ask_unselect}}) {
+ push @conflict, [ my_fullname($urpm->{depslist}[$p]),
+ [ map { my_fullname($urpm->{depslist}[$_]) } keys %{$urpm->{state}{ask_unselect}{$p}} ] ];
}
- @nodes_with_deps = map { my_fullname($urpm->{depslist}[$_]) } keys %{$urpm->{state}{selected}};
- };
- $pkg_sel_after_selection->();
+ delete @{$urpm->{state}{selected}}{keys %{delete $urpm->{state}{ask_unselect}}};
+ }
+ @nodes_with_deps = map { my_fullname($_) } @requested;
if (!$deps_msg->(N("Additional packages needed"),
N("To satisfy dependencies, the following package(s) also need\nto be installed:\n\n"),
\@nodes, \@nodes_with_deps)) {
@nodes_with_deps = ();
+ $urpm->disable_selected(db(), $urpm->{state}, @requested);
goto packages_selection_ok;
}
- $choices_auto = \@nodes_with_deps;
- $urpm->{state}{selected} = {};
- slow_func($tree->window,
- sub { $urpm->resolve_requested(db(), $urpm->{state}, { map { $pkgs->{$_}{pkg}->id => 1 } @nodes },
- callback_choices => $callback_choices_auto) });
- $pkg_sel_after_selection->();
if (my @cant = difference2(\@nodes, \@nodes_with_deps)) {
interactive_msg_(N("Some packages can't be installed"),
N("Sorry, the following package(s) can't be selected:\n\n%s\n\nReasons follow:\n\n%s",
@@ -572,22 +561,18 @@ or you already installed all of them."));
}
packages_selection_ok:
} else {
- $urpm->{state}{unselected} = {};
+ my @unrequested;
slow_func($tree->window,
- sub { $urpm->resolve_unrequested(db(), $urpm->{state},
- { map { $pkgs->{$_}{pkg}->id => undef } @nodes },
- no_flag_update => 1) });
- @nodes_with_deps = map { my_fullname($urpm->{depslist}[$_]) } keys %{$urpm->{state}{unselected}};
+ sub { @unrequested = $urpm->disable_selected(db(), $urpm->{state},
+ map { $pkgs->{$_}{pkg} } @nodes) });
+ @nodes_with_deps = map { my_fullname($_) } @unrequested;
if (!$deps_msg->(N("Some packages need to be removed"),
N("Because of their dependencies, the following package(s) must be\nunselected now:\n\n"),
\@nodes, \@nodes_with_deps)) {
@nodes_with_deps = ();
+ $urpm->resolve_requested(db(), $urpm->{state}, { map { $_->id => 1 } @unrequested });
goto packages_unselection_ok;
}
- slow_func($tree->window,
- sub { $urpm->resolve_unrequested(db(), $urpm->{state},
- { map { $pkgs->{$_}{pkg}->id => undef } @nodes }) });
- @nodes_with_deps = map { my_fullname($urpm->{depslist}[$_]) } keys %{$urpm->{state}{unselected}};
packages_unselection_ok:
}
}
diff --git a/rpmdrake.spec b/rpmdrake.spec
index 9e476eee..b5906ecd 100644
--- a/rpmdrake.spec
+++ b/rpmdrake.spec
@@ -16,7 +16,7 @@ Release: %{release}
License: GPL
Source0: rpmdrake.tar.bz2
Summary: Mandrake Linux graphical front end for choosing packages for installion/removal
-Requires: perl-MDK-Common >= 1.0.4-13mdk gurpmi >= 4.3-9mdk perl-URPM >= 0.84 drakxtools >= 9.1-0.12mdk rpmtools >= 4.5
+Requires: perl-MDK-Common >= 1.0.4-13mdk gurpmi >= 4.3-9mdk perl-URPM >= 0.90-7mdk drakxtools >= 9.1-0.12mdk rpmtools >= 4.5
Requires: perl-GTK2 > 0.0.cvs.2003.02.12.1-2mdk perl-Locale-gettext >= 1.01-7mdk
BuildRequires: libcurl2-devel >= 7.10.3-2mdk gettext openssl-devel perl-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
@@ -103,6 +103,7 @@ rm -rf $RPM_BUILD_ROOT
- rpmdrake: at install time, when some local files are impossible
to find, list which one (asked by Gerard Delafond <gerard at
delafond.org>)
+- rpmdrake: new perl-URPM api
* Fri May 30 2003 Guillaume Cottenceau <gc@mandrakesoft.com> 2.1-22mdk
- fix media/medias by medium/media