summaryrefslogtreecommitdiff
path: root/apt-pkg/cacheiterators.h
Commit message (Collapse)AuthorAgeFilesLines
* link DependencyData structs togetherDavid Kalnischkies2015-08-101-2/+3
| | | | | | | | | Cache generation needs a way of quickly iterating over the unique potion of the dependencies to be able to share them. By linking them together we can reduce the speed penality (~ 80%) with only a small reduction in saved size (~ 20%). Git-Dch: Ignore
* split-up Dependency structDavid Kalnischkies2015-08-101-9/+34
| | | | | | | | | | | | | | | | | | | | | Having dependency data separated from the link between version/package and the dependency allows use to work on sharing the depdency data a bit as it turns out that many dependencies are in fact duplicates. How many are duplicates various heavily with the sources configured, but for a single Debian release the ballpark is 2 duplicates for each dependency already (e.g. libc6 counts 18410 dependencies, but only 45 unique). Add more releases and the duplicates count only rises to get ~6 for 3 releases. For each architecture a user has configured which given the shear number of dependencies amounts to MBs of duplication. We can cut down on this number, but pay a heavy price for it: In my many releases(3) + architectures(3) test we have a 10% (~ 0.5 sec) increase in cache creationtime, but also 10% less cachesize (~ 10 MB). Further work is needed to rip the whole benefits from this through, so this is just the start. Git-Dch: Ignore
* avoid virtual in the iteratorsDavid Kalnischkies2015-08-101-51/+39
| | | | | | | | With a bit of trickery and the Curiously recurring template pattern we can free us from our use of virtual in the iterators were it is unneeded bloat as we never deal with pointers to iterators and similar such. Git-Dch: Ignore
* cleanup Container.erase API to look more like std::containersDavid Kalnischkies2015-08-101-1/+0
| | | | | | | | C++11 slightly changes the API again to const_iterator, but we are find with iterators in the C++03 style for now as long as they look and behave equally to the methods of the standard containers. Git-Dch: Ignore
* apply various style suggestions by cppcheckDavid Kalnischkies2015-08-101-4/+4
| | | | | | | Some of them modify the ABI, but given that we prepare a big one already, these few hardly count for much. Git-Dch: Ignore
* store Release files data in the CacheDavid Kalnischkies2015-06-121-6/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* merge debian/sid into debian/experimentalDavid Kalnischkies2015-03-161-4/+6
|\
| * deprecate the Section member from package structDavid Kalnischkies2014-11-101-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A version belongs to a section and has hence a section member of its own. A package on the other hand can have multiple versions from different sections. This was "solved" by using the section which was parsed first as order of sources.list defines, but that is obviously a horribly unpredictable thing. Users are way better of with the Section() as returned by the version they are dealing with. It is likely the same for all versions of a package, but in the few cases it isn't, it is important (like packages moving from main/* to contrib/* or into oldlibs …). Backport of 7a66977 which actually instantly removes the member.
* | guard ABI changes for SourcePkg/Ver in pkgCacheDavid Kalnischkies2014-11-081-0/+2
| | | | | | | | Git-Dch: Ignore
* | store source name and version in binary cacheDavid Kalnischkies2014-09-271-0/+6
| | | | | | | | | | | | | | Accessing the package records to acquire this information is pretty costly, so that information wasn't used so far in many places. The most noticeable user by far is EDSP at the moment, but there are ideas to change that which this commit tries to enable.
* | deprecate Pkg->Name in favor of Grp->NameDavid Kalnischkies2014-09-271-2/+2
| | | | | | | | | | | | | | They both store the same information, so this field just takes up space in the Package struct for no good reason. We mark it "just" as deprecated instead of instantly removing it though as it isn't misleading like Section was and is potentially used in the wild more often.
* | remove the Section member from package structDavid Kalnischkies2014-06-181-1/+5
|/ | | | | | | | | | | | | | | | | | A version belongs to a section and has hence a section member of its own. A package on the other hand can have multiple versions from different sections. This was "solved" by using the section which was parsed first as order of sources.list defines, but that is obviously a horribly unpredictable thing. We therefore directly remove this struct member to free some space and mark the access method as deprecated, which is told to return the section of the 'newest' known version, which is at least predictable, but possible not what it returned before – but nobody knows. Users are way better of with the Section() as returned by the version they are dealing with. It is likely the same for all versions of a package, but in the few cases it isn't, it is important (like packages moving from main/* to contrib/* or into oldlibs …).
* follow method attribute suggestions by gccDavid Kalnischkies2014-03-131-17/+18
| | | | | Git-Dch: Ignore Reported-By: gcc -Wsuggest-attribute={pure,const,noreturn}
* cleanup headers and especially #includes everywhereDavid Kalnischkies2014-03-131-0/+4
| | | | | | | | 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: cast from type A to type B casts away qualifiers [-Wcast-qual]David Kalnischkies2014-03-131-1/+1
| | | | | Git-Dch: Ignore Reported-By: gcc -Wcast-qual
* warning: extra ‘;’ [-Wpedantic]David Kalnischkies2014-03-131-113/+113
| | | | | Git-Dch: Ignore Reported-By: gcc -Wpedantic
* Fix typos in documentation (codespell)Michael Vogt2014-02-221-3/+3
|
* Version 3 for DPkg::Pre-Install-Pkgs with MultiArch infoDavid Kalnischkies2013-07-111-0/+1
| | | | | | | | | | | | | | | | | | | | | Adds on top of Version 2 to all displayed version numbers the architecture as well as the MultiArch flag for consumption by the hooks. Most of the time the architecture will be the same for both versions displayed, but packages might change from "all" to "any" (or back) between versions so we can't display the architecture for packages. Pseudo-Format for Version 3: <name> <version> <arch> <m-a-flag> <compare> <version> <arch> <m-a-flag> Examples: stuff - - none < 1 amd64 none **CONFIGURE** libsame 1 i386 same < 2 i386 same **CONFIGURE** stuff 2 i386 none > 1 i386 none **CONFIGURE** libsame 2 i386 same > - - none **REMOVE** toolkit 1 all foreign > - - none **REMOVE** Closes: #712116
* * apt-pkg/cacheiterators.h:David Kalnischkies2013-04-031-0/+2
| | | - provide DepIterator::IsSatisfied as a nicer shorthand for DepCheck
* * apt-pkg/cacheiterators.h:David Kalnischkies2012-06-111-1/+3
| | | - add an IsMultiArchImplicit() method for Dep- and PrvIterator
* * apt-pkg/cacheiterators.h:David Kalnischkies2012-01-191-1/+1
| | | | | | | | | - return the correct version arch for all+foreign, too The flag is interpreted at a few other places in different styles so this commit ensures that the flag check is consistent everywhere (checking for Same in flag style is a bit too much as it isn't used in combination with others anyway, but who knows and just for consistency)
* factor out the detection of self-conflicts into Dep::IsIgnorableDavid Kalnischkies2012-01-131-0/+2
|
* use forward declaration in headers if possible instead of includesDavid Kalnischkies2011-09-191-0/+1
|
* do not pollute namespace in the headers with using (Closes: #500198)David Kalnischkies2011-09-191-3/+3
|
* remove deprecated methods which nobody should have used anyway likeDavid Kalnischkies2011-05-171-4/+0
| | | | pseudo-package related and/or private
* * apt-pkg/pkgcache.h:David Kalnischkies2011-05-171-3/+1
| | | | - clean up mess with the "all" handling in MultiArch to fix LP: #733741 cleanly for everyone now
* if critical or-group can't be satisfied, exit directly.David Kalnischkies2011-05-111-0/+1
|
* * apt-pkg/cacheiterator.h:David Kalnischkies2011-03-251-0/+4
| | | | | | - return "all" instead of native architecture without breaking the abi (too much) by extending enum instead of using bitflags (LP: #733741) With the next abi break that enum should be a char bitflag instead
* Remove the "pseudopackage" handling of Architecture: all packages forDavid Kalnischkies2011-03-081-6/+2
| | | | | | | | | Multi-Arch; instead, Arch: all packages only satisfy dependencies for the native arch, except where the Arch: all package is declared Multi-Arch: foreign. (Closes: #613584) This has the sideeffect that arch:all packages internally show up as coming from the native arch - so packages with the architecture "all" doesn't exist any longer in the pkgcache
* * apt-pkg/cacheiterator.h:David Kalnischkies2011-01-131-9/+9
| | | - do not segfault if cache is not build (Closes: #254770)
* * apt-pkg/algorithms.cc:David Kalnischkies2010-08-101-0/+3
| | | | - change the debug outputs to display also arch of the package and version dependencies information
* * apt-pkg/pkgcache.cc:David Kalnischkies2010-07-251-2/+5
| | | - prefer non-virtual packages in FindPreferredPkg
* rename ReOwn to ReMap in the cacheiteratorsDavid Kalnischkies2010-07-111-2/+2
|
* * apt-pkg/pkgcachegen.{cc,h}:David Kalnischkies2010-07-081-0/+6
| | | | - make the used MMap moveable (and therefore dynamic resizeable) by applying (some) mad pointer magic (Closes: #195018)
* * apt-pkg/policy.h:David Kalnischkies2010-07-041-16/+16
| | | | - add another round of const& madness as the previous round accidently NOT override the virtual GetCandidateVer() method (Closes: #587725)
* add a simple method to VerIterator to check if two Versions are similarDavid Kalnischkies2010-06-161-0/+9
|
* * apt-pkg/cacheset.{cc,h}:David Kalnischkies2010-05-311-2/+2
| | | - add simple wrapper around std::set for cache structures
* * apt-pkg/pkgcache.cc:David Kalnischkies2010-05-311-0/+5
| | | - get the best matching arch package from a group with FindPreferredPkg
* move regex magic from apt-get to new FromRegEx methodDavid Kalnischkies2010-05-301-1/+1
|
* * apt-pkg/cacheiterator.h:David Kalnischkies2010-05-291-1/+3
| | | - let pkgCache::Iterator inherent std::iterator
* add a missing non-const & Accessors to the Iterator classDavid Kalnischkies2010-03-191-0/+1
|
* Fix the PkgFileIterator Constructor which defaults to the wrong value.David Kalnischkies2010-02-281-1/+2
| | | | | | (0 instead of the HeaderP) This breaks the Cache Validation functionality as the end() doesn't test for NULL. (The fault was introduced with the rewriting of the CacheIterators)
* move ShowPkg() from apt-get to the PkgIterator and rename it to FullName()David Kalnischkies2010-02-261-0/+1
| | | | | | | responseable for displaying a package name and the architecture in a uniform way. Pretty option can be used to not append the architecture if it is the native architecture or all - and use it all over the place in the commandline tools.
* Add yet another pseudo package which isn't as pseudo as the others:David Kalnischkies2010-02-121-0/+1
| | | | | | | | | | Arch all packages are now represented by arch depending packages which all depend on a package with the same name and the special arch "all". This packages has NO dependencies, but beside this the same information. It is the only package which has a size, the arch depending ones all have a zero size. While the arch depending pseudo packages are used for dependency resolution the arch "all" package is used for downloading and ordering of the package.
* Arch() on a MultiArch:all version should return "all" to be compatibleDavid Kalnischkies2010-02-111-1/+10
| | | | | with previous usecases. You now need to requested with Arch(true) the return of the architecture this version (and pseudo package) was created for.
* Drop the Arch information from the Version structure as we can getDavid Kalnischkies2010-02-071-1/+1
| | | | the information from the parent package now
* Split ListParser::NewDepends into two methods to use these new methodDavid Kalnischkies2009-12-271-3/+11
| | | | | | | | | 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-3/+34
| | | | | | | | | | | | 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!
* Refactor the cache iterators by using a common base classDavid Kalnischkies2009-12-091-379/+294
| | | | | This should not change the public interface, but it removes the friend connection between the iterators and pkgcache as it is unused.
* The 'not dead yet' releaseMichael Vogt2009-07-211-18/+18
|\ | | | | | | | | | | | | | | | | | | | | * add hook for MarkInstall and MarkDelete (closes: #470035) * add the various foldmarkers in apt-pkg & cmdline (no code change) * versions with a pin of -1 shouldn't be a candidate (Closes: #355237) * prefer mmap as memory allocator in MMap instead of a static char array which can (at least in theory) grow dynamic * eliminate (hopefully all) segfaults in pkgcachegen.cc and mmap.cc which can arise if cache doesn't fit into the mmap (Closes: #535218) * display warnings instead of errors if the parts dirs doesn't exist * honor the dpkg hold state in new Marker hooks (closes: #64141)