summaryrefslogtreecommitdiff
path: root/apt-pkg/pkgcache.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2025-02-26 12:18:39 +0100
committerJulian Andres Klode <julian.klode@canonical.com>2025-03-03 11:21:55 +0100
commitb33677749142e0997121d358277b18136bdbef87 (patch)
tree9781ce563d27ac6c3d73d5a35855f483029fa7bd /apt-pkg/pkgcache.cc
parent10755b590311356ecdaa38dbfdf552b6b8fdaddc (diff)
Consider 0-size debs not downloadable, set a size in EDSP
EDSP dumps all appear as a single file, so we cannot determine correctly if a package is obsolete. We can fix this by ensuring that only debs with a size are downloadable, and then by faking a size in EDSP: The size is 1 if APT-Release is set (there is a source to download it from) or 0 otherwise. This ensures that the obsolete logic in solver3 works correctly, as well as the obsolete patterns, if anyone could actually use it on the EDSP files.
Diffstat (limited to 'apt-pkg/pkgcache.cc')
-rw-r--r--apt-pkg/pkgcache.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc
index a27b1b054..4101fb4e5 100644
--- a/apt-pkg/pkgcache.cc
+++ b/apt-pkg/pkgcache.cc
@@ -864,6 +864,10 @@ int pkgCache::VerIterator::CompareVer(const VerIterator &B) const
/* */
APT_PURE bool pkgCache::VerIterator::Downloadable() const
{
+ // A zero size deb is not downloadable
+ if (S->Size == 0)
+ return false;
+
VerFileIterator Files = FileList();
for (; Files.end() == false; ++Files)
if (Files.File().Flagged(pkgCache::Flag::NotSource) == false)