summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-pkg/deb/deblistparser.cc9
-rwxr-xr-xtest/integration/test-external-dependency-solver-protocol18
2 files changed, 22 insertions, 5 deletions
diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc
index ab957a01a..a86f49dc0 100644
--- a/apt-pkg/deb/deblistparser.cc
+++ b/apt-pkg/deb/deblistparser.cc
@@ -1018,12 +1018,11 @@ debDebFileParser::debDebFileParser(FileFd *File, std::string const &DebFile)
bool debDebFileParser::UsePackage(pkgCache::PkgIterator &Pkg,
pkgCache::VerIterator &Ver)
{
- bool res = debListParser::UsePackage(Pkg, Ver);
- // we use the full file path as a provides so that the file is found
- // by its name
- if(NewProvides(Ver, DebFile, Pkg.Cache()->NativeArch(), Ver.VerStr(), 0) == false)
+ if (not debListParser::UsePackage(Pkg, Ver))
return false;
- return res;
+ // we use the full file path as a provides so that the file is found by its name
+ // using the MultiArchImplicit flag for this is a bit of a stretch
+ return NewProvides(Ver, DebFile, Pkg.Cache()->NativeArch(), Ver.VerStr(), pkgCache::Flag::MultiArchImplicit | pkgCache::Flag::ArchSpecific);
}
debListParser::~debListParser() {}
diff --git a/test/integration/test-external-dependency-solver-protocol b/test/integration/test-external-dependency-solver-protocol
index 2c451d5f9..39c9cf58f 100755
--- a/test/integration/test-external-dependency-solver-protocol
+++ b/test/integration/test-external-dependency-solver-protocol
@@ -292,3 +292,21 @@ echo 'Error: instant-exit
Message: This solver exits instantly'
exit 1" 'E: External solver failed with: This solver exits instantly
E: Sub-process exit1withmsg returned an error code (1)'
+
+configarchitecture 'amd64' 'i386'
+buildsimplenativepackage 'dummy-webserver' 'all' '1' 'unstable' 'Provides: httpd
+Multi-Arch: foreign'
+testfailure apt install -s dummy-webserver
+testsuccess apt install -s ./incoming/dummy-webserver_1_all.deb
+testsuccess apt install -s ./incoming/dummy-webserver_1_all.deb --solver apt
+testfailure apt install -s ./incoming/dummy-webserver_1_all.deb --solver dump
+
+testsuccess aptcache showpkg dummy-webserver --with-source ./incoming/dummy-webserver_1_all.deb
+cp -a rootdir/tmp/testsuccess.output showpkg.output
+testequal 'Reverse Depends:
+Dependencies:
+1 -
+Provides:
+1 - ./incoming/dummy-webserver_1_all.deb (= 1) httpd (= )
+Reverse Provides: ' tail -n 6 showpkg.output
+testsuccessequal 'Provides: httpd' grep 'Provides:' "$APT_EDSP_DUMP_FILENAME"