summaryrefslogtreecommitdiff
path: root/apt-pkg/tagfile.h
Commit message (Collapse)AuthorAgeFilesLines
* apt-pkg: default visibility to hiddenJulian Andres Klode2020-02-261-4/+4
|
* Run unifdef -DAPT_{8,9,10,15}_CLEANER_HEADERSJulian Andres Klode2019-06-121-3/+0
|
* Update symbols and hide some pkgTagSection ABIJulian Andres Klode2019-06-111-2/+2
| | | | Gbp-Dch: ignore
* Make APT::StringView publicJulian Andres Klode2019-06-111-33/+15
|
* tagfile: Remove deprecated pkgUserTagSection and TFRewriteJulian Andres Klode2019-02-261-16/+0
|
* Fix typos reported by codespell & spellintianDavid Kalnischkies2018-08-291-1/+1
| | | | | | | | No user-visible change as it effects mostly code comments and not a single error message, manpage or similar. Reported-By: codespell & spellintian Gbp-Dch: Ignore
* Reformat and sort all includes with clang-formatJulian Andres Klode2017-07-121-2/+2
| | | | | | | | | | | | | This makes it easier to see which headers includes what. The changes were done by running git grep -l '#\s*include' \ | grep -E '.(cc|h)$' \ | xargs sed -i -E 's/(^\s*)#(\s*)include/\1#\2 include/' To modify all include lines by adding a space, and then running ./git-clang-format.sh.
* fix various typos reported by spellintianDavid Kalnischkies2017-01-191-1/+1
| | | | | | | | Most of them in (old) code comments. The two instances of user visible string changes the po files of the manpages are fixed up as well. Gbp-Dch: Ignore Reported-By: spellintian
* TagSection: Introduce functions for looking up by key idsJulian Andres Klode2016-11-221-0/+12
| | | | | Introduce a new enum class and add functions that can do a lookup with that enum class. This uses triehash.
* TagSection: Extract Find() methods taking Pos instead of KeyJulian Andres Klode2016-11-221-0/+11
| | | | | This allows us to add a perfect hash function to the tag file without having to reimplement the methods a second time.
* TagSection: Split AlphaIndexes into AlphaIndexes and BetaIndexesJulian Andres Klode2016-11-221-1/+2
| | | | | | | | | Move the use of the AlphaHash to a new second hash table in preparation for the arrival of the new perfect hash function. With the new perfect hash function hashing most of the keys for us, having 128 slots for a fallback hash function seems enough and prevents us from wasting space.
* Switch performance critical code to use APT::StringViewJulian Andres Klode2016-01-071-5/+28
| | | | | | 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.
* properly parse comments in apt_preferences and deb822-style sourcesDavid Kalnischkies2016-01-021-3/+1
| | | | | | | | | | apt_preferences and deb822-style sources used the specialized class pkgUserTagSection to deal with comments before/after a given stanza, but it couldn't deal with comments in the stanza at all. codesearch suggests that nobody else does and a vastely superior way of working with potentially commented files is implemented now, so we can officially discourage the use of the old incomplete hack class.
* add optional support for comments in pkgTagFileDavid Kalnischkies2016-01-021-2/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | APT usually deals with perfectly formatted files generated automatically be other programs – and as it has to parse multiple MBs of such files it tries to be fast rather than forgiving. This was always a problem if we reused this parser for files with a deb822 syntax which are mostly written by hand however, like apt_preferences or the deb822-style sources as these can include stray newlines and more importantly comments all over the place. As a stopgap we had pkgUserTagSection which deals at least with comments before and after a given stanza, but comments in between weren't really supported and now that we support parsing debian/control for e.g. build-dep we face the full comment problem e.g. with comments inbetween multi-line fields (like Build-Depends). We can't easily deal with this on the pkgTagSection level as the interface gives access to 'raw' char-pointers for performance reasons so we would need to optionally add a buffer here on which we could remove comments to hand out pointers into this buffer instead. The interface is quite large already and supports writing stanzas as well, which does not support comments at all either. So while in future it might make sense to have a parser setup which deals with and keeps comments in this commit we opt for the simpler solution for now: We officially declare that pkgTagSection does not support comments and instead expect the caller to deal with them, which in our case is pkgTagFile: pkgTagFile is extended with an additional mode which can deal with comments by dropping them from the buffer which will later form the input of pkgTagSection. The actual implementation is slightly more complex than this sentence suggests at first on one hand to have good performance and on the other to allow jumping directly to stanzas with offsets collected in a previous run (like our cache generation does it for example).
* add messages to our deprecation warnings in libaptDavid Kalnischkies2015-11-271-3/+2
| | | | Git-Dch: Ignore
* apt-pkg/tagfile.h: Include stdint.h, fixes rdep build failuresJulian Andres Klode2015-09-111-0/+1
|
* use a smaller type for flags storage in the cacheDavid Kalnischkies2015-08-101-0/+4
| | | | | | | | We store very few flags in the cache, so keeping storage space for 8 is enough for all of them and still leaves a few unused bits remaining for future extensions without wasting bytes for nothing. Git-Dch: Ignore
* remove the compatibility markers for 4.13 abiDavid Kalnischkies2015-08-101-16/+0
| | | | | | | | 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
* add c++11 override marker to overridden methodsDavid Kalnischkies2015-08-101-1/+1
| | | | | | | | | C++11 adds the 'override' specifier to mark that a method is overriding a base class method and error out if not. We hide it in the APT_OVERRIDE macro to ensure that we keep compiling in pre-c++11 standards. Reported-By: clang-modernize -add-override -override-macros Git-Dch: Ignore
* bring back deb822 sources.list entries as .sourcesDavid Kalnischkies2015-08-101-0/+8
| | | | | | | | | | | | | | | | | | Having two different formats in the same file is very dirty and causes external tools to fail hard trying to parse them. It is probably not a good idea for them to parse them in the first place, but they do and we shouldn't break them if there is a better way. So we solve this issue for now by giving our deb822 format a new filename extension ".sources" which unsupporting applications are likely to ignore an can begin gradually moving forward rather than waiting for the unknown applications to catch up. Currently and for the forseeable future apt is going to support both with the same feature set as documented in the manpage, with the longtime plan of adopting the 'new' format as default, but that is a long way to go and might get going more from having an easier time setting options than from us pushing it explicitely.
* fix memory leaks reported by -fsanitizeDavid Kalnischkies2015-08-101-1/+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
* make all d-pointer * const pointersDavid Kalnischkies2015-08-101-4/+4
| | | | | | | | | | | | | | 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
* add d-pointer, virtual destructors and de-inline de/constructorsDavid Kalnischkies2015-06-161-2/+0
| | | | | | | | 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
* implement a more c++-style TFRewrite alternativeDavid Kalnischkies2015-05-111-12/+35
| | | | | | | | | | TFRewrite is okay, but it has obscure limitations (256 Tags), even more obscure bugs (order for renames is defined by the old name) and the interface is very c-style encouraging bad usage like we do it in apt-ftparchive passing massive amounts of c_str() from std::string in. The old-style is marked as deprecated accordingly. The next commit will fix all places in the apt code to not use the old-style anymore.
* restore ABI of pkgTagSectionDavid Kalnischkies2014-11-081-13/+11
| | | | | | | | We have a d-pointer available here, so go ahead and use it which also helps in hidding some dirty details here. The "hard" part is keeping the abi for the inlined methods so that they don't break – at least not more than before as much of the point beside a speedup is support for more than 256 fields in a single section.
* explicit overload methods instead of adding parametersDavid Kalnischkies2014-11-081-0/+6
| | | | | | | | Adding a new parameter (with a default) is an ABI break, but you can overload a method, which is "just" an API break for everyone doing references to this method (aka: nobody). Git-Dch: Ignore
* guard const-ification API changesDavid Kalnischkies2014-11-081-0/+4
| | | | Git-Dch: Ignore
* do not inline virtual destructors with d-pointersDavid Kalnischkies2014-10-131-1/+1
| | | | | | | | | | | | | | Reimplementing an inline method is opening a can of worms we don't want to open if we ever want to us a d-pointer in those classes, so we do the only thing which can save us from hell: move the destructors into the cc sources and we are good. Technically not an ABI break as the methods inline or not do the same (nothing), so a program compiled against the old version still works with the new version (beside that this version is still in experimental, so nothing really has been build against this library anyway). 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
* fix occurrence typo in tagfile commentDavid Kalnischkies2014-09-271-1/+1
| | | | | Reported-By: codespell Git-Dch: Ignore
* Add APT::Acquire::$(host)::By-Hash=1 knob, add Acquire-By-Hash to Release fileMichael Vogt2014-05-221-1/+2
| | | | | | | The by-hash can be configured on a per-hostname basis and a Release file can indicate that it has by-hash support via a new flag. The location of the hash now matches the AptByHash spec
* improve pkgTagSection scanning and parsingDavid Kalnischkies2014-05-101-21/+42
| | | | | | Removes the 256 fields limit, deals consistently with spaces littered all over the place and is even a tiny bit faster than before. Even comes with a bunch of new tests to validate these claims.
* add support for apt-get build-dep foo.dscMichael Vogt2014-04-221-0/+2
|
* mark optional (private) symbols as hiddenDavid Kalnischkies2014-03-211-3/+5
| | | | | | | | 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
* warning: type qualifiers ignored on function return type [-Wignored-qualifiers]David Kalnischkies2014-03-131-1/+1
| | | | | Reported-By: gcc -Wignored-qualifiers Git-Dch: Ignore
* Merge remote-tracking branch 'mvo/bugfix/coverity' into debian/sidMichael Vogt2013-08-221-1/+1
|\ | | | | | | | | Conflicts: apt-pkg/tagfile.h
| * memset() pkgTagSections data to make coverity happyMichael Vogt2013-08-061-1/+1
| |
* | ensure that pkgTagFile isn't writing past Buffer lengthDavid Kalnischkies2013-08-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 91c4cc14d3654636edf997d23852f05ad3de4853 I removed the +256 from the pkgTagFile call parsing Release files as I couldn't find a mentioning of a reason for why and it was marked as XXX which suggested that at least someone else was suspicious. It turns out that it is indeed "documented", it just didn't found it at first but the changelog of apt 0.6.6 (29. Dec 2003) mentions: * Restore the ugly hack I removed from indexRecords::Load which set the pkgTagFile buffer size to (file size)+256. This is concealing a bug, but I can't fix it right now. This should fix the segfaults that folks are seeing with 0.6.[45]. The bug it is "hiding" is that if pkgTagFile works with a file which doesn't end in a double newline it will be adding it without checking if the Buffer is big enough to store them. Its also not a good idea to let the End pointer be past the end of our space, even if we don't access the data. Closes: 719629
* | fix -Wall errorsMichael Vogt2013-08-081-1/+1
|/
* fix some unitialized data membersMichael Vogt2013-08-051-1/+1
|
* fix pkgTagSection::Exists() and add testMichael Vogt2013-03-181-2/+2
|
* revert 2184.1.3: forward declaration instead of headersDavid Kalnischkies2011-12-131-0/+4
| | | | | The breakage is just to big for now, so guard the change with #ifndef APT_8_CLEANER_HEADERS and be nice to library users
* use forward declaration in headers if possible instead of includesDavid Kalnischkies2011-09-191-2/+4
|
* do not pollute namespace in the headers with using (Closes: #500198)David Kalnischkies2011-09-191-1/+1
|
* merge with debian/experimentalDavid Kalnischkies2011-09-131-1/+1
|\
| * merged from the debian-sid branchMichael Vogt2011-08-151-1/+1
| |\
| | * fix some cppcheck: (warning) Member variable is not initialized in the ↵David Kalnischkies2011-08-111-1/+1
| | | | | | | | | | | | constructor.
* | | Support large files in the complete toolset. Indexes of thisDavid Kalnischkies2011-09-131-2/+2
|/ / | | | | | | size are pretty unlikely for now, but we need it for deb packages which could become bigger than 4GB now (LP: #815895)
* | * [ABI-Break] Implement EDSP in libapt-pkg so that all front-ends whichMichael Vogt2011-06-081-13/+8
|\ \ | |/ |/| | | | | * [ABI-Break] merge lp:~mvo/apt/sha512-template to add support for sha512 * [ABI-Break] merge lp:~mvo/apt/dpointer to support easier extending without breaking the ABI
| * apt-pkg/tagfile.h: add dpointer placeholder, make destructor virtual; ↵Michael Vogt2011-01-281-6/+4
| | | | | | | | apt-pkg/deb/debsystem.h: make destructor virtual