aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-09-28 11:49:06 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-09-28 11:49:06 +0000
commita0c167908bc5dc7005146037b583a3ab4c6ce741 (patch)
treed388b7343e7da29ad0db8891a116ef556b79be0c
parentb0000f628fc9dbbf4c80697e4315f727cad3e657 (diff)
downloadperl-URPM-a0c167908bc5dc7005146037b583a3ab4c6ce741.tar
perl-URPM-a0c167908bc5dc7005146037b583a3ab4c6ce741.tar.gz
perl-URPM-a0c167908bc5dc7005146037b583a3ab4c6ce741.tar.bz2
perl-URPM-a0c167908bc5dc7005146037b583a3ab4c6ce741.tar.xz
perl-URPM-a0c167908bc5dc7005146037b583a3ab4c6ce741.zip
- package promotion must respect strict_arch
-rw-r--r--NEWS1
-rw-r--r--URPM/Resolve.pm16
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;
}