summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2020-06-13 11:45:38 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2020-06-14 10:19:39 +0200
commit419190f6c17aaf750887ec7471599681377fb01b (patch)
treef17af921ba221fb89f3842777bf4f3e5fd1a11d4
parent71d753b5e450a99f7f6677fe4899515aaec7e585 (diff)
Tell EDSP solvers about all installed pkgs ignoring arch
We usually tell EDSP solvers only about architectures we are configured to treat as native/foreign, but the system could have packages from other architectures installed (even if very unlikely) which could influence the solution (e.g. requiring a removal) so we make sure to tell them.
-rw-r--r--apt-pkg/edsp.cc2
-rwxr-xr-xtest/integration/test-external-dependency-solver-protocol11
2 files changed, 10 insertions, 3 deletions
diff --git a/apt-pkg/edsp.cc b/apt-pkg/edsp.cc
index 3f8534234..9f9976ef5 100644
--- a/apt-pkg/edsp.cc
+++ b/apt-pkg/edsp.cc
@@ -262,7 +262,7 @@ bool EDSP::WriteScenario(pkgDepCache &Cache, FileFd &output, OpProgress *Progres
for (pkgCache::PkgIterator Pkg = Cache.PkgBegin(); Pkg.end() == false && likely(Okay); ++Pkg)
{
std::string const arch = Pkg.Arch();
- if (std::find(archs.begin(), archs.end(), arch) == archs.end())
+ if (Pkg->CurrentVer == 0 && std::find(archs.begin(), archs.end(), arch) == archs.end())
continue;
for (pkgCache::VerIterator Ver = Pkg.VersionList(); Ver.end() == false && likely(Okay); ++Ver, ++p)
{
diff --git a/test/integration/test-external-dependency-solver-protocol b/test/integration/test-external-dependency-solver-protocol
index 39c9cf58f..33d78be2a 100755
--- a/test/integration/test-external-dependency-solver-protocol
+++ b/test/integration/test-external-dependency-solver-protocol
@@ -294,6 +294,9 @@ exit 1" 'E: External solver failed with: This solver exits instantly
E: Sub-process exit1withmsg returned an error code (1)'
configarchitecture 'amd64' 'i386'
+for arch in 'amd64' 'i386' 'armel' 'armhf'; do
+ insertinstalledpackage "dummy-httpd-$arch" "$arch" '1' 'Provides: httpd'
+done
buildsimplenativepackage 'dummy-webserver' 'all' '1' 'unstable' 'Provides: httpd
Multi-Arch: foreign'
testfailure apt install -s dummy-webserver
@@ -307,6 +310,10 @@ testequal 'Reverse Depends:
Dependencies:
1 -
Provides:
-1 - ./incoming/dummy-webserver_1_all.deb (= 1) httpd (= )
+1 - ./incoming/dummy-webserver_1_all.deb (= 1) httpd:armhf (= ) httpd:armel (= ) httpd:i386 (= ) httpd (= )
Reverse Provides: ' tail -n 6 showpkg.output
-testsuccessequal 'Provides: httpd' grep 'Provides:' "$APT_EDSP_DUMP_FILENAME"
+testsuccessequal 'Provides: httpd, httpd, httpd, httpd
+Provides: httpd
+Provides: httpd
+Provides: httpd
+Provides: httpd' grep 'Provides:' "$APT_EDSP_DUMP_FILENAME"