summaryrefslogtreecommitdiff
path: root/apt-pkg/edsp
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2024-06-13 15:44:05 +0000
committerJulian Andres Klode <jak@debian.org>2024-06-13 15:44:05 +0000
commit3bfb483c8013eeb9bd3ce36aab1ef937ac9ffa6d (patch)
treeca35427f711152e183cdb4dd7e4b4ecbe411f82f /apt-pkg/edsp
parentb8dfc6c3f3e5e71c1268c69d26278805eb3c5424 (diff)
parentc79bf305f6c3ba92972cd9c39f8d28c396c63bc4 (diff)
Merge branch 'edsp-source-version' into 'main'
edsp: Parse source version from the Source-Version field See merge request apt-team/apt!354
Diffstat (limited to 'apt-pkg/edsp')
-rw-r--r--apt-pkg/edsp/edsplistparser.cc15
1 files changed, 14 insertions, 1 deletions
diff --git a/apt-pkg/edsp/edsplistparser.cc b/apt-pkg/edsp/edsplistparser.cc
index 5419069f2..183ace654 100644
--- a/apt-pkg/edsp/edsplistparser.cc
+++ b/apt-pkg/edsp/edsplistparser.cc
@@ -44,7 +44,20 @@ edspListParser::edspListParser(FileFd * const File) : edspLikeListParser(File)
bool edspLikeListParser::NewVersion(pkgCache::VerIterator &Ver)
{
_system->SetVersionMapping(Ver->ID, Section.FindI("APT-ID", Ver->ID));
- return debListParser::NewVersion(Ver);
+ if (not debListParser::NewVersion(Ver))
+ return false;
+
+ // Patch up the source version, it is stored in the Source-Version field in EDSP.
+ if (APT::StringView version = Section.Find(pkgTagSection::Key::Source_Version); not version.empty())
+ {
+ if (version != Ver.VerStr())
+ {
+ map_stringitem_t const idx = StoreString(pkgCacheGenerator::VERSIONNUMBER, version);
+ Ver->SourceVerStr = idx;
+ }
+ }
+
+ return true;
}
/*}}}*/
// ListParser::Description - Return the description string /*{{{*/