diff options
author | David Kalnischkies <david@kalnischkies.de> | 2015-09-06 13:32:07 +0200 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2015-09-14 15:22:18 +0200 |
commit | 3addaba1ff6fe27cc96af5c2d345ee039c2bffec (patch) | |
tree | cfbaefb24f12aa82277e41029f07316490cae2b0 /test/integration/test-multiarch-foreign | |
parent | 921a962611dfbca7a72b2aa5c499b139dd27ae14 (diff) |
implement dpkgs vision of interpreting pkg:<arch> dependencies
How the Multi-Arch field and pkg:<arch> dependencies interact was
discussed at DebConf15 in the "MultiArch BoF". dpkg and apt (among other
tools like dose) had a different interpretation in certain scenarios
which we resolved by agreeing on dpkg view – and this commit realizes
this agreement in code.
As was the case so far libapt sticks to the idea of trying to hide
MultiArch as much as possible from individual frontends and instead
translates it to good old SingleArch. There are certainly situations
which can be improved in frontends if they know that MultiArch is upon
them, but these are improvements – not necessary changes needed
to unbreak a frontend.
The implementation idea is simple: If we parse a dependency on foo:amd64
the dependency is formed on a package 'foo:amd64' of arch 'any'. This
package is provided by package 'foo' of arch 'amd64', but not by 'foo'
of arch 'i386'. Both of those foo packages provide each other through
(assuming foo is M-A:foreign) to allow a dependency on 'foo' to be
satisfied by either foo of amd64 or i386. Packages can also declare to
provide 'foo:amd64' which is translated to providing 'foo:amd64:any' as
well.
This indirection over provides was chosen as the alternative would be to
teach dependency resolvers how to deal with architecture specific
dependencies – which violates the design idea of avoiding resolver
changes, especially as architecture-specific dependencies are a
cornercase with quite a few subtil rules. Handling it all over versioned
provides as we already did for M-A in general seems much simpler as it
just works for them.
This switch to :any has actually a "surprising" benefit as well: Even
frontends showing a package name via .Name() [which doesn't show the
architecture] will display the "architecture" for dependencies in which
it was explicitely requested, while we will not show the 'strange' :any
arch in FullName(true) [= pretty-print] either. Before you had to
specialcase these and by default you wouldn't get these details shown.
The only identifiable disadvantage is that this complicates error
reporting and handling. apt-get's ShowBroken has existing problems with
virtual packages [it just shows the name without any reason], so that
has to be worked on eventually. The other case is that detecting if a
package is completely unknown or if it was at least referenced somewhere
needs to acount for this "split" – not that it makes a practical
difference which error is shown… but its one of the improvements
possible.
Diffstat (limited to 'test/integration/test-multiarch-foreign')
-rwxr-xr-x | test/integration/test-multiarch-foreign | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/test/integration/test-multiarch-foreign b/test/integration/test-multiarch-foreign index 854f441fb..8c09a7fde 100755 --- a/test/integration/test-multiarch-foreign +++ b/test/integration/test-multiarch-foreign @@ -186,39 +186,43 @@ The following packages have unmet dependencies: E: Unable to correct problems, you have held broken packages." aptget install $1 hates-foo -s testfailureequal "$BADPREFIX The following packages have unmet dependencies: - hates-foo-x64 : Conflicts: foo -E: Unable to correct problems, you have held broken packages." aptget install $1 hates-foo-x64 -s - testfailureequal "$BADPREFIX -The following packages have unmet dependencies: - hates-foo-x32 : Conflicts: foo:i386 -E: Unable to correct problems, you have held broken packages." aptget install $1 hates-foo-x32 -s + $2 : Conflicts: foo:$4 +E: Unable to correct problems, you have held broken packages." aptget install $1 $2 -s + testsuccessequal "Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + $1 $3 +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst $1 (1.0 unstable [$4]) +Inst $3 (1.0 unstable [amd64]) +Conf $1 (1.0 unstable [$4]) +Conf $3 (1.0 unstable [amd64])" aptget install $1 $3 -s } -hatersgonnahate 'foo' -hatersgonnahate 'foo:i386' +hatersgonnahate 'foo' 'hates-foo-x64' 'hates-foo-x32' 'amd64' +hatersgonnahate 'foo:i386' 'hates-foo-x32' 'hates-foo-x64' 'i386' -#FIXME: do not work in single-arch as i386 isn't known at cache generation time testsuccessequal 'Reading package lists... Building dependency tree... The following additional packages will be installed: - foo + foo:i386 The following NEW packages will be installed: - cool-foo-x32 foo + cool-foo-x32 foo:i386 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. -Inst foo (1.0 unstable [amd64]) +Inst foo:i386 (1.0 unstable [i386]) Inst cool-foo-x32 (1.0 unstable [amd64]) -Conf foo (1.0 unstable [amd64]) +Conf foo:i386 (1.0 unstable [i386]) Conf cool-foo-x32 (1.0 unstable [amd64])' aptget install cool-foo-x32 -s testsuccessequal 'Reading package lists... Building dependency tree... The following additional packages will be installed: - bar + bar:i386 The following NEW packages will be installed: - bar cool-bar-x32 + bar:i386 cool-bar-x32 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. -Inst bar (1.0 unstable [amd64]) +Inst bar:i386 (1.0 unstable [i386]) Inst cool-bar-x32 (1.0 unstable [amd64]) -Conf bar (1.0 unstable [amd64]) +Conf bar:i386 (1.0 unstable [i386]) Conf cool-bar-x32 (1.0 unstable [amd64])' aptget install cool-bar-x32 -s -q=0 testsuccessequal 'Reading package lists... |