From 45b04762e1990a761a7c308f9e73a286a92f908a Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 3 Mar 2025 11:20:52 +0100 Subject: edsp: Write 'Size' to the EDSP files This allows solvers to optimize by download size; and gives us a better means of interpreting "downloadable" debs (they must have a size > 0 after all). --- apt-pkg/edsp/edsplistparser.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'apt-pkg/edsp') diff --git a/apt-pkg/edsp/edsplistparser.cc b/apt-pkg/edsp/edsplistparser.cc index 14967e110..a3cdf794f 100644 --- a/apt-pkg/edsp/edsplistparser.cc +++ b/apt-pkg/edsp/edsplistparser.cc @@ -56,8 +56,11 @@ bool edspLikeListParser::NewVersion(pkgCache::VerIterator &Ver) } } - // Fake a size such that the deb appears downloadable if it has a source - Ver->Size = Section.Exists("APT-Release"); + // If we have a Size field, use it, otherwise fake one based on APT-Release to + // be able to distinguish downloadable debs from installed ones. + Ver->Size = Section.Exists(pkgTagSection::Key::Size) + ? Section.FindI(pkgTagSection::Key::Size) + : Section.Exists("APT-Release"); return true; } /*}}}*/ -- cgit v1.2.3-70-g09d2