summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Langasek <steve.langasek@canonical.com>2013-03-01 17:54:57 -0800
committerSteve Langasek <steve.langasek@canonical.com>2013-03-01 17:54:57 -0800
commitd70f2b7822fce220f85fe63f85fe920dad452d8a (patch)
treef4aa028252800f6e1d0b41da66601537f84b084e
parent68225779d1337336707c33c0265fc537ae256813 (diff)
* Cherry-pick from David's sid branch to fix a multiarch library
installation problem: * apt-pkg/depcache.cc: - prefer to install packages which have an already installed M-A:same sibling while choosing providers (LP: #1130419)
-rw-r--r--apt-pkg/depcache.cc31
-rw-r--r--debian/changelog12
-rwxr-xr-xtest/integration/test-ubuntu-bug-1130419-prefer-installed-ma-same-siblings104
3 files changed, 147 insertions, 0 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc
index 2ec346f0b..a48cd8b0c 100644
--- a/apt-pkg/depcache.cc
+++ b/apt-pkg/depcache.cc
@@ -951,6 +951,37 @@ struct CompareProviders {
{
pkgCache::PkgIterator const A = AV.ParentPkg();
pkgCache::PkgIterator const B = BV.ParentPkg();
+ // Prefer MA:same packages if other architectures for it are installed
+ if ((AV->MultiArch & pkgCache::Version::Same) == pkgCache::Version::Same ||
+ (BV->MultiArch & pkgCache::Version::Same) == pkgCache::Version::Same)
+ {
+ bool instA = false;
+ if ((AV->MultiArch & pkgCache::Version::Same) == pkgCache::Version::Same)
+ {
+ pkgCache::GrpIterator Grp = A.Group();
+ for (pkgCache::PkgIterator P = Grp.PackageList(); P.end() == false; P = Grp.NextPkg(P))
+ if (P->CurrentVer != 0)
+ {
+ instA = true;
+ break;
+ }
+ }
+ bool instB = false;
+ if ((BV->MultiArch & pkgCache::Version::Same) == pkgCache::Version::Same)
+ {
+ pkgCache::GrpIterator Grp = B.Group();
+ for (pkgCache::PkgIterator P = Grp.PackageList(); P.end() == false; P = Grp.NextPkg(P))
+ {
+ if (P->CurrentVer != 0)
+ {
+ instB = true;
+ break;
+ }
+ }
+ }
+ if (instA != instB)
+ return instA == false;
+ }
// Prefer packages in the same group as the target; e.g. foo:i386, foo:amd64
if (A->Group != B->Group)
{
diff --git a/debian/changelog b/debian/changelog
index 129160e10..ba467757f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,15 @@
+apt (0.9.7.7ubuntu2) UNRELEASED; urgency=low
+
+ * Cherry-pick from David's sid branch to fix a multiarch library
+ installation problem:
+
+ [ David Kalnischkies ]
+ * apt-pkg/depcache.cc:
+ - prefer to install packages which have an already installed M-A:same
+ sibling while choosing providers (LP: #1130419)
+
+ -- Steve Langasek <steve.langasek@ubuntu.com> Fri, 01 Mar 2013 17:29:12 -0800
+
apt (0.9.7.7ubuntu1) raring; urgency=low
* Merge from Debian unstable, pulling in new translations and fixes.
diff --git a/test/integration/test-ubuntu-bug-1130419-prefer-installed-ma-same-siblings b/test/integration/test-ubuntu-bug-1130419-prefer-installed-ma-same-siblings
new file mode 100755
index 000000000..af6b7b504
--- /dev/null
+++ b/test/integration/test-ubuntu-bug-1130419-prefer-installed-ma-same-siblings
@@ -0,0 +1,104 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture 'amd64' 'i386'
+
+insertpackage 'stable' 'libmesa' 'amd64,i386' '1' 'Multi-Arch: same'
+insertpackage 'stable' 'libmesa-lts' 'amd64,i386' '1' 'Provides: libmesa
+Conflicts: libmesa
+Multi-Arch: same'
+insertpackage 'stable' 'steam' 'i386' '1' 'Depends: libmesa'
+
+insertpackage 'unstable' 'libmesa' 'amd64,i386' '2' 'Multi-Arch: same'
+insertpackage 'unstable' 'libmesa-lts' 'amd64,i386' '2' 'Provides: libmesa
+Conflicts: libmesa
+Multi-Arch: same'
+insertpackage 'unstable' 'steam' 'i386' '2' 'Depends: libmesa'
+
+setupaptarchive
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following extra packages will be installed:
+ libmesa:i386
+The following NEW packages will be installed:
+ libmesa:i386 steam:i386
+0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+Inst libmesa:i386 (1 stable [i386])
+Inst steam:i386 (1 stable [i386])
+Conf libmesa:i386 (1 stable [i386])
+Conf steam:i386 (1 stable [i386])' aptget install steam -st stable
+testequal 'Reading package lists...
+Building dependency tree...
+The following extra packages will be installed:
+ libmesa:i386
+The following NEW packages will be installed:
+ libmesa:i386 steam:i386
+0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+Inst libmesa:i386 (2 unstable [i386])
+Inst steam:i386 (2 unstable [i386])
+Conf libmesa:i386 (2 unstable [i386])
+Conf steam:i386 (2 unstable [i386])' aptget install steam -st unstable
+
+cp rootdir/var/lib/dpkg/status default-status.dpkg
+insertinstalledpackage 'libmesa' 'amd64' '1' 'Multi-Arch: same'
+testequal 'Reading package lists...
+Building dependency tree...
+The following extra packages will be installed:
+ libmesa:i386
+The following NEW packages will be installed:
+ libmesa:i386 steam:i386
+0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+Inst libmesa:i386 (1 stable [i386])
+Inst steam:i386 (1 stable [i386])
+Conf libmesa:i386 (1 stable [i386])
+Conf steam:i386 (1 stable [i386])' aptget install steam -st stable
+testequal 'Reading package lists...
+Building dependency tree...
+The following extra packages will be installed:
+ libmesa libmesa:i386
+The following NEW packages will be installed:
+ libmesa:i386 steam:i386
+The following packages will be upgraded:
+ libmesa
+1 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+Inst libmesa [1] (2 unstable [amd64])
+Inst libmesa:i386 (2 unstable [i386])
+Inst steam:i386 (2 unstable [i386])
+Conf libmesa (2 unstable [amd64])
+Conf libmesa:i386 (2 unstable [i386])
+Conf steam:i386 (2 unstable [i386])' aptget install steam -st unstable
+
+cp default-status.dpkg rootdir/var/lib/dpkg/status
+insertinstalledpackage 'libmesa-lts' 'amd64' '1' 'Provides: libmesa
+Conflicts: libmesa
+Multi-Arch: same'
+testequal 'Reading package lists...
+Building dependency tree...
+The following extra packages will be installed:
+ libmesa-lts:i386
+The following NEW packages will be installed:
+ libmesa-lts:i386 steam:i386
+0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+Inst libmesa-lts:i386 (1 stable [i386])
+Inst steam:i386 (1 stable [i386])
+Conf libmesa-lts:i386 (1 stable [i386])
+Conf steam:i386 (1 stable [i386])' aptget install steam -st stable
+testequal 'Reading package lists...
+Building dependency tree...
+The following extra packages will be installed:
+ libmesa-lts libmesa-lts:i386
+The following NEW packages will be installed:
+ libmesa-lts:i386 steam:i386
+The following packages will be upgraded:
+ libmesa-lts
+1 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+Inst libmesa-lts [1] (2 unstable [amd64])
+Inst libmesa-lts:i386 (2 unstable [i386])
+Inst steam:i386 (2 unstable [i386])
+Conf libmesa-lts (2 unstable [amd64])
+Conf libmesa-lts:i386 (2 unstable [i386])
+Conf steam:i386 (2 unstable [i386])' aptget install steam -st unstable