summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2013-07-18 11:54:18 +0200
committerThierry Vignaud <thierry.vignaud@gmail.com>2013-10-04 09:25:34 +0200
commiteab0b8fad2892d12aa3976678638db455a611e31 (patch)
tree84836edcebe682ccdef80bd9a49062583b368c40
parent54cf0644e689d0ed007fc3bf918212f1f493231a (diff)
downloadurpmi-eab0b8fad2892d12aa3976678638db455a611e31.tar
urpmi-eab0b8fad2892d12aa3976678638db455a611e31.tar.gz
urpmi-eab0b8fad2892d12aa3976678638db455a611e31.tar.bz2
urpmi-eab0b8fad2892d12aa3976678638db455a611e31.tar.xz
urpmi-eab0b8fad2892d12aa3976678638db455a611e31.zip
adapt to perl-5.18's random hash keys ordering
(translate_why_removed_one) ensure we got the right reason (testsuite) adapt to new URPM predictible behaviour it was previously relying on the following fixed hash order: $ perl -MData::Dumper -e 'warn Dumper [ keys {'rr1', 'rr1', 'rr2', 'rr2'} ]; \ warn Dumper [ keys {'bb1', 'bb1', 'bb2', 'bb2-1'} ]' $VAR1 = [ 'rr2', 'rr1' ]; $VAR1 = [ 'bb1', 'bb2' ];
-rw-r--r--NEWS1
-rw-r--r--t/superuser--orphans.t4
-rw-r--r--urpm/select.pm2
3 files changed, 4 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index e6eaafbb..ca453190 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,5 @@
- library:
+ o adapt to perl-5.18
o prevent disabling removing orphan if we failed to detect running kernel
version
diff --git a/t/superuser--orphans.t b/t/superuser--orphans.t
index 68f10ff3..30c16477 100644
--- a/t/superuser--orphans.t
+++ b/t/superuser--orphans.t
@@ -57,11 +57,11 @@ test_auto_select_both('l', 'll', 'l-2 ll-1');
test_auto_select_both('m', 'mm', 'm-2 mm-2');
test_auto_select_both('n', 'nn', 'n-2 nn-2');
test_auto_select_both('o', 'oo1', 'o-2 oo2-2');
-test_auto_select_both('r', 'rr2', 'r-2', 'rr2-1');
+test_auto_select_both('r', 'rr1', 'r-2', 'rr1-1');
test_auto_select_both('s', 'ss1 ss2', 's-2 ss1-1 ss2-1');
test_auto_select_both('t', 'tt1', 't-2 tt2-2', 'tt1-1');
-test_auto_select(['r', 'rr1'], 'r rr1 rr2', 'r-2 rr1-1', 'rr2-1');
+test_auto_select(['r', 'rr2'], 'r rr1 rr2', 'r-2 rr2-1', 'rr1-1');
#test_auto_select(['s ss1'], 's ss1 ss2', 's-2 ss1-1', 'ss2-1'); # this fails, but that's ok
test_urpme(['g'], 'g', 'g', '');
diff --git a/urpm/select.pm b/urpm/select.pm
index 507f82c0..03259f71 100644
--- a/urpm/select.pm
+++ b/urpm/select.pm
@@ -694,7 +694,7 @@ sub translate_why_removed_one {
my $closure = rejected_closure($state, $fullname) or return $fullname;
my ($from) = keys %$closure;
- my ($whyk) = keys %{$closure->{$from}};
+ my ($whyk) = sort { $b ne 'avoid' } keys %{$closure->{$from}};
my $whyv = $closure->{$from}{$whyk};
my $frompkg = $urpm->search($from, strict_fullname => 1);
my $s = do {