summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Release 1.1.101.1.10Julian Andres Klode2015-12-3057-251/+295
|
* Do not sync the cache fileJulian Andres Klode2015-12-291-2/+0
| | | | Integrity is taken care of by the checksum now.
* Add support for calculating hashes over the entire cacheJulian Andres Klode2015-12-293-5/+43
|
* pkgCacheGenerator: Allow passing down an already created cacheJulian Andres Klode2015-12-293-5/+19
| | | | | If we already have opened a cache, there is no point in having to open it again.
* pkgTagSection::Scan: Fix read of uninitialized valueJulian Andres Klode2015-12-291-1/+1
| | | | | We ignored the boundary of the buffer we were reading in while scanning for spaces.
* strutl.cc: Add declarations for the compat _ascii() functionsJulian Andres Klode2015-12-291-0/+2
| | | | | | This shuts up gcc Gbp-Dch: ignore
* Fix test case that was broken by switch of hash functionJulian Andres Klode2015-12-291-5/+5
| | | | This test relies on the ordering of the hash function.
* Turn tolower_ascii() and isspace_ascii() into inline functionsJulian Andres Klode2015-12-292-11/+21
| | | | | | | | | | To preserve compatibility, the new inline functions have _inline as a suffix, and a macro defines the old names to refer to the inline variants. The old functions are still preserved for binary compatibility. Also simplify the implementation of both functions.
* Switch to DJB hashing and use prime number as table sizeJulian Andres Klode2015-12-291-7/+7
| | | | | | On my testing system, consisting of unstable and experimental, this reduces the average chain from 6.5 to 4.5, and the longest chain from 17 to 15.
* BufferedFileFdPrivate: Make InternalFlush() save against errorsJulian Andres Klode2015-12-281-8/+8
| | | | | | | | | | | Previously, if flush errored inside the loop, data could have already been written to the wrapped descriptor without having been removed from the buffer. Also try to work around EINTR here. A better solution might be to have the individual privates detect an interrupt and return 0 in such a case, instead of relying on errno being untouched in between the syscall and the return from InternalWrite.
* aptconfiguration: Set default compression level to 6Julian Andres Klode2015-12-281-5/+5
| | | | | | | | | | | | | | | | | | Since commit 7a68effcb904b4424b54a30e448b6f2560cd1078, the xz and lzma compressors read the level of compression they shall use. A default of -9 is too much for them, this will use 674 MB, according to the xz manual page. Level -6 on the other hand only needs 94 MB memory for compression. This causes autopkgtest failures in the test-compressed-indexes test, as not enough memory exists to proceed. Change the other compression levels to 6 as well: The gzip and bzip2 FileFd backends do not read them, and use their code's default level which is 6, so do the same for external methods.
* apt-helper: Use CopyFile() for concatenating the filesJulian Andres Klode2015-12-281-10/+2
| | | | | | | There's no point in keeping using yet another read-then-write loop. Gbp-Dch: ignore
* BufferedWriter: flushing: Check for written < size instead of <=Julian Andres Klode2015-12-281-3/+1
| | | | | This avoids some issues with InternalWrite returning 0 because it just cannot write stuff at the moment.
* fix 3 typos/omissions in apt.conf(5)Beatrice Torracca2015-12-2711-144/+155
| | | | Closes: 809160
* deal with empty values properly in deb822 parserDavid Kalnischkies2015-12-272-2/+7
| | | | | | | | Regression introduced in 8710a36a01c0cb1648926792c2ad05185535558e, but such fields are unlikely in practice as it is just as simple to not have a field at all with the same result of not having a value. Closes: 808102
* Release 1.1.91.1.9Julian Andres Klode2015-12-2757-58/+305
|
* doc/acquire-additional-files.txt: Mention apt-helper cat-fileJulian Andres Klode2015-12-271-1/+2
| | | | People should know that this is exists.
* allow repositories to forbid arch:all for specific index targetsDavid Kalnischkies2015-12-276-3/+70
| | | | | | | | | | | | | | | | | | | | | | | | Debian has a Packages file for arch:all already, but the arch:any files contain arch:all packages as well, so downloading it would be a total waste of resources. Getting this solved is on the list of things to do, but it is also the hardest part – for index targets like Contents the situation is much easier and less server/client implementations are involved so we might not want to stall them. A repository can now declare via: No-Support-for-Architecture-all: Packages that even if an arch:all Packages exists, it shouldn't be downloaded, so that support for Contents files can be added now. See also 1dd20368486820efb6ef4476ad739e967174bec4 for the implementation of downloading arch:all index targets, which this is limiting. The field uses the name of the target from the apt configuration for simplicity and is negative by design as this field is intended to be supported/needed only for a "short" time (one or two Debian releases). While this commit theoretically supports any target, its expected to only see "Packages" as a value in reality.
* 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.
* rred: Use buffered writesJulian Andres Klode2015-12-271-3/+7
| | | | | Buffered writes improve performance a lot, given that we spent about 78% of the time in _write.
* FileFd: Add a buffered writing modeJulian Andres Klode2015-12-272-0/+153
| | | | | This is somewhat experimental right now, and might not work for everyone, so it is on an opt-in basis.
* FildFd: Introduce a Flush() function and call it from Close()Julian Andres Klode2015-12-272-0/+16
| | | | The flush function can be used for buffered writers.
* FileFdPrivate: Add getter and setter for fieldsJulian Andres Klode2015-12-271-9/+42
| | | | | We will soon implement a buffered writing decorator and we will need to forward attribute changes to those.
* fileutl: simple_buffer: Add write() and full() methodsJulian Andres Klode2015-12-271-0/+11
| | | | | | These can be used to implement write buffering Gbp-Dch: ignore
* fileutl: simple_buffer: Mark accessors as constJulian Andres Klode2015-12-271-2/+3
| | | | | | Suggested by David. Gbp-Dch: ignore
* FileFdPrivate: Extract SimpleBuffer and mark it as hiddenJulian Andres Klode2015-12-271-21/+24
| | | | Gbp-Dch: ignore
* rred: Only call pkgInitConfig() in test modeJulian Andres Klode2015-12-271-2/+2
| | | | | | | This accidentally slipped in in a previous commit, but it should be used only for testing mode. Reported-By: David Kalnischkies <david@kalnischkies.de>
* ParseDepends: Mark branches for build-dep parsing as unlikelyJulian Andres Klode2015-12-271-2/+2
| | | | | | We do not see those branches at all during normal mode of operation (that is, during cache generation), so tell the compiler about it.
* debListParser: Do not validate Description-md5 for correctness twiceJulian Andres Klode2015-12-271-2/+4
| | | | | The Set() method returns false if the input is no hex number, so simply use that.
* Hex2Digit: Do not use isxdigit()Niels Thykier2015-12-271-4/+9
| | | | | | | We directly check if we are a hex digit in HexDigit, so use that information. [jak@debian.org: Commit message wording]
* debListParser: ParseDepends: Only query native arch if neededJulian Andres Klode2015-12-271-1/+2
| | | | | | This makes the code parsing architecture lists slower, but on the other hand, improves the more generic case of reading dependencies from Packages files.
* pkgcachegen: Use std::unordered_map instead of std::mapJulian Andres Klode2015-12-272-7/+7
| | | | | std::unordered_map is faster than std::map in our use case, reducing cache generation time by about 10% in my benchmark.
* Convert most callers of isspace() to isspace_ascii()Julian Andres Klode2015-12-278-34/+37
| | | | | This converts all callers that read machine-generated data, callers that might work with user input are not converted.
* Introduce isspace_ascii() for use by parsersJulian Andres Klode2015-12-272-0/+19
| | | | This is like isspace(), but ignores the current locale.
* Release 1.1.81.1.8Julian Andres Klode2015-12-2613-13/+20
| | | | This release is made for Niels Thykier and apt-file.
* apt-helper: Check that we can open stdoutJulian Andres Klode2015-12-261-1/+2
| | | | Gbp-Dch: ignore
* Refactor InternalReadLine to not unroll Size == 0 caseJulian Andres Klode2015-12-261-5/+4
| | | | | | There is not much point and this is more readable. Gbp-Dch: ignore
* Change InternalReadLine to always use buffer.read() return valueJulian Andres Klode2015-12-261-12/+8
| | | | | | | | | This is mostly a documentation issue, as the size we want to read is always less than or equal to the size of the buffer, so the return value will be the same as the size argument. Nonetheless, people wondered about it, and it seems clearer to just always use the return value.
* apt-helper: Add a cat-file command for concatening filesJulian Andres Klode2015-12-261-0/+33
| | | | | This can automatically handle compressed files and is useful for stuff like apt-file.
* Release 1.1.71.1.7Julian Andres Klode2015-12-2613-13/+23
|
* Get rid of memmove() in our read bufferingJulian Andres Klode2015-12-261-76/+57
| | | | | | This further improves our performance, and rred on uncompressed files now spents 78% of its time in writing. Which means that we should really look at buffering those.
* rred: Allow passing files as arguments for compressor testingJulian Andres Klode2015-12-261-2/+14
| | | | | | | | This introduces a -t mode in which the first argument is input, the second is output and the remaining are diffs. This allows us to test patching compressed files, which are detected using their file extension.
* Use a hardcoded buffer size of 4096 to fix performanceJulian Andres Klode2015-12-261-4/+2
| | | | | | | | | | | | | | The code uses memmove() to move parts of the buffer to the front when the buffer is only partially read. By simply reading one page at a time, the maximum size of bytes that must be moved has a hard limit, and performance improves: In one test case, consisting of a 430 MB Contents file, and a 75K PDiff, applying the PDiff previously took about 48 seconds and now completes in 2 seconds. Further speed up can be achieved by buffering writes, they account for about 60% of the run-time now.
* Mark all FileFdPrivate classes as hidden1.1.6Julian Andres Klode2015-12-241-6/+6
| | | | Gbp-Dch: ignore
* 1.1.6 Christmas releaseJulian Andres Klode2015-12-2458-410/+432
|
* fix new[] vs delete mismatch introduced by b3db9d81David Kalnischkies2015-12-231-7/+7
| | | | | | | | And as we are at it lets fix the 'style' issue I introduced with the filefd changes as well. Reported-By: gcc -fsanitize's & cppcheck Git-Dch: Ignore
* ensure we got a lock in clean operationDavid Kalnischkies2015-12-232-4/+14
| | | | | | We try to acquired the locks, but we didn't stop if we failed to get it… Closes: 808561
* use a dynamic buffer for ReadLineDavid Kalnischkies2015-12-231-15/+22
| | | | | | | | | We don't need the buffer that often - only for ReadLine - as it is only occasionally used, so it is actually more efficient to allocate it if needed instead of statically by default. It also allows the caller to influence the buffer size instead of hardcoding it. Git-Dch: Ignore
* implement a buffer system for FileFd::ReadLineDavid Kalnischkies2015-12-231-27/+140
| | | | | | | | | | | | | | | The default implementation of ReadLine was very naive by just reading each character one-by-one. That is kinda okay for libraries implementing compression as they have internal buffers (but still not great), but while working with files directly or via a pipe as there is no buffer there so all those reads are in fact system calls. This commit introduces an internal buffer in the FileFd implementation which is only used by ReadLine. The more low-level Read and all other actions remain unbuffered – they just changed to deal with potential "left-overs" in the buffer correctly. Closes: 808579
* parse xz-compression level from configurationDavid Kalnischkies2015-12-221-2/+28
| | | | | | | If we use the library to compress xz, still try to understand and pick up the arguments we would have used to call xz to figure out which level the user wants us to use instead of defaulting to level 6 (which is the default level of xz).