From 8ebabf3d9026d1a738a4e8988e168902af7446e3 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 17 Jan 2020 12:53:20 +0100 Subject: Allow querying all binaries built by a source package This adds a simple way to lookup binaries by a source package, but this adds all binaries into one list, even with different source versions. Be careful. --- apt-pkg/pkgcache.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'apt-pkg/pkgcache.h') diff --git a/apt-pkg/pkgcache.h b/apt-pkg/pkgcache.h index 3f77d5eae..52446e8f5 100644 --- a/apt-pkg/pkgcache.h +++ b/apt-pkg/pkgcache.h @@ -383,7 +383,11 @@ struct pkgCache::Header On or more packages with the same name form a group, so we have a simple way to access a package built for different architectures Group exists in a singly linked list of group records starting at - the hash index of the name in the pkgCache::Header::GrpHashTable */ + the hash index of the name in the pkgCache::Header::GrpHashTable + + They also act as a representation of source packages, allowing you to + iterate over all binaries produced by a source package. + */ struct pkgCache::Group { /** \brief Name of the group */ @@ -394,11 +398,15 @@ struct pkgCache::Group map_pointer_t FirstPackage; // Package /** \brief Link to the last package which belongs to the group */ map_pointer_t LastPackage; // Package + /** \brief Link to the next Group */ map_pointer_t Next; // Group /** \brief unique sequel ID */ map_id_t ID; + /** \brief List of binary produces by source package with this name. */ + map_pointer_t VersionsInSource; // Version + }; /*}}}*/ // Package structure /*{{{*/ @@ -642,6 +650,8 @@ struct pkgCache::Version map_id_t ID; /** \brief parsed priority value */ map_number_t Priority; + /** \brief next version in the source package (might be different binary) */ + map_pointer_t NextInSource; // Version }; /*}}}*/ // Description structure /*{{{*/ -- cgit v1.2.3-70-g09d2