summaryrefslogtreecommitdiff
path: root/cmdline/apt-cache.cc
Commit message (Collapse)AuthorAgeFilesLines
* just-in-time creation for (implicit) ProvidesDavid Kalnischkies2015-08-101-2/+2
| | | | | | | | | | | | | | | | 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-3/+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.
* remove the compatibility markers for 4.13 abiDavid Kalnischkies2015-08-101-3/+1
| | | | | | | | We aren't and we will not be really compatible again with the previous stable abi, so lets drop these markers (which never made it into a released version) for good as they have outlived their intend already. Git-Dch: Ignore
* split-up Dependency structDavid Kalnischkies2015-08-101-4/+5
| | | | | | | | | | | | | | | | | | | | | 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
* fix memory leaks reported by -fsanitizeDavid Kalnischkies2015-08-101-0/+1
| | | | | | | | Various small leaks here and there. Nothing particularily big, but still good to fix. Found by the sanitizers while running our testcases. Reported-By: gcc -fsanitize Git-Dch: Ignore
* apt-cache: Change version pin output to use per-version pinsJulian Andres Klode2015-08-101-1/+1
|
* hide Translation-* in 'apt-cache policy' outputDavid Kalnischkies2015-06-151-0/+2
| | | | | | | | | | | | | Translation-* files are internally handled as PackageFiles which isn't super nice, but giving them their own struct is a bit overkill so let it be for the moment. They always appeared in the policy output because of this through and now that they are properly linked to a ReleaseFile they even display all the pinning information on them, but they don't contain any packages which could be pinned… No problem, but useless and potentially confusing output. Adding a 'NoPackages' flag which can be set on those files and be used in applications seems like a simple way to fix this display issue.
* store Release files data in the CacheDavid Kalnischkies2015-06-121-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* rewrite all TFRewrite instances to use the new pkgTagSection::WriteDavid Kalnischkies2015-05-111-9/+12
| | | | | | | | | While it is mostly busywork to rewrite all instances it actually fixes bugs as the data storage used by the new method is std::string rather than a char*, the later mostly created by c_str() from a std::string which the caller has to ensure keeps in scope – something apt-ftparchive actually didn't ensure and relied on copy-on-write behavior instead which c++11 forbids and hence the new default gcc abi doesn't use it.
* stop displaying time of build in online helpJérémy Bobbio2015-03-161-3/+2
| | | | | | | | | | | | | | | | | | As part of the “reproducible builds” effort [1], we have noticed that apt could not be built reproducibly. One issue is that it uses the __DATE__ and __TIME__ macros of the C preprocessor to display the time of build in the online help. We believe this information not to be really useful to users as they can always look at the package data and metadata to figure it out. The attached patch simply removes this information. All non-documentation packages can then be built reproducibly with our current experimental framework. [David: changed the string slightly to be untranslateable as well] Closes: 774342
* various small additional tests and testcasesDavid Kalnischkies2014-11-181-2/+2
| | | | | | | | | Usually they don't provide a lot in terms of what they test, but they help in covering many lines from strictly anecdotal commands (stats, moo) and error messages, so that stuff which really needs to be tested, but isn't is better visible in coverage reports. Git-Dch: Ignore
* use the same code to detect quiet setting in all toolsDavid Kalnischkies2014-11-091-3/+1
| | | | Git-Dch: Ignore
* streamline display of --help in all toolsDavid Kalnischkies2014-11-091-16/+2
| | | | | | | By convention, if I run a tool with --help or --version I expect it to exit successfully with the usage, while if I do call it wrong (like without any parameters) I expect the usage message shown with a non-zero exit.
* guard pkg/grp hashtable creation changesDavid Kalnischkies2014-11-081-5/+8
| | | | | | | | | The change itself is no problem ABI wise, but the remove of the old undynamic hashtables is, so we bring it back for older abis and happily use the now available free space to backport more recent additions like the dynamic hashtable itself. Git-Dch: Ignore
* 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/+2
| | | | | | | 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.
* adapt to the new CacheSetHelper APIDavid Kalnischkies2014-09-271-6/+6
| | | | Git-Dch: Ignore
* rework cachesets API to allow future extensionDavid Kalnischkies2014-09-271-6/+6
| | | | | | | | | | | | | | | The introduction of Fnmatch showed that each new selector would require multiple new virtual methods in the CacheSetHelper to work correctly, which isn't that great. We now flip to a single virtual method which handles all cases separated by an enum – as new enum values can be added without an ABI break. Great care was taken to make old code work with the new way of organisation, which means in return that you might be bombarded with deprecation warnings now if you don't adapt, but code should still compile and work as before as can be seen in apt itself with this commit. Git-Dch: Ignore
* count strings more accurately for statsDavid Kalnischkies2014-09-271-14/+39
| | | | | | | | | | So far, only the few strings stored in stringitems were counted, but many more strings are directly inserted into the cache. We account for this now by identifying all these different strings and measure their length. We are still not at the correct size of the cache in 'stats' this way, but we are now again a bit closer. Git-Dch: Ignore
* Merge branch 'debian/sid' into debian/experimentalMichael Vogt2014-09-051-2/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: apt-pkg/acquire-item.cc configure.ac debian/changelog doc/apt-verbatim.ent doc/po/apt-doc.pot doc/po/de.po doc/po/es.po doc/po/fr.po doc/po/it.po doc/po/ja.po doc/po/pt.po po/ar.po po/ast.po po/bg.po po/bs.po po/ca.po po/cs.po po/cy.po po/da.po po/de.po po/dz.po po/el.po po/es.po po/eu.po po/fi.po po/fr.po po/gl.po po/hu.po po/it.po po/ja.po po/km.po po/ko.po po/ku.po po/lt.po po/mr.po po/nb.po po/ne.po po/nl.po po/nn.po po/pl.po po/pt.po po/pt_BR.po po/ro.po po/ru.po po/sk.po po/sl.po po/sv.po po/th.po po/tl.po po/tr.po po/uk.po po/vi.po po/zh_CN.po po/zh_TW.po test/integration/test-ubuntu-bug-346386-apt-get-update-paywall
| * Use heap to allocate PatternMatch to avoid potential stack overflowMichael Vogt2014-09-021-2/+3
| | | | | | | | | | | | | | | | | | | | | | When apt-cache search with many args (> 130) is given the allocation of PatternMatch on the stack may fail resulting in a segmentation fault. By using the heap the max size is much bigger and we also get a bad_alloc expection instead of a segfault (which we can catch *if* this ever becomes a pratical problem). No test for the crash as its not reproducable with the MALLOC_ settings in framework. Closes: 759612
* | correct 'apt-cache stats' to include moreDavid Kalnischkies2014-06-181-24/+32
| | | | | | | | | | | | | | | | It still doesn't reflect the size the cache has on the disk compared to what is given as total size (90 vs 103 MB), but by counting all structs in we are at least a bit closer to the reality. Git-Dch: ignore
* | cleanup datatypes mix used in binary cacheDavid Kalnischkies2014-06-181-1/+1
| | | | | | | | | | | | | | | | 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.
* | Merge remote-tracking branch 'mvo/feature/hash-stats' into debian/experimentalMichael Vogt2014-06-181-1/+45
|\ \ | |/ |/| | | | | | | | | | | | | Conflicts: apt-pkg/acquire-item.cc apt-pkg/acquire-item.h apt-pkg/deb/debmetaindex.h apt-pkg/pkgcache.cc test/integration/test-apt-ftparchive-src-cachedb
| * Provide ShowHashTableStats functionMichael Vogt2014-06-181-55/+43
| |
| * improve formating of the hash statsMichael Vogt2014-06-181-15/+15
| |
| * add hashtable statsMichael Vogt2014-05-291-1/+57
| |
* | support Acquire::GzipIndexes in dumpavailDavid Kalnischkies2014-06-101-1/+1
|/ | | | Closes: 742835
* 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-21/+30
| | | | | | | | 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-6/+6
| | | | | Reported-By: gcc -Wunused-parameter Git-Dch: Ignore
* warning: no previous declaration for foobar() [-Wmissing-declarations]David Kalnischkies2014-03-131-24/+24
| | | | | Git-Dch: Ignore Reported-By: gcc -Wmissing-declarations
* fix -Wmissing-field-initializers warningsDavid Kalnischkies2014-03-131-1/+1
| | | | | Reported-By: gcc Git-Dch: Ignore
* squash merge of the feature/apt-binary branch without the changes from ↵Michael Vogt2013-08-121-81/+35
| | | | experimental
* use FileFd::Write instead of fwrite for errorsDavid Kalnischkies2013-07-261-3/+4
| | | | | | | Using the static FileFd::Write method gives us error messages for free so we use it here to avoid failing silently (with a fail silent error). Git-Dch: Ignore
* fix 'apt-cache search' crash with missing descriptionDavid Kalnischkies2013-07-181-11/+22
| | | | | | | | | | | | | | | | Beside the earlier fixed 'apt-cache show', 'showpkg' and 'search' deal with descriptions. 'showpkg' was fixed by fixing the cache generation for 'show', but 'search' still segfaulted. On the upside, it doesn't segfault any longer, on the downside, if a package has no description at all (aka: not in the Packages file and not in a Translation-* file) the package can't be found with 'search', even if we search only by name. That is a shortcoming in the code, but fixing it means rewriting it completely for dubious gain at best. So this commit just skips packages without a description and is done. Closes: 647590
* skip all Description fields in apt-cache, not just firstDavid Kalnischkies2013-07-181-17/+35
| | | | | | | | | | | | | | | | Given a Packages file like: […] Description: foo bar baz moo moo moo Multi-Arch: foreign Description-md5: 97e204a9f4ad8c681dbd54ec7c505251 […] We have to display the Multi-Arch flag field as well as the fields after the Description-md5, but not this field itself, as we already have one printed alongside the Description we display. Closes: 717254
* handle missing "Description" in apt-cache showDavid Kalnischkies2013-06-201-15/+32
| | | | | | | | | | | | do not blindly assume that all packages stanzas have a "Description:" field in 'apt-cache show' as well as in the cache creation itself. We instead assume now that if the stanza has a Description, it will not be the first field as we look out for "\nDescription" to take care of MD5sum as well as (maybe ignored) translated Descriptions embedded in the package stanza. Closes: #712435
* fix support for multiple patterns in apt-cache searchDavid Kalnischkies2013-06-091-28/+51
| | | | | | | Patterns can appear in the name as well as in the description, they don't have to match all in the name/description only. Closes: 691453
* initialize the whole search array with zeroDavid Kalnischkies2013-06-091-1/+1
| | | | Git-Dch: Ignore
* * cmdline/apt-cache.cc:David Kalnischkies2012-09-261-3/+7
| | | | | | - print versioned dependency relations in (r)depends if the option APT::Cache::ShowVersion is true (default: false) as discussed in #218995 to help debian-cd fixing #687949. Thanks to Sam Lidder for initial patch and Steve McIntyre for nagging and testing!
* the previously used VERSION didn't work everywhere so we are switchingDavid Kalnischkies2012-03-221-1/+1
| | | | to the more standard PACKAGE_VERSION and make it work in every file
* * cmdline/apt-cache.cc:David Kalnischkies2012-02-251-1/+1
| | | - correct --pre-depends option by using dash consistently (LP: #940837)
* enable FileFd to guess the compressor based on the filename if requested orDavid Kalnischkies2011-12-101-1/+1
| | | | | to search for compressed silbings of the given filename and use this guessing instead of hardcoding Gzip compression
* - provide a {Package,Version}List similar to {Package,Version}SetDavid Kalnischkies2011-11-111-14/+14
| | | | | * cmdline/apt-{get,cache,mark}.cc: - use Lists instead of Sets if input order should be preserved for commands accepting lists of packages, e.g. policy (Closes: #625960)
* * apt-pkg/cacheset.cc:David Kalnischkies2011-11-091-4/+4
| | | | - make the cachesets real containers which can embedding any container to be able to use the same interface regardless of set or list usage
* use forward declaration in headers if possible instead of includesDavid Kalnischkies2011-09-191-1/+5
|
* merge with debian/experimentalDavid Kalnischkies2011-09-131-52/+52
|\
| * cppcheck complains about some possible speed improvements which could beDavid Kalnischkies2011-08-111-52/+52
| | | | | | | | | | | | done on the mirco-optimazation level, so lets fix them: (performance) Possible inefficient checking for emptiness. (performance) Prefer prefix ++/-- operators for non-primitive types.
* | reorder includes: add <config.h> if needed and include it at firstDavid Kalnischkies2011-09-131-5/+5
|/