summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-pkg/depcache.cc6
-rwxr-xr-xtest/integration/test-prefer-native-architecture-over-higher-priority25
2 files changed, 28 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/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