diff options
| author | Julian Andres Klode <julian.klode@canonical.com> | 2024-05-30 09:51:13 +0200 |
|---|---|---|
| committer | Julian Andres Klode <julian.klode@canonical.com> | 2024-05-30 09:53:08 +0200 |
| commit | c79bf305f6c3ba92972cd9c39f8d28c396c63bc4 (patch) | |
| tree | 02a7c8db2ca7ee01b36a2b9f9e2d62fe2d218043 | |
| parent | faf3af631aa8cc25100ccf88c9aaa07cc5ba2697 (diff) | |
edsp: Parse source version from the Source-Version field
EDSP uses the Source-Version field instead of storing the source
version in the Source field with the package name, adjust our
parser accordingly.
Use the override in the edspLikeListParser to do so rather than
dumb this into the correct place in the debListParser.
| -rw-r--r-- | apt-pkg/edsp/edsplistparser.cc | 15 | ||||
| -rw-r--r-- | apt-pkg/tagfile-keys.list | 1 |
2 files changed, 15 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 /*{{{*/ diff --git a/apt-pkg/tagfile-keys.list b/apt-pkg/tagfile-keys.list index 4b57e46c2..d198ea0a5 100644 --- a/apt-pkg/tagfile-keys.list +++ b/apt-pkg/tagfile-keys.list @@ -80,3 +80,4 @@ Vcs-Mtn Vcs-Svn Version ### APPEND BELOW, sort in with next ABI break ### +Source-Version |
