From a0c167908bc5dc7005146037b583a3ab4c6ce741 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 28 Sep 2007 11:49:06 +0000 Subject: - package promotion must respect strict_arch --- NEWS | 1 + URPM/Resolve.pm | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 99dccf5..77f4862 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,4 @@ +- package promotion must respect strict_arch - enhance sorted graph by better taking into account conflicts from state->{rejected} (fixes "big transaction" in urpmi split-transactions--strict-require.t test) diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm index 8a1d057..a6ef9d0 100644 --- a/URPM/Resolve.pm +++ b/URPM/Resolve.pm @@ -90,6 +90,16 @@ sub strict_arch_check_installed { } 1; } +sub strict_arch_check { + my ($installed_pkg, $pkg) = @_; + if ($pkg->arch ne 'src' && $pkg->arch ne 'noarch') { + my $n = $pkg->name; + if ($installed_pkg->arch ne 'noarch') { + $pkg->arch eq $installed_pkg->arch or return; + } + } + 1; +} sub _is_selected_or_installed { my ($urpm, $db, $name) = @_; @@ -1026,6 +1036,7 @@ sub _handle_diff_provides { @packages = grep { ($_->name eq $p->name ? $_->fullname ne $p->fullname : $_->obsoletes_overlap($p->name . " == " . $p->epoch . ":" . $p->version . "-" . $p->release)) + && (!strict_arch($urpm) || strict_arch_check($p, $_)) && _no_unsatisfied_requires($urpm, $db, $state, $_, $n) } @packages; @@ -1036,8 +1047,9 @@ sub _handle_diff_provides { && $_->is_arch_compat && !exists $state->{rejected}->{$_->fullname} && $_->obsoletes_overlap($p->name . " == " . $p->epoch . ":" . $p->version . "-" . $p->release) - && $_->fullname ne $p->fullname && - _no_unsatisfied_requires($urpm, $db, $state, $_, $n); + && $_->fullname ne $p->fullname + && (!strict_arch($urpm) || strict_arch_check($p, $_)) + && _no_unsatisfied_requires($urpm, $db, $state, $_, $n); } @packages; } -- cgit v1.2.1