Hi,
On Thu, Feb 12, 2015 at 11:25:33AM +0100, Johannes Schauer wrote:
apt in unstable/jessie fails to satisfy binary dependencies of the form
package:arch if arch happens to be the native architecture.
As briefly discussed on IRC, this happens also for /experimental, but it
happens only on single-architecture systems, multi-arch enabled systems
aren't effected.
The problem is a single-arch special casing generating incorrect
dependencies, which for foreign dependencies still means they are
unsatisfiable, but native ones are, too. This is especially true for
negative arch-specific dependencies, which do not match a native
conflict partner and hence trick apt into ignoring these conflicts.
Neither is really a problem for jessie as such dependencies do not exist
there. Even sid has only one such package: botch - maintained by the
bugreporter himself.
In terms of upgrade ability to stretch later on it might be beneficial
to apply this to jessie – after all, we can't botch the upgrade for all
botch users… ;)
The patch is 'trivial' one-line - the also included update to the
testcases to look for this and similar issues blows it out of proportion
through, but that can be skipped as it isn't run at buildtime.
Best regards
David Kalnischkies
commit 596ec43ce34421080a58b28299c1ed9cb0dbaa25
Author: David Kalnischkies da...@kalnischkies.de
Date: Sun Apr 12 19:16:01 2015 +0200
parse specific-arch dependencies correctly on single-arch systems
On single-arch the parsing was creating groupnames like 'apt:amd64' even
through it should be 'apt' and a package in it belonging to architecture
amd64. The result for foreign architectures was as expected: The
dependency isn't satisfiable, but for native architecture it means the
wrong package (ala apt:amd64:amd64) is linked so this is also not
satisfiable, which is very much not expected.
No longer excluding single-arch from this codepath allows the generation
of the correct links, which still link to non-exisiting packages for
foreign dependencies, but natives link to the expected native package
just as if no architecture was given.
For negative arch-specific dependencies ala Conflicts this matter was
worse as apt will believe there isn't a Conflict to resolve, tricking it
into calculating a solution dpkg will refuse.
Architecture specific positive dependencies are rare in jessie – the
only one in amd64 main is foreign –, negative dependencies do not even
exist. Neither class has a native specimen, so no package in jessie is
effected by this bug, but it might be interesting for stretch upgrades.
This also means the regression potential is very low.
Closes: 60
diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc
index 4eef66c..213235c 100644
--- a/apt-pkg/deb/deblistparser.cc
+++ b/apt-pkg/deb/deblistparser.cc
@@ -770,7 +770,7 @@ bool debListParser::ParseDepends(pkgCache::VerIterator Ver,
if (NewDepends(Ver,Package,none,Version,Op,Type) == false)
return false;
}
- else if (MultiArchEnabled == true found != string::npos
+ else if (found != string::npos
strcmp(Package.c_str() + found, :any) != 0)
{
string Arch = Package.substr(found+1, string::npos);
diff --git a/test/integration/test-multiarch-foreign b/test/integration/test-multiarch-foreign
index 332466d..240f1a4 100755
--- a/test/integration/test-multiarch-foreign
+++ b/test/integration/test-multiarch-foreign
@@ -7,9 +7,13 @@ setupenvironment
configarchitecture 'amd64' 'i386' 'armel'
insertpackage 'unstable' 'cool-foo' 'amd64,i386' '1.0' 'Depends: foo'
+insertpackage 'unstable' 'cool-foo-x64' 'amd64' '1.0' 'Depends: foo:amd64'
+insertpackage 'unstable' 'cool-foo-x32' 'amd64' '1.0' 'Depends: foo:i386'
insertpackage 'unstable' 'foo' 'amd64,i386,armel' '1.0' 'Multi-Arch: foreign'
insertpackage 'unstable' 'cool-bar' 'amd64,i386' '1.0' 'Depends: bar-provider'
+insertpackage 'unstable' 'cool-bar-x64' 'amd64' '1.0' 'Depends: bar-provider:amd64'
+insertpackage 'unstable' 'cool-bar-x32' 'amd64' '1.0' 'Depends: bar-provider:i386'
insertpackage 'unstable' 'bar' 'amd64,i386,armel' '1.0' 'Provides: bar-provider
Multi-Arch: foreign'
@@ -29,28 +33,6 @@ Conf cool-foo:i386 (1.0 unstable [i386])' aptget install cool-foo:i386 -s
testequal 'Reading package lists...
Building dependency tree...
-The following extra packages will be installed:
- foo
-The following NEW packages will be installed:
- cool-foo foo
-0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
-Inst foo (1.0 unstable [amd64])
-Inst cool-foo (1.0 unstable [amd64])
-Conf foo (1.0 unstable [amd64])
-Conf cool-foo (1.0 unstable [amd64])' aptget install cool-foo:amd64 -s
-
-testequal 'Reading package lists...
-Building dependency tree...
-The following NEW packages will be installed:
- cool-foo foo
-0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
-Inst