summaryrefslogtreecommitdiff
path: root/cmdline/apt-cache.cc
Commit message (Collapse)AuthorAgeFilesLines
* 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
* 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
|/
* convert a lot of places to use IsNegative instead of checking by handDavid Kalnischkies2011-05-111-10/+4
| | | | for the three different dependencies
* * cmdline/apt-get.cc:David Kalnischkies2011-04-211-4/+3
| | | | | - deprecate mostly undocumented 'markauto' in favor of 'apt-mark' * cmdline/apt-cache.cc: - deprecate mostly undocumented 'showauto' in favor of 'apt-mark'
* fix a bunch of cppcheck warnings/errors based on a patch byDavid Kalnischkies2011-04-161-0/+3
| | | Niels Thykier, thanks! (Closes: #622805)
* Remove the "pseudopackage" handling of Architecture: all packages forDavid Kalnischkies2011-03-081-9/+1
| | | | | | | | | 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
* * cmdline/apt-cache.cc:David Kalnischkies2011-02-041-57/+2
| | | | | | - remove not implemented 'apt-cache add' command * doc/apt-cache.8.xml: - describe reality as apt-cache just queries and doesn't manipulate the caches. Thanks to Enrico Zini for spotting it! (Closes: #612009)
* cmdline/apt-cache.cc: Create an error for apt-cache dependsJulian Andres Klode2010-12-071-1/+1
| | | if packages could not found (LP: #647045)
* * cmdline/apt-cache.cc:David Kalnischkies2010-09-241-2/+2
| | | | - use the TranslatedDescription for searching and not the first available one as it is maybe not an expected language (Closes: #597925)
* remove useless GetInitialize methodDavid Kalnischkies2010-08-281-11/+0
|
* show in madison command again also source packages (LP: #614589)David Kalnischkies2010-08-251-5/+11
|
* - return success in show if a virtual package was givenDavid Kalnischkies2010-07-301-26/+38
| | | *
* - [ABI BREAK] add an ErrorType option to CacheSetHelperDavid Kalnischkies2010-07-301-8/+16
| | | | | * cmdline/apt-cache.cc: - use Notice instead of Error in the CacheSetHelper messages for compat reasons. Otherwise tools like sbuild blow up
* - show in (r)depends the canidate per default instead of newestDavid Kalnischkies2010-07-261-146/+64
| | | - share the (r)depends code instead of codecopy
* add APT::Cache::ShowOnlyFirstOr option to print only the firstDavid Kalnischkies2010-07-261-2/+10
| | | | alternative in the apt-cache (r)depends commands
* * apt-pkg/cacheset.cc:David Kalnischkies2010-07-171-2/+1
| | | - move them back to the library as they look stable now
* * cmdline/apt-cache.cc:David Kalnischkies2010-07-161-15/+62
| | | - be able to omit dependency types in (r)depends (Closes: #319006)
* [ Martin Pitt ]David Kalnischkies2010-07-111-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * debian/rules: - Make DEB_BUILD_OPTIONS=noopt actually work by passing the right CXXFLAGS. * apt-pkg/contrib/fileutl.{h,cc}: - Add support for reading of gzipped files with the new "ReadOnlyGzip" OpenMode. (Closes: #188407) - Link against zlib (in apt-pkg/makefile) and add zlib build dependency. - [ABI BREAK] This adds a new private member to FileFd, but its initialization is in the public header file. * configure.in: - Check for zlib library and headers. * apt-pkg/acquire-item.cc, apt-pkg/deb/debindexfile.cc, apt-pkg/deb/debrecords.cc, apt-pkg/deb/debsrcrecords.h, cmdline/apt-cache.cc: - Open Packages, Sources, and Translations indexes in "ReadOnlyGzip" mode. * apt-pkg/deb/debindexfile.cc: - If we do not find uncompressed package/source/translation indexes, look for gzip compressed ones. * apt-pkg/acquire-item.cc: - If the Acquire::GzipIndexes option is true and we download a gzipped index file, keep it as it is (and rename to .gz) instead of uncompressing it. * doc/apt.conf.5.xml: - Document the new Acquire::GzipIndexes option. * doc/po/apt-doc.pot, doc/po/de.po: - German translation of new Acquire::GzipIndexes option. * Add test/test-indexes.sh: - Test behaviour of index retrieval and usage, in particular with uncompressed and gzip compressed indexes. * methods/gzip.cc: With FileFd now being able to read gzipped files, there is no need for the gzip method any more to spawn an external gzip process. Rewrite it to use FileFd directly, which makes the code a lot simpler, and also using less memory and overhead.
| * Switch FileFd to not transparently gunzip, since that breaks code which ↵martin@piware.de2010-06-241-1/+1
| | | | | | | | expects the compressed contents to stay (such as the copy backend, or when using file:// repositories. Instead, introduce a new ReadOnlyGzip mode and use that where needed
* | give the APT::Cache::Generate option her effect backDavid Kalnischkies2010-06-261-1/+3
| |
* | do not override the user set quiet setting even if the target is not a ttyDavid Kalnischkies2010-06-261-1/+1
| |
* | print all messages if the application is in an interactive runDavid Kalnischkies2010-06-251-7/+5
| |
* | * cmdline/apt-get.cc:David Kalnischkies2010-06-191-1/+2
| | | | | | - use the cachsets in the install commands
* | use the GroupedFromCommandLine() method in the dotty and xvcg commandDavid Kalnischkies2010-06-061-56/+28
| | | | | | | | to get all the funky features in less lines
* | do not fail if an unrelated error is pending in DisplayRecord()David Kalnischkies2010-06-051-4/+4
| |
* | accept package versions in the unmet commandDavid Kalnischkies2010-06-051-23/+34
| |
* | apt-cache show --no-all-versions should issues the CandidateDavid Kalnischkies2010-06-051-1/+1
| |
* | Don't increase the commandline parameter in the library but in theDavid Kalnischkies2010-06-051-6/+6
| | | | | | | | application to be really generic.