summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-pkg/depcache.cc6
-rw-r--r--debian/changelog7
-rwxr-xr-xtest/integration/test-prefer-native-architecture-over-higher-priority25
3 files changed, 35 insertions, 3 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc
index 9f8422fec..08c1bd809 100644
--- a/apt-pkg/depcache.cc
+++ b/apt-pkg/depcache.cc
@@ -1002,9 +1002,6 @@ struct CompareProviders {
else if ((B->Flags & pkgCache::Flag::Important) == pkgCache::Flag::Important)
return true;
}
- // higher priority seems like a good idea
- if (AV->Priority != BV->Priority)
- return AV->Priority > BV->Priority;
// prefer native architecture
if (strcmp(A.Arch(), B.Arch()) != 0)
{
@@ -1019,6 +1016,9 @@ struct CompareProviders {
else if (*a == B.Arch())
return true;
}
+ // higher priority seems like a good idea
+ if (AV->Priority != BV->Priority)
+ return AV->Priority > BV->Priority;
// unable to decideā€¦
return A->ID < B->ID;
}
diff --git a/debian/changelog b/debian/changelog
index dfd15f50c..84322678a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+apt (0.9.9.1~ubuntu2) saucy; urgency=low
+
+ * Prefer native architecture over higher priority for providers (closes:
+ #718482).
+
+ -- Colin Watson <cjwatson@ubuntu.com> Thu, 01 Aug 2013 16:33:32 +0100
+
apt (0.9.9.1~ubuntu1) saucy; urgency=low
* merged from the debian/sid branch:
diff --git a/test/integration/test-prefer-native-architecture-over-higher-priority b/test/integration/test-prefer-native-architecture-over-higher-priority
new file mode 100755
index 000000000..2e5696376
--- /dev/null
+++ b/test/integration/test-prefer-native-architecture-over-higher-priority
@@ -0,0 +1,25 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture 'amd64' 'arm64'
+
+insertpackage 'unstable' 'm4' 'amd64' '1' 'Multi-Arch: foreign' 'optional'
+insertpackage 'unstable' 'm4' 'arm64' '1' 'Multi-Arch: foreign' 'standard'
+insertpackage 'unstable' 'autoconf' 'all' '1' 'Depends: m4'
+
+setupaptarchive
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following extra packages will be installed:
+ m4
+The following NEW packages will be installed:
+ autoconf m4
+0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+Inst m4 (1 unstable [amd64])
+Inst autoconf (1 unstable [all])
+Conf m4 (1 unstable [amd64])
+Conf autoconf (1 unstable [all])' aptget install autoconf -s