summaryrefslogtreecommitdiff
path: root/apt-pkg
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | remove the Section member from package structDavid Kalnischkies2014-06-186-12/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 …).
* | | | cleanup datatypes mix used in binary cacheDavid Kalnischkies2014-06-188-204/+216
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | increase hashtable size for packages/groups by factor 5David Kalnischkies2014-06-183-22/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It also makes the size configureable, so it can be adapted in the future without the need for an abi break - and even by users… The increase was long overdue as it gives a >10% decrease in runtime of e.g. 'apt-get check -s'. Some (useless) benchmark with 69933 groups and 187796 packages without a pre-built cache: time apt-get check -so APT::Cache-HashTableSize=1 → 20m time apt-get check -so APT::Cache-HashTableSize=1000 → 6,41s time apt-get check -so APT::Cache-HashTableSize=2000 → 5,64s (old) time apt-get check -so APT::Cache-HashTableSize=3000 → 5,30s time apt-get check -so APT::Cache-HashTableSize=5000 → 5,08s time apt-get check -so APT::Cache-HashTableSize=6000 → 5,05s time apt-get check -so APT::Cache-HashTableSize=7000 → 5,02s time apt-get check -so APT::Cache-HashTableSize=8000 → 5,00s time apt-get check -so APT::Cache-HashTableSize=9000 → 4,98s time apt-get check -so APT::Cache-HashTableSize=10000 → 4,96s (new) time apt-get check -so APT::Cache-HashTableSize=15000 → 4,90s time apt-get check -so APT::Cache-HashTableSize=20000 → 4,86s time apt-get check -so APT::Cache-HashTableSize=30000 → 4,77s time apt-get check -so APT::Cache-HashTableSize=40000 → 4,74s time apt-get check -so APT::Cache-HashTableSize=50000 → 4,73s time apt-get check -so APT::Cache-HashTableSize=60000 → 4,71s The gap increases further for operations which have more package lookups. Factor 5 was chosen as higher values do not provide any really significant timing advantage anymore compared to the memory increase in my testing and there is always the possibility to increase it now if that changes. (also most users will not have 3 releases and 4 architectures in the cache, so theirs will be much smaller and faster).
* | | | Merge remote-tracking branch 'donkult/debian/sid' into debian/experimentalMichael Vogt2014-06-183-7/+27
|\| | | | | | | | | | | | | | | | | | | Conflicts: apt-private/private-install.cc
| * | | do not call resolver twice on (dist-)upgradeDavid Kalnischkies2014-06-181-0/+6
| | | |
| * | | fix SubstVar to be usable as a replace_all methodDavid Kalnischkies2014-06-181-7/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The name suggests that it is supposed to substitute a variable with a value, but we tend to use it in a more liberal replace_all() fashion, but this breaks if either of the parameters is empty or more importantly if two "variable" occurrences follow each other directly.
| * | | don't send pkg from an unknown architecture via EDSPDavid Kalnischkies2014-06-181-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | APT's cache can include packages from architectures dpkg has no knowledge about and can therefore not be installed for e.g. to allow easy lookups. There is no point in telling external solvers about them though and some of them might even be really talkative about ignoring them if we do.
* | | | Merge remote-tracking branch 'mvo/feature/drop-rights' into debian/experimentalMichael Vogt2014-06-182-0/+22
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: apt-pkg/contrib/fileutl.cc apt-pkg/contrib/fileutl.h
| * | | | DropPrivs in the solvers (just to be on the safe side)Michael Vogt2014-06-112-0/+20
| |/ / /
* | | | Merge remote-tracking branch 'mvo/feature/update-by-hash' into ↵Michael Vogt2014-06-186-11/+75
|\ \ \ \ | | | | | | | | | | | | | | | debian/experimental
| * | | | move ByHash into its own functionMichael Vogt2014-05-222-26/+37
| | | | |
| * | | | Add APT::Acquire::$(host)::By-Hash=1 knob, add Acquire-By-Hash to Release fileMichael Vogt2014-05-225-25/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | | add TODOMichael Vogt2014-05-221-0/+5
| | | | |
| * | | | Implement simple by-hash for apt updateMichael Vogt2014-05-222-9/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This implements a apt update schema that get the indexfiles by the hash instead of the name. The rational is that updates to the archive servers/mirrors are not atomic so the client may have the previous version of the Release file when the server updates to a new Release file and new Packages/Sources/Translations indexes. By keeping the files around by their hash we can still get the previous indexfile without a hashsum mismatch. Enable with APT::Acquire::By-Hash=1
* | | | | Merge remote-tracking branch 'mvo/feature/hash-stats' into debian/experimentalMichael Vogt2014-06-183-15/+11
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | | | [API-Break] rename pkgCache::Package::NextPackage to pkgCache::Package::NextMichael Vogt2014-06-183-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a internal struct not a external interface so the actual breakage should be small.
| * | | | | increase Pkg/Grp hash table size from 2k to 64kMichael Vogt2014-05-292-7/+3
| | | | | |
| * | | | | Fix more warnings from clangMichael Vogt2014-05-287-19/+22
| | | | | | | | | | | | | | | | | | | | | | | | Reported-By: clang++ -Werror
* | | | | | Merge branch 'debian/sid' into debian/experimentalMichael Vogt2014-06-188-34/+103
|\ \ \ \ \ \ | | |_|/ / / | |/| | / / | |_|_|/ / |/| | | | Conflicts: debian/changelog
| * | | | use pkgSrcRecords::Step() instead of Next()Michael Vogt2014-06-102-4/+4
| | | | |
| * | | | Merge remote-tracking branch 'mvo/feature/srcrec-enum2' into debian/sidMichael Vogt2014-06-102-15/+31
| |\ \ \ \
| | * | | | add pkgSrcRecords::Next() to step through all the pkgSrcRecordsMichael Vogt2014-06-092-15/+31
| | |/ / /
| * | | | do not revert candidate for protected packagesDavid Kalnischkies2014-06-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit 21b3eac8 I promoted the check for installable dependencies to a pre-install check, which also reverts to a known good candidate (the installed version) if it fails. This revert was done even for user requested candidate switches which disabled our Broken detection so that install requests which are impossible to satisfy do not fail anymore, but print an (incomplete) solution proposal and then exit successfully. Closes: 745046
| * | | | support parsing EDSP requests Architecture{,s} stanzaDavid Kalnischkies2014-05-301-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds also a small testcase for EDSP Git-Dch: Ignore
| * | | | without a filename we can't stat pipesDavid Kalnischkies2014-05-301-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | EDSP code uses pipes opened via an FD as sources and later for those files modification times and filesize are read - but never really used again. The result we get from FileFd is probably wrong, but as we don't use it anyway, we just don't fallback if we have nothing to fallback to Git-Dch: Ignore
| * | | | check exit status of external solversDavid Kalnischkies2014-05-302-10/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Solvers are supposed to exit successfully even if they haven't found a solution, but a solver which fails drastically (like e.g. segfaults) should be detected and dealt with accordingly instead of ignored.
| * | | | Merge EDSP 0.5 w/ multi-arch support for external solversDavid Kalnischkies2014-05-301-3/+30
| |\ \ \ \ | | | | | | | | | | | | | | | | | | "I am going to merge it tomorrow…"
| | * | | | EDSP: add APT-Release field to Package stanzasStefano Zacchiroli2014-05-041-2/+14
| | | | | |
| | * | | | EDSP: add Source field to Package stanzasStefano Zacchiroli2014-05-041-0/+6
| | | | | |
| | * | | | EDSP: add Architecture(s) multi-arch fields to the Request stanzaStefano Zacchiroli2014-05-041-0/+9
| | | | | |
| | * | | | EDSP: bump protocol version to 0.5Stefano Zacchiroli2014-05-041-1/+1
| | | |_|/ | | |/| |
| * | | | Merge remote-tracking branch 'mvo/debian/sid' into debian/sidMichael Vogt2014-05-294-4/+7
| |\ \ \ \ | | | |/ / | | |/| |
| | * | | Fix warning about uninitialized variableMichael Vogt2014-05-281-1/+2
| | | | | | | | | | | | | | | | | | | | Reported-By: clang++ -Werror
| | * | | use free() instead of delete[] in debSrcRecordParser::~debSrcRecordParserMichael Vogt2014-05-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | The Buffer was allocated using strndup() so we need to free it using free() instead of delete[]
| | * | | Do not try to cast a pkgDepCache::Policy to a pkgCacheMichael Vogt2014-05-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix incorrect cast in pkgDepCache::Policy::GetCandidateVer() Reported-By: clang -fsanitize=address -fno-omit-frame-pointer
| | * | | use free() instead of delete() when realloc is usedMichael Vogt2014-05-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ContentsExtract::~ContentsExtract() needs to use free() because Data got allocated via realloc() Reported-By: clang -fsanitize=address -fno-omit-frame-pointer
* | | | | Fix more warnings from clangMichael Vogt2014-05-297-11/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reported-By: clang++ -Werror Conflicts: apt-pkg/acquire-item.cc apt-pkg/acquire-item.h apt-pkg/deb/debmetaindex.h
* | | | | Merge remote-tracking branch 'upstream/debian/sid' into debian/experimentalMichael Vogt2014-05-294-195/+191
|\| | | | | |_|_|/ |/| | | | | | | | | | | Conflicts: test/integration/test-bug-747261-arch-specific-conflicts
| * | | fix tight loop detection and temporary removesDavid Kalnischkies2014-05-222-173/+165
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As outlined in #748355 apt segfaulted if it encountered a loop between a package pre-depending on a package conflicting with the previous as it ended up in an endless loop trying to unpack 'the other package'. In this specific case as an essential package is involved a lot of force needs to be applied, but can also be caused by 'normal' tight loops and highlights a problem in how we handle breaks which we want to avoid. The fix comes in multiple entangled changes: 1. All Smart* calls are guarded with loop detection. Some already had it, some had parts of it, some did it incorrect, and some didn't even try. 2. temporary removes to avoid a loop (which is done if a loop is detected) prevent the unpack of this looping package (we tried to unpack it to avoid the conflict/breaks, but due to a loop we couldn't, so we remove/deconfigure it instead which means we can't unpack it now) 3. handle conflicts and breaks very similar instead of duplicating most of the code. The only remaining difference is, as it should: deconfigure is enough for breaks, for conflicts we need the big hammer
| * | | consistently fail if Smart* packagemanager actions failDavid Kalnischkies2014-05-222-51/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These failure conditions come with an error message attached and the conditions aren't workaroundable (otherwise this would have been done instead of returning failure), so not erroring out here means that we execute dpkg later on with a known not-working ordering adding insult (our own error messages at the end) to injury (dpkg failure).
| * | | mark as Automatic/Downloadable pure as gcc suggestsDavid Kalnischkies2014-05-221-2/+2
| |/ / | | | | | | | | | | | | Git-Dch: Ignore Reported-By: gcc
| * | Never parse Version/Architecture tags in a Translation-$lang fileMichael Vogt2014-05-152-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Version/Architecture information in a Translation-$lang file is not allowed, so don't try to parse it. This is a fix for a bugreport where a Translation-en file contained the content of the regular Packages file (probably due to local FS corruption). This lead to strange error messages on file download. Thanks to Thomas Reusch for the report.
* | | Merge remote-tracking branch 'donkult/debian/experimental' into ↵Michael Vogt2014-05-1425-657/+1053
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | debian/experimental Conflicts: apt-pkg/acquire-item.cc apt-pkg/acquire-item.h
| * | | invalid cache if architecture set doesn't matchDavid Kalnischkies2014-05-104-10/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The cache heavily depends on the architecture(s) it is build for, especially if you move from single- to multiarch. Adding a new architecture to dpkg therefore has to be detected and must invalidate the cache so that we don't operate on incorrect data. The incorrect data will prevent us from doing otherwise sensible actions (it doesn't allow bad things to happen) and the recovery is simple and automatic in most cases, so this hides pretty well and is also not as serious as it might sound at first. Closes: 745036
| * | | improve pkgTagSection scanning and parsingDavid Kalnischkies2014-05-102-99/+173
| | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | parse and retrieve multiple Descriptions in one recordDavid Kalnischkies2014-05-097-89/+121
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It seems unlikely for now that proper archives will carry multiple Description-* stanzas in the Packages (or Translation-*) file, but sometimes apt eats its own output as shown by the usage of the CD team and it would be interesting to let apt output multiple translations e.g. in 'apt-cache show'.
| * | | tell download methods the expected hashesDavid Kalnischkies2014-05-093-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | Now that we have all hashes in the acquire system, pass the info down to the methods, so that it can use it in the request and/or to precheck the response.
| * | | promote ExpectedHashes to a pkgAcquire::Item memberDavid Kalnischkies2014-05-092-102/+40
| | | | | | | | | | | | | | | | | | | | | | | | Beside being another big API break with hopefully zero fallout in reality it avoids having the same member and helper code in each and every subclass.
| * | | use HashStringList in the acquire systemDavid Kalnischkies2014-05-0914-314/+399
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is not very extensible to have the supported Hashes hardcoded everywhere and especially if it is part of virtual method names. It is also possible that a method does not support the 'best' hash (yet), so we might end up not being able to verify a file even though we have a common subset of supported hashes. And those are just two of the cases in which it is handy to have a more dynamic selection. The downside is that this is a MAJOR API break, but the HashStringList has a string constructor for compatibility, so with a bit of luck the few frontends playing with the acquire system directly are okay.
| * | | use 'best' hash for source authenticationDavid Kalnischkies2014-05-092-75/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Collect all hashes we can get from the source record and put them into a HashStringList so that 'apt-get source' can use it instead of using always the MD5sum. We therefore also deprecate the MD5 struct member in favor of the list. While at it, the parsing of the Files is enhanced so that records which miss "Files" (aka MD5 checksums) are still searched for other checksums as they include just as much data, just not with a nice and catchy name. LP: 1098738