summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-pkg/depcache.cc16
-rw-r--r--debian/changelog9
-rw-r--r--methods/rred.cc8
-rwxr-xr-xtest/integration/test-implicit-conflicts-real-not-virtual40
4 files changed, 65 insertions, 8 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc
index 0dbedf323..0f4715fad 100644
--- a/apt-pkg/depcache.cc
+++ b/apt-pkg/depcache.cc
@@ -374,11 +374,17 @@ bool pkgDepCache::CheckDep(DepIterator Dep,int Type,PkgIterator &Res)
PkgIterator Pkg = Dep.ParentPkg();
for (; P.end() != true; ++P)
{
- /* Provides may never be applied against the same package (or group)
- if it is a conflicts. See the comment above. */
- if (P.OwnerPkg()->Group == Pkg->Group && Dep.IsNegative() == true)
- continue;
-
+ if (Dep.IsNegative() == true)
+ {
+ /* Provides may never be applied against the same package (or group)
+ if it is a conflicts. See the comment above. */
+ if (P.OwnerPkg()->Group == Pkg->Group)
+ continue;
+ // Implicit group-conflicts should not be applied on providers of other groups
+ if (Pkg->Group == Dep.TargetPkg()->Group && P.OwnerPkg()->Group != Pkg->Group)
+ continue;
+ }
+
// Check if the provides is a hit
if (Type == NowVersion)
{
diff --git a/debian/changelog b/debian/changelog
index c49c56bca..7ed580d3f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+apt (0.8.16~exp10) UNRELEASED; urgency=low
+
+ [ David Kalnischkies ]
+ * apt-pkg/depcache.cc:
+ - implicit conflicts (for multiarch) are supposed to conflict
+ only with real packages, not with virtual providers
+
+ -- David Kalnischkies <kalnischkies@gmail.com> Wed, 11 Jan 2012 17:59:33 +0100
+
apt (0.8.16~exp9ubuntu1) UNRELEASED; urgency=low
* merge from debian/experimental:
diff --git a/methods/rred.cc b/methods/rred.cc
index bf9294d96..e37a12ed9 100644
--- a/methods/rred.cc
+++ b/methods/rred.cc
@@ -235,7 +235,9 @@ RredMethod::State RredMethod::patchMMap(FileFd &Patch, FileFd &From, /*{{{*/
MMap ed_cmds(Patch, MMap::ReadOnly);
MMap in_file(From, MMap::ReadOnly);
- if (ed_cmds.Size() == 0 || in_file.Size() == 0)
+ unsigned long long const ed_size = ed_cmds.Size();
+ unsigned long long const in_size = in_file.Size();
+ if (ed_size == 0 || in_size == 0)
return MMAP_FAILED;
EdCommand* commands = 0;
@@ -244,10 +246,10 @@ RredMethod::State RredMethod::patchMMap(FileFd &Patch, FileFd &From, /*{{{*/
const char* begin = (char*) ed_cmds.Data();
const char* end = begin;
- const char* ed_end = (char*) ed_cmds.Data() + ed_cmds.Size();
+ const char* ed_end = (char*) ed_cmds.Data() + ed_size;
const char* input = (char*) in_file.Data();
- const char* input_end = (char*) in_file.Data() + in_file.Size();
+ const char* input_end = (char*) in_file.Data() + in_size;
size_t i;
diff --git a/test/integration/test-implicit-conflicts-real-not-virtual b/test/integration/test-implicit-conflicts-real-not-virtual
new file mode 100755
index 000000000..9d13e1709
--- /dev/null
+++ b/test/integration/test-implicit-conflicts-real-not-virtual
@@ -0,0 +1,40 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture 'amd64' 'i386'
+
+insertpackage 'unstable-mp' 'crda' 'i386,amd64' '1.1.1-1ubuntu4mp' 'Provides: wireless-crda
+Multi-Arch: foreign'
+insertpackage 'unstable-m' 'crda' 'i386,amd64' '1.1.1-1ubuntu4m' 'Multi-Arch: foreign'
+insertpackage 'unstable-p' 'crda' 'i386,amd64' '1.1.1-1ubuntu4p' 'Provides: wireless-crda'
+
+insertinstalledpackage 'wireless-crda' 'amd64' '1.14'
+
+setupaptarchive
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+ crda
+0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+Inst crda (1.1.1-1ubuntu4m unstable-m [amd64])
+Conf crda (1.1.1-1ubuntu4m unstable-m [amd64])' aptget install crda -s -t unstable-m
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+ crda
+0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+Inst crda (1.1.1-1ubuntu4p unstable-p [amd64])
+Conf crda (1.1.1-1ubuntu4p unstable-p [amd64])' aptget install crda -s -t unstable-p
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+ crda
+0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+Inst crda (1.1.1-1ubuntu4mp unstable-mp [amd64])
+Conf crda (1.1.1-1ubuntu4mp unstable-mp [amd64])' aptget install crda -s -t unstable-mp