diff options
| author | Julian Andres Klode <julian.klode@canonical.com> | 2025-02-15 16:37:19 +0100 |
|---|---|---|
| committer | Julian Andres Klode <julian.klode@canonical.com> | 2025-02-15 16:37:19 +0100 |
| commit | 4bcb198a67156b2654f3b64173499ab78f0d4d9a (patch) | |
| tree | 769672dc89bc948e6018a82d50a6d990d6d73756 /apt-pkg/pkgcachegen.cc | |
| parent | f299c09e2eae51391a07ae8708ca789df721321a (diff) | |
cache: Introduce partial SourceVersion support
This is the first step that introduces a 1:1 mapping between version
and source version. In a future version this can use the fields
currently marked unavailable to deduplicate the SourceVersion
objects across the group.
The policy gains a member for storing pins for sourceversions.
Together, in the future we should be able to determine candidates
for source versions.
Diffstat (limited to 'apt-pkg/pkgcachegen.cc')
| -rw-r--r-- | apt-pkg/pkgcachegen.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index fec931cf2..6e115e4f4 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -894,6 +894,11 @@ map_pointer<pkgCache::Version> pkgCacheGenerator::NewVersion(pkgCache::VerIterat Ver->d = d; if (not Ver.PhasedUpdatePercentage(100)) abort(); + auto SourceVersion = AllocateInMap<pkgCache::SourceVersion>(); // sequence point so Ver can be moved if needed + Ver->SourceVersion = SourceVersion; + Ver.SourceVersion()->ID = Cache.HeaderP->SourceVersionCount++; + if (not Ver.SourceVersion()) + abort(); //Dynamic<pkgCache::VerIterator> DynV(Ver); // caller MergeListVersion already takes care of it Ver->NextVer = Next; |
