summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <mvo@ubuntu.com>2014-02-04 10:18:16 +0100
committerMichael Vogt <mvo@ubuntu.com>2014-02-04 10:18:16 +0100
commit0dfc7eef47519bd6b48ceaa4341b72ec40560988 (patch)
tree9955aaa4854c7deabcbac896b90edc437ee527b6
parent4afa7d18b37661996d188959ba7917824e1545d3 (diff)
Fix multiarch package upgrade issue
When checking for negative dependencies in MarkInstall() ensure that only dependencies that are relevant (i.e. getting installed) are checked.
-rw-r--r--apt-pkg/depcache.cc5
-rwxr-xr-xtest/integration/test-bug-multiarch-upgrade29
2 files changed, 34 insertions, 0 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc
index f9c891c86..a3bb4fd3d 100644
--- a/apt-pkg/depcache.cc
+++ b/apt-pkg/depcache.cc
@@ -1253,6 +1253,11 @@ bool pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst,
if (PkgState[Pkg->ID].InstallVer == 0)
continue;
+ /* Ignore negative dependencies that we are not going to
+ get installed */
+ if (PkgState[Pkg->ID].InstallVer != *I)
+ continue;
+
if ((Start->Version != 0 || TrgPkg != Pkg) &&
PkgState[Pkg->ID].CandidateVer != PkgState[Pkg->ID].InstallVer &&
PkgState[Pkg->ID].CandidateVer != *I &&
diff --git a/test/integration/test-bug-multiarch-upgrade b/test/integration/test-bug-multiarch-upgrade
new file mode 100755
index 000000000..dc3725df1
--- /dev/null
+++ b/test/integration/test-bug-multiarch-upgrade
@@ -0,0 +1,29 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture 'amd64' 'i386'
+
+insertinstalledpackage 'libcups2' 'amd64' '1' 'Multi-Arch: same'
+insertinstalledpackage 'libcups2' 'i386' '1' 'Multi-Arch: same'
+
+insertpackage 'unstable' 'libcups2' 'amd64' '0' 'Multi-Arch: same'
+insertpackage 'unstable' 'libcups2' 'amd64' '2' 'Multi-Arch: same'
+insertpackage 'unstable' 'libcups2' 'i386' '0' 'Multi-Arch: same'
+insertpackage 'unstable' 'libcups2' 'i386' '2' 'Multi-Arch: same'
+
+setupaptarchive
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following extra packages will be installed:
+ libcups2
+The following packages will be upgraded:
+ libcups2 libcups2:i386
+2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
+Inst libcups2 [1] (2 unstable [amd64]) [libcups2:amd64 on libcups2:i386] [libcups2:i386 on libcups2:amd64] [libcups2:i386 ]
+Inst libcups2:i386 [1] (2 unstable [i386])
+Conf libcups2 (2 unstable [amd64])
+Conf libcups2:i386 (2 unstable [i386])' aptget install -s libcups2:i386