From 50c294bd92c9f88efb2d3e9dca402d88e9661a86 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 28 Oct 2008 13:52:22 +0000 Subject: - urpmi o fix "urpmi firefox mozilla-firefox-ext-google-toolbar ; urpme --auto-orphans mozilla-firefox-ext-google-toolbar" which must not remove firefox (cf #45054) (this is especially bad for DrakX/rpmsrate) --- MANIFEST | 4 ++++ NEWS | 6 ++++++ t/data/SPECS/orphans-1/u1.spec | 14 ++++++++++++++ t/data/SPECS/orphans-1/u2.spec | 13 +++++++++++++ t/data/SPECS/orphans-1/u3.spec | 13 +++++++++++++ t/data/SPECS/orphans-1/u4.spec | 14 ++++++++++++++ t/superuser--orphans.t | 5 +++++ urpm/orphans.pm | 5 +++-- 8 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 t/data/SPECS/orphans-1/u1.spec create mode 100644 t/data/SPECS/orphans-1/u2.spec create mode 100644 t/data/SPECS/orphans-1/u3.spec create mode 100644 t/data/SPECS/orphans-1/u4.spec diff --git a/MANIFEST b/MANIFEST index b6a58592..6d9e0abd 100644 --- a/MANIFEST +++ b/MANIFEST @@ -223,6 +223,10 @@ t/data/SPECS/orphans-1/ss1.spec t/data/SPECS/orphans-1/ss2.spec t/data/SPECS/orphans-1/t.spec t/data/SPECS/orphans-1/tt1.spec +t/data/SPECS/orphans-1/u1.spec +t/data/SPECS/orphans-1/u2.spec +t/data/SPECS/orphans-1/u3.spec +t/data/SPECS/orphans-1/u4.spec t/data/SPECS/orphans-2/a-2.spec t/data/SPECS/orphans-2/bb-2.spec t/data/SPECS/orphans-2/c-2.spec diff --git a/NEWS b/NEWS index d13251f6..7bb0498e 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,9 @@ +- urpmi + o fix "urpmi firefox mozilla-firefox-ext-google-toolbar ; + urpme --auto-orphans mozilla-firefox-ext-google-toolbar" which must not + remove firefox (cf #45054) + (this is especially bad for DrakX/rpmsrate) + Version 6.14.10 - 23 October 2008 - urpmi, gurpmi diff --git a/t/data/SPECS/orphans-1/u1.spec b/t/data/SPECS/orphans-1/u1.spec new file mode 100644 index 00000000..cfdfe60a --- /dev/null +++ b/t/data/SPECS/orphans-1/u1.spec @@ -0,0 +1,14 @@ +Summary: x +Name: u1 +Version: 1 +Release: 1 +License: x +Group: x +Url: x +Requires: u2 +BuildRoot: %{_tmppath}/%{name} + +%description +x + +%files diff --git a/t/data/SPECS/orphans-1/u2.spec b/t/data/SPECS/orphans-1/u2.spec new file mode 100644 index 00000000..556b628f --- /dev/null +++ b/t/data/SPECS/orphans-1/u2.spec @@ -0,0 +1,13 @@ +Summary: x +Name: u2 +Version: 1 +Release: 1 +License: x +Group: x +Url: x +BuildRoot: %{_tmppath}/%{name} + +%description +x + +%files diff --git a/t/data/SPECS/orphans-1/u3.spec b/t/data/SPECS/orphans-1/u3.spec new file mode 100644 index 00000000..f9c12a83 --- /dev/null +++ b/t/data/SPECS/orphans-1/u3.spec @@ -0,0 +1,13 @@ +Summary: x +Name: u3 +Version: 1 +Release: 1 +License: x +Group: x +Url: x +BuildRoot: %{_tmppath}/%{name} + +%description +x + +%files diff --git a/t/data/SPECS/orphans-1/u4.spec b/t/data/SPECS/orphans-1/u4.spec new file mode 100644 index 00000000..5c84b88c --- /dev/null +++ b/t/data/SPECS/orphans-1/u4.spec @@ -0,0 +1,14 @@ +Summary: x +Name: u4 +Version: 1 +Release: 1 +License: x +Group: x +Url: x +Requires: u3 +BuildRoot: %{_tmppath}/%{name} + +%description +x + +%files diff --git a/t/superuser--orphans.t b/t/superuser--orphans.t index 79bd67eb..53c0c210 100644 --- a/t/superuser--orphans.t +++ b/t/superuser--orphans.t @@ -20,6 +20,8 @@ # # req-a requires a, req-b requires b... # +# u1 requires u2, u4 requires u3 +# use strict; use lib '.', 't'; use helper; @@ -40,6 +42,9 @@ set_urpmi_cfg_global_options({ 'nb-of-new-unrequested-pkgs-between-auto-select-o test_urpme_v1(['h'], 'h', ''); test_urpme_v1(['hh', 'h'], 'h', 'hh'); +test_urpme_v1(['u1 u2'], 'u1', 'u2'); +test_urpme_v1(['u3 u4'], 'u4', 'u3'); + test_auto_select_both('a', '', 'a-2'); test_auto_select_both('b', '', 'bb-2'); test_auto_select_both('c', 'cc', 'c-2 cc-1'); diff --git a/urpm/orphans.pm b/urpm/orphans.pm index 57cda207..b298eb89 100644 --- a/urpm/orphans.pm +++ b/urpm/orphans.pm @@ -78,8 +78,9 @@ sub _selected_unrequested { require urpm::select; map { if (my $from = $selected->{$_}{from}) { - my $name = $urpm->{depslist}[$_]->name; - urpm::select::was_pkg_name_installed($rejected, $name) ? () : + my $pkg = $urpm->{depslist}[$_]; + my $name = $pkg->name; + $pkg->flag_requested || urpm::select::was_pkg_name_installed($rejected, $name) ? () : ($name => "(required by " . $from->fullname . ")"); } elsif ($selected->{$_}{suggested}) { ($urpm->{depslist}[$_]->name => "(suggested)"); -- cgit v1.2.1