aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2019-06-17 21:18:10 +0200
committerThierry Vignaud <thierry.vignaud@gmail.com>2019-06-17 21:19:50 +0200
commitce208c3c2a39966e38048eb66612ba87346d59d1 (patch)
tree6936f10482afa197d360a2e51272255882490c1a
parent56294bf35dd9ac610d31e4eae9e7053d7b4dea10 (diff)
downloadrpmdrake-ce208c3c2a39966e38048eb66612ba87346d59d1.tar
rpmdrake-ce208c3c2a39966e38048eb66612ba87346d59d1.tar.gz
rpmdrake-ce208c3c2a39966e38048eb66612ba87346d59d1.tar.bz2
rpmdrake-ce208c3c2a39966e38048eb66612ba87346d59d1.tar.xz
rpmdrake-ce208c3c2a39966e38048eb66612ba87346d59d1.zip
honor /etc/urpmi/prefer.vendor.list (mga#24309)
aka reuse urpmi code so that the best choice is the first/default one
-rw-r--r--NEWS2
-rw-r--r--Rpmdrake/gui.pm5
2 files changed, 5 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index ec1da2cc..f6555608 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,5 @@
+- honor /etc/urpmi/prefer.vendor.list (mga#24309)
+
Version 6.29 - 20 May 2019, Thomas Backlund
- update translations
diff --git a/Rpmdrake/gui.pm b/Rpmdrake/gui.pm
index 7cf196f6..e686fc71 100644
--- a/Rpmdrake/gui.pm
+++ b/Rpmdrake/gui.pm
@@ -703,7 +703,9 @@ sub is_locale_available {
}
sub callback_choices {
- my (undef, undef, undef, $choices) = @_;
+ my ($urpm, undef, undef, $choices) = @_;
+ my ($prefered, $other) = urpm::select::get_preferred($urpm, $choices, undef);
+ $choices = [ @$prefered, @$other ];
return $choices->[0] if $::rpmdrake_options{auto};
foreach my $pkg (@$choices) {
foreach ($pkg->requires_nosense) {
@@ -712,7 +714,6 @@ sub callback_choices {
}
}
my $callback = sub { interactive_msg(N("More information on package..."), get_info($_[0]), scroll => 1) };
- $choices = [ sort { $a->name cmp $b->name } @$choices ];
my @choices = interactive_list_(N("Please choose"), (scalar(@$choices) == 1 ?
N("The following package is needed:") : N("One of the following packages is needed:")),
[ map { urpm_name($_) } @$choices ], $callback, nocancel => 1);