summaryrefslogtreecommitdiff
path: root/apt-pkg/pkgcachegen.h
Commit message (Collapse)AuthorAgeFilesLines
* Switch performance critical code to use APT::StringViewJulian Andres Klode2016-01-071-9/+15
| | | | | | This improves performance of the cache generation on my ARM platform (4x Cortex A15) by about 10% to 20% from 2.35-2.50 to 2.1 seconds.
* pkgCacheGenerator: Allow passing down an already created cacheJulian Andres Klode2015-12-291-0/+2
| | | | | If we already have opened a cache, there is no point in having to open it again.
* pkgcachegen.h: Hack around unordered_map not existing before C++11Julian Andres Klode2015-12-271-0/+5
| | | | | This is for public users only, which cannot use the class at all, except for the static methods.
* pkgcachegen: Use std::unordered_map instead of std::mapJulian Andres Klode2015-12-271-5/+5
| | | | | std::unordered_map is faster than std::map in our use case, reducing cache generation time by about 10% in my benchmark.
* add messages to our deprecation warnings in libaptDavid Kalnischkies2015-11-271-2/+2
| | | | Git-Dch: Ignore
* Drop C++11 elements from headersJulian Andres Klode2015-08-111-1/+0
|
* eliminate dead file-provides code in cache generationDavid Kalnischkies2015-08-101-13/+2
| | | | | | | | | | The code was never active in production, it just sits there collecting dust and given that it is never tested probably doesn't even work anymore the way it was supposed to be (whatever that was exactly in the first place). So just remove it before I have to "fix" it again next time. Git-Dch: Ignore
* elimate duplicated code in pkgIndexFile subclassesDavid Kalnischkies2015-08-101-8/+9
| | | | | | | | Trade deduplication of code for a bunch of new virtuals, so it is actually visible how the different indexes behave cleaning up the interface at large in the process. Git-Dch: Ignore
* add volatile sources support in libapt-pkgDavid Kalnischkies2015-08-101-1/+0
| | | | | | | | | | | | | | | | | | | Sources are usually defined in sources.list (and co) and are pretty stable, but once in a while a frontend might want to add an additional "source" like a local .deb file to install this package (No support for 'real' sources being added this way as this is a multistep process). We had a hack in place to allow apt-get and apt to pull this of for a short while now, but other frontends are either left in the cold by this and/or the code for it looks dirty with FIXMEs plastering it and has on top of this also some problems (like including these 'volatile' sources in the srcpkgcache.bin file). So the biggest part in this commit is actually the rewrite of the cache generation as it is now potentially a three step process. The biggest problem with adding support now through is that this makes a bunch of previously mostly unusable by externs and therefore hidden classes public, so a bit of further tuneing on this now public API is in order…
* just-in-time creation for (explicit) negative depsDavid Kalnischkies2015-08-101-4/+1
| | | | | | | | | | | | | | Now that we deal with provides in a more dynamic fashion the last remaining problem is explicit dependencies like 'Conflicts: foo' which have to apply to all architectures, but creating them all at the same time requires us to know all architectures ending up in the cache which isn't needed to be the same set as all foreign architectures. The effect is visible already now through as this prevents the creation of a bunch of virtual packages for arch:all packages and as such also many dependencies, just not very visible if you don't look at the stats… Git-Dch Ignore
* just-in-time creation for (implicit) ProvidesDavid Kalnischkies2015-08-101-0/+4
| | | | | | | | | | | | | | | | Expecting the worst is easy to code, but has its disadvantages e.g. by creating package structures which otherwise would have never existed. By creating the provides instead at the time a package structure is added we are well prepared for the introduction of partial architectures, massive amounts of M-A:foreign (and :allowed) and co as far as provides are concerned at least. We have something relatively similar for dependencies already. Many tests are added for both M-A states and the code cleaned to properly support implicit provides for foreign architectures and architectures we 'just' happen to parse. Git-Dch: Ignore
* hide implicit deps in apt-cache again by defaultDavid Kalnischkies2015-08-101-7/+8
| | | | | | | | | | | | | | Before MultiArch implicits weren't a thing, so they were hidden by default by definition. Adding them for MultiArch solved many problems, but having no reliable way of detecting which dependency (and provides) is implicit or not causes problems everytime we want to output dependencies without confusing our observers with unneeded implementation details. The really notworthy point here is actually that we keep now a better record of how a dependency came to be so that we can later reason about it more easily, but that is hidden so deep down in the library internals that change is more the problems it solves than the change itself.
* make all d-pointer * const pointersDavid Kalnischkies2015-08-101-2/+2
| | | | | | | | | | | | | | Doing this disables the implicit copy assignment operator (among others) which would cause hovac if used on the classes as it would just copy the pointer, not the data the d-pointer points to. For most of the classes we don't need a copy assignment operator anyway and in many classes it was broken before as many contain a pointer of some sort. Only for our Cacheset Container interfaces we define an explicit copy assignment operator which could later be implemented to copy the data from one d-pointer to the other if we need it. Git-Dch: Ignore
* apply various style suggestions by cppcheckDavid Kalnischkies2015-08-101-1/+1
| | | | | | | Some of them modify the ABI, but given that we prepare a big one already, these few hardly count for much. Git-Dch: Ignore
* add d-pointer, virtual destructors and de-inline de/constructorsDavid Kalnischkies2015-06-161-9/+8
| | | | | | | | To have a chance to keep the ABI for a while we need all three to team up. One of them missing and we might loose, so ensuring that they are available is a very tedious but needed task once in a while. Git-Dch: Ignore
* populate the Architecture field for PackageFilesDavid Kalnischkies2015-06-151-1/+1
| | | | | | | | | | | This is mainly visible in the policy, so that you can now pin by b= and let it only effect Packages files of this architecture and hence the packages coming from it (which do not need to be from this architecture, but very likely are in a normal repository setup). If you should pin by architecture in this way is a different question… Closes: 687255
* store Release files data in the CacheDavid Kalnischkies2015-06-121-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | We used to read the Release file for each Packages file and store the data in the PackageFile struct even through potentially many Packages (and Translation-*) files could use the same data. The point of the exercise isn't the duplicated data through. Having the Release files as first-class citizens in the Cache allows us to properly track their state as well as allows us to use the information also for files which aren't in the cache, but where we know to which Release file they belong (Sources are an example for this). This modifies the pkgCache structs, especially the PackagesFile struct which depending on how libapt users access the data in these structs can mean huge breakage or no visible change. As a single data point: aptitude seems to be fine with this. Even if there is breakage it is trivial to fix in a backportable way while avoiding breakage for everyone would be a huge pain for us. Note that not all PackageFile structs have a corresponding ReleaseFile. In particular the dpkg/status file as well as *.deb files have not. As these have only a Archive property need, the Component property takes over this duty and the ReleaseFile remains zero. This is also the reason why it isn't needed nor particularily recommended to change from PackagesFile to ReleaseFile blindly. Sticking with the earlier is usually the better option.
* mark internal interfaces as hiddenDavid Kalnischkies2014-11-081-5/+5
| | | | | | | We have a bunch of classes which are of no use for the outside world, but were still exported and so needed to preserve ABI/API. Marking them as hidden to not export them any longer is a big API break in theory, but in practice nobody is using them – as if they would its a bug.
* use a abi version check similar to the gcc checkDavid Kalnischkies2014-11-081-1/+1
| | | | Git-Dch: Ignore
* rename StringType VERSION to VERSIONNUMBERDavid Kalnischkies2014-10-031-2/+2
| | | | | | | aptitude has a define for VERSION, so to not generate a FTBFS we just rename our enum element to a slightly less generic name. Git-Dch: Ignore
* fix: Member variable 'X' is not initialized in the constructor.David Kalnischkies2014-09-271-1/+1
| | | | | Reported-By: cppcheck Git-Dch: Ignore
* drop stored StringItems in favor of in-memory mappingsDavid Kalnischkies2014-09-271-6/+12
| | | | | | | | | | | | | | | Strings like Section names or architectures are needed vary often. Instead of writing them each time we need them, we deploy sharing for these special strings. Until now, this was done with a linked list of strings in which we would search, which was stored in the cache. It turns out we can do this just as well in memory as well with a bunch of std::map's. In memory means here that it isn't available anymore if we have a partly invalid cache, but that isn't much of a problem in practice as the status file is compared to the other files we parse very small and includes mostly duplicates, so the space we would gain by storing is more or less equal to the size of the stored linked list…
* cleanup datatypes mix used in binary cacheDavid Kalnischkies2014-06-181-22/+22
| | | | | | | | We had a wild mixture of (unsigned) int, long and long long here without much sense, so this commit adds a few typedefs to get some sense in the typesystem and ensures that a ID isn't sometimes computed as int, stored as long and compared with a long long… as this could potentially bite us later on as the size of the archive only increases over time.
* parse and retrieve multiple Descriptions in one recordDavid Kalnischkies2014-05-091-2/+5
| | | | | | | | It seems unlikely for now that proper archives will carry multiple Description-* stanzas in the Packages (or Translation-*) file, but sometimes apt eats its own output as shown by the usage of the CD team and it would be interesting to let apt output multiple translations e.g. in 'apt-cache show'.
* mark optional (private) symbols as hiddenDavid Kalnischkies2014-03-211-9/+9
| | | | | | | | This methods should not be used by anyone expect the library itself as they are helpers for the specific class and therefore perfect candidates for hidding. Git-Dch: Ignore
* abstract version hash comparison a bitDavid Kalnischkies2014-03-131-0/+9
| | | | | | | | In #737085 we see that apt can be confused if informations about versions only differ slightly. This commit adds a way of at least adding a few more data points with the next abi break to help a bit with it. Git-Dch: Ignore
* follow method attribute suggestions by gccDavid Kalnischkies2014-03-131-1/+1
| | | | | Git-Dch: Ignore Reported-By: gcc -Wsuggest-attribute={pure,const,noreturn}
* cleanup headers and especially #includes everywhereDavid Kalnischkies2014-03-131-5/+7
| | | | | | | | Beside being a bit cleaner it hopefully also resolves oddball problems I have with high levels of parallel jobs. Git-Dch: Ignore Reported-By: iwyu (include-what-you-use)
* warning: unused parameter ‘foo’ [-Wunused-parameter]David Kalnischkies2014-03-131-2/+2
| | | | | Reported-By: gcc -Wunused-parameter Git-Dch: Ignore
* share version strings between same versions (of different architectures)David Kalnischkies2013-04-031-1/+5
| | | to save some space and allow quick comparisions later on
* factor version string creation out of NewDepends, so we can easily reuseDavid Kalnischkies2013-03-131-0/+3
| | | version strings e.g. for implicit multi-arch dependencies
* add implicit dependencies needed for Multi-Arch at the time a VersionDavid Kalnischkies2011-10-121-1/+6
| | | | | | | struct is created and not at the end of the cache generation This allows us to be independent from the configured architectures for these kind of conflicts, we get natural progress for free and only the needed dependencies are in th respective binary cache.
* * apt-pkg/pkgcachegen.cc:David Kalnischkies2011-10-111-0/+6
| | | - refactor MergeList by creating -Group, -Package and -Version specialist
* remove old APT_COMPATIBILITY ifdef'sDavid Kalnischkies2011-09-191-14/+0
|
* do not pollute namespace in the headers with using (Closes: #500198)David Kalnischkies2011-09-191-19/+19
|
* * apt-pkg/pkgcachegen.{cc,h}:Michael Vogt2011-07-291-1/+1
| | | | | - use ref-to-ptr semantic in NewDepends() to ensure that the libapt does not segfault if the cache is remapped in between (LP: #812862)
* switch from std::set to std::vector as it is way more simple, a bitDavid Kalnischkies2010-07-091-7/+5
| | | | faster and still provides everything we need for the Cache generator
* * doc/apt.conf.5.xml:David Kalnischkies2010-07-091-0/+1
| | | - add and document APT::Cache-{Start,Grow,Limit} options for mmap control
* * apt-pkg/pkgcachegen.{cc,h}:David Kalnischkies2010-07-081-6/+24
| | | | - make the used MMap moveable (and therefore dynamic resizeable) by applying (some) mad pointer magic (Closes: #195018)
* use references instead of copies in the Cache generation methodsDavid Kalnischkies2010-07-081-6/+6
|
* wrap the mmap actions in the CacheGenerator in their own methods toDavid Kalnischkies2010-07-061-4/+8
| | | | be able to react on condition changes later then we can move mmap
* * apt-pkg/cachefile.{cc,h}:David Kalnischkies2010-06-041-2/+8
| | | | - split Open() into submethods to be able to build only parts - make the OpProgress optional in the Cache buildprocess
* Foreign Versions add an implicit Provides to the other packages in the groupDavid Kalnischkies2010-02-101-2/+2
|
* Drop the Arch information from the Version structure as we can getDavid Kalnischkies2010-02-071-0/+1
| | | | the information from the parent package now
* Split ListParser::NewDepends into two methods to use these new methodDavid Kalnischkies2009-12-271-1/+5
| | | | | | | | | for creating the dependencies needed for our groups: For now for all groups only one package can be installed at the same time which conflicts with each other packages in the group. The exceptions are architecture all package. Also, the Multi-Arch field is now parsed, but not used for now.
* Implement the first step toward Multi-Arch by setting up a GroupDavid Kalnischkies2009-12-191-2/+4
| | | | | | | | | | | | infrastructor for packages. APT is now aware of the fact that a package A in architecture X can't satisfy a dependency on package A in architecture Y - to handle these packages are now identified by name and architecture, so different architectures of the same package are handled internally as completly different packages. This is great for pinning, dependency checking and in many other situations, but sometimes we need to know which archs are available for a given package: Here Groups come to our rescue!
* add the various foldmarkers in apt-pkg & cmdline (no code change)David Kalnischkies2009-06-301-4/+4
|
* * fixed compile errors with g++ 7.3 (thanks to Michael Vogt2007-06-191-1/+1
| | | | | Daniel Burrows, closes: #429378) * fix FTFBFS by changing build-depends to libcurl4-gnutls-dev (closes: #428363)
* * merged the no-pragma branchMichael Vogt2006-12-141-3/+0
|\
| * * removed the pragma messMichael Vogt2006-10-021-3/+0
| |