diff options
| author | David Kalnischkies <david@kalnischkies.de> | 2025-01-30 18:03:26 +0000 |
|---|---|---|
| committer | David Kalnischkies <david@kalnischkies.de> | 2025-01-30 19:10:50 +0000 |
| commit | 1bc8dab8df60c5da7cc817bec5f53e60f7eb9817 (patch) | |
| tree | 2d67b584affdebb7726c98072462901763bc90c5 /apt-pkg | |
| parent | 1bc221a9dd22baa6e2e516d45dc858774cafddd0 (diff) | |
Drop unused version stanza size info from binary cache
Same reason as with the description size before, but this one had
actually one extremely dated user in src:apt left with dumpavail,
which is changed to an implementation that is (in comparison) a bit
slower, but should be good enough for a command that is ideally not
used anymore (even if codesearch suggests otherwise).
After all, what makes this a bit slower is not that we don't know the
size, but that this one does additional work preparing for accessing
the fields which we don't do. In exchange pkgTagFile has a better
implementation for "Jitter" than the old code that we would "just"
need to copy here if speed were really an issue.
Diffstat (limited to 'apt-pkg')
| -rw-r--r-- | apt-pkg/pkgcache.h | 5 | ||||
| -rw-r--r-- | apt-pkg/pkgcachegen.cc | 11 |
2 files changed, 11 insertions, 5 deletions
diff --git a/apt-pkg/pkgcache.h b/apt-pkg/pkgcache.h index d5d8fcad3..0b61b0048 100644 --- a/apt-pkg/pkgcache.h +++ b/apt-pkg/pkgcache.h @@ -604,8 +604,9 @@ struct pkgCache::VerFile map_pointer<VerFile> NextFile; /** \brief position in the package file */ map_filesize_t Offset; // File offset - /** @TODO document pkgCache::VerFile::Size */ - map_filesize_t Size; +#if APT_PKG_ABI <= 600 + [[deprecated("No usage in src:apt, try MaxVerFileSize instead")]] map_filesize_t Size; +#endif }; /*}}}*/ // DescFile structure /*{{{*/ diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index 76dea6266..055b2e08e 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -854,9 +854,14 @@ bool pkgCacheGenerator::NewFileVer(pkgCache::VerIterator &Ver, *Last = VF.MapPointer(); VF->Offset = List.Offset(); - VF->Size = List.Size(); - if (Cache.HeaderP->MaxVerFileSize < VF->Size) - Cache.HeaderP->MaxVerFileSize = VF->Size; + auto const Size = List.Size(); + if (Cache.HeaderP->MaxVerFileSize < Size) + Cache.HeaderP->MaxVerFileSize = Size; +#if APT_PKG_ABI <= 600 + APT_IGNORE_DEPRECATED_PUSH + VF->Size = Size; + APT_IGNORE_DEPRECATED_POP +#endif Cache.HeaderP->VerFileCount++; return true; |
