summaryrefslogtreecommitdiff
path: root/apt-pkg
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | | | | | make errors more consistentMichael Vogt2014-08-011-2/+3
| | | | | | | | | |
| * | | | | | | | | check hashes of compressed files as wellMichael Vogt2014-08-011-0/+14
| | | | | | | | | |
| * | | | | | | | | fix transactionid passingMichael Vogt2014-08-011-1/+1
| | | | | | | | | |
| * | | | | | | | | mve MetaKey into pkgAcqBaseIndexMichael Vogt2014-08-012-1/+3
| | | | | | | | | |
| * | | | | | | | | fail early (again) on gpg sig failuresMichael Vogt2014-07-312-34/+15
| | | | | | | | | |
| * | | | | | | | | ensure InRelease->Release is transactional as wellMichael Vogt2014-07-311-2/+3
| | | | | | | | | |
| * | | | | | | | | make test_inreleae_to_release_reverts_all workMichael Vogt2014-07-311-5/+11
| | | | | | | | | |
| * | | | | | | | | Rework TransactionID stuffMichael Vogt2014-07-314-78/+125
| | | | | | | | | |
| * | | | | | | | | WIP cleanup pkgAcqMetaSigMichael Vogt2014-07-223-83/+42
| | | | | | | | | |
| * | | | | | | | | Download Release first, then Release.gpgMichael Vogt2014-07-213-67/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old way of handling this was that pkgAcqMetaIndex was responsible to check/move both Release and Release.gpg in place. This breaks the assumption of the transaction that each pkgAcquire::Item has a single File that its responsible for.
| * | | | | | | | | add pkgAcquire::TransactionHasError()Michael Vogt2014-07-213-6/+25
| | | | | | | | | |
| * | | | | | | | | WIP transaction based updateMichael Vogt2014-07-184-171/+303
| | | | | | | | | |
* | | | | | | | | | set PR_SET_NO_NEW_PRIVS also if run as non-rootDavid Kalnischkies2014-10-071-11/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changing user and co works only as root, but can do some things for methods run as normal user as well to protect them from being able to call setuid binaries like sudo to elevate their privileges. Also uses a cheap trick now to build with old unsupporting kernels.
* | | | | | | | | | fix foldmarkers in fileutl.ccDavid Kalnischkies2014-10-071-21/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Git-Dch: Ignore
* | | | | | | | | | Ignore EINVAL from prctl(PR_SET_NO_NEW_PRIVS)Michael Vogt2014-10-071-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ignore a EINVAL error here as it means that the kernel is too old to understand this option. We should not fail hard in this case but just ignore the error. closes: 764066
* | | | | | | | | | Rename DropPrivs() to DropPrivileges()Michael Vogt2014-10-073-3/+3
| |_|_|_|_|/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | Git-Dch: ignore
* | | | | | | | | Bump library version to libapt-pkg4.14Michael Vogt2014-10-031-1/+1
| | | | | | | | |
* | | | | | | | | implement MarkAndSweep in cc instead of headerDavid Kalnischkies2014-10-032-13/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Having it in the header exposes some implementation details, namely private methods and will cause problems for us if we ever want to change the actions. Git-Dch: Ignore
* | | | | | | | | rename StringType VERSION to VERSIONNUMBERDavid Kalnischkies2014-10-033-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | aptitude has a define for VERSION, so to not generate a FTBFS we just rename our enum element to a slightly less generic name. Git-Dch: Ignore
* | | | | | | | | fix another instance of warning: extra ‘;’ [-Wpedantic]David Kalnischkies2014-09-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Git-Dch: Ignore
* | | | | | | | | support parsing of all hashes for pdiffDavid Kalnischkies2014-09-303-152/+284
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fileformat of a pdiff index stores currently only SHA1 hashes. With this change, we look for all other hashes we support as well and take what we get, so that we can work after the release of jessie to get right of SHA1 if we want to. Note that the completely patched file is and was checked against the hashes collected from the Release file, so this transition isn't mission critical.
* | | | | | | | | mark private methods as hiddenDavid Kalnischkies2014-09-3018-84/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We are the only possible users of private methods, so we are also the only users who can potentially export them via using them in inline methods. The point is: We don't need these symbols exported if we don't do this, so marking them as hidden removes some methods from the API without breaking anything as nobody could have used them. Git-Dch: Ignore
* | | | | | | | | fix Configuration::FindVector APIDavid Kalnischkies2014-09-292-11/+2
| |_|_|_|/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | Git-Dch: Ignore
* | | | | | | | Merge branch 'debian/sid' into debian/experimentalMichael Vogt2014-09-292-36/+65
|\ \ \ \ \ \ \ \ | | |_|_|_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | Conflicts: apt-pkg/acquire-item.cc
| * | | | | | | Merge remote-tracking branch 'donkult/feature/generalize-gzipindex' into ↵Michael Vogt2014-09-262-37/+67
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | debian/sid
| | * | | | | | | generalize Acquire::GzipIndexMichael Vogt2014-09-212-37/+67
| | | | | | | | |
* | | | | | | | | replace c-string Mode with c++-string ActiveSubprocessDavid Kalnischkies2014-09-282-4/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A long-lasting FIXME in the acquire code points out the problem that we e.g. for decompressors assign c-string representations of c++-strings to the Mode variable, which e.g. cppcheck points out as very bad. In practice, nothing major happens as the c++-strings do not run out of scope until Mode would do, but that is bad style and fragile, so the obvious proper fix is to use a c++ string for storage to begin with. The slight complications stems from the fact that progress reporting code in frontends potentially uses Mode and compares it with NULL, which can't be done with std::string, so instead of just changing the type we introduce a new variable and deprecate the old one. Git-Dch: Ignore
* | | | | | | | | allow options between command and -- on commandlineDavid Kalnischkies2014-09-281-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This used to work before we implemented a stricter commandline parser and e.g. the dd-schroot-cmd command constructs commandlines like this. Reported-By: Helmut Grohne
* | | | | | | | | allow fetcher setup without directory creationDavid Kalnischkies2014-09-272-14/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | apt-get download and changelog as well as apt-helper reuse the acquire system for their own proposes without requiring the directories the fetcher wants to create, which is a problem if you run them as non-root and the directories do not exist as it greets you with: E: Archives directory /var/cache/apt/archives/partial is missing. - Acquire (13: Permission denied) Closes: 762898
* | | | | | | | | store source name and version in binary cacheDavid Kalnischkies2014-09-275-11/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | | | | fix: The class 'pkgSourceList' defines member variable with name 'SrcList' ↵David Kalnischkies2014-09-271-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | also defined in its parent class 'pkgSource' Git-Dch: Ignore Reported-By: cppcheck
* | | | | | | | | fix: Prefer prefix ++/-- operators for non-primitive typesDavid Kalnischkies2014-09-272-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Git-Dch: Ignore Reported-By: cppcheck
* | | | | | | | | fix: Consecutive return, break, continue, goto or throw statements are ↵David Kalnischkies2014-09-271-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | unnecessary. Git-Dch: Ignore Reported-By: cppcheck
* | | | | | | | | add and use 'apt-key verify' which prefers gpgv over gpgDavid Kalnischkies2014-09-271-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gnupg/gnupg2 can do verify just fine of course, so we don't need to use gpgv here, but it is what we always used in the past, so there might be scripts expecting a certain output and more importantly the output of apt-cdrom contains messages from gpg and even with all the settings we activate to prevent it, it still shows (in some versions) a quiet scary: "gpg: WARNING: Using untrusted key!" message. Keeping the use of gpgv is the simplest way to prevent it. We are increasing also the "Breaks: apt" version from libapt as it requires a newer apt-key than might be installed in partial upgrades.
* | | | | | | | | add --readonly option for apt-key advDavid Kalnischkies2014-09-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some advanced commands can be executed without the keyring being modified like --verify, so this adds an option to disable the mergeback and uses it for our gpg calling code. Git-Dch: Ignore
* | | | | | | | | use apt-key adv (+ gnupg) instead of gpgv for verifyDavid Kalnischkies2014-09-271-45/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | apt-key does the keyring merge as we need it, so we just call it instead of reimplementing it to do the merging before gpgv. This means we don't use gpgv anymore (we never depended on it explicitly - bad style), but it also means that the message in apt-cdrom add is a bit less friendly as it says loudly "untrusted key", but for a one-time command its okay.
* | | | | | | | | fix: warning: extra ‘;’ [-Wpedantic]David Kalnischkies2014-09-272-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reported-By: gcc -Wpedantic Git-Dch: Ignore
* | | | | | | | | fix: Member variable 'X' is not initialized in the constructor.David Kalnischkies2014-09-2710-26/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reported-By: cppcheck Git-Dch: Ignore
* | | | | | | | | fix occurrence typo in tagfile commentDavid Kalnischkies2014-09-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reported-By: codespell Git-Dch: Ignore
* | | | | | | | | add an API for cache filters/matcherDavid Kalnischkies2014-09-272-52/+209
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A lot of code deals with iterating over packages and checking for specific states. At the moment these are all handcrafted inplace, but that makes sharing common code which just differs in the states it checks rather difficult and is error prune. Having an API to construct arbitrary complex filters will come in handy for those. Git-Dch: Ignore
* | | | | | | | | move PCI::From* methods into CacheSetHelper classDavid Kalnischkies2014-09-272-87/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The methods itself deal with the helper a lot, so it makes sense to move them to the helper itself, which helps also if we want to override some of these methods, the FromString mentioned in the bugreport being the obvious example. VCI is spared from this change for now as while it would fit with the same reasoning it much heavier entangled with the previous CacheSetHelper change, so moving it now would mean breaking the API. The PCI change is worthwhile on its own though as it is used by VCI. Closes: 686221
* | | | | | | | | rework cachesets API to allow future extensionDavid Kalnischkies2014-09-272-144/+484
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | | | | | add APT::PackageUniverse as a pkgCache wrapperDavid Kalnischkies2014-09-271-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Git-Dch: Ignore
* | | | | | | | | add specialisations for std::vectorDavid Kalnischkies2014-09-271-2/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Git-Dch: Ignore
* | | | | | | | | mark pkg(All|Dist)Upgrade as deprecatedDavid Kalnischkies2014-09-272-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The comment above their definition marks them already as such, so this is only a formalisation of the deprecation and fixes the occurances we have in our own code together with removing a magic number. Git-Dch: Ignore
* | | | | | | | | fix progress output for (dist-)upgrade calculationDavid Kalnischkies2014-09-274-55/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, we had a start and a done of the calculation printed by higher-level code, but this got intermixed by progress reporting from an external solver or the output of autoremove code… The higherlevel code is now only responsible for instantiating a progress object of its choosing (if it wants progress after all) and the rest will be handled by the upgrade code. Either it is used to show the progress of the external solver or the internal solver will give some hints about its overall progress. The later isn't really a proper progress as it will jump forward after each substep, but that is at least a bit better than before without any progress indication. Fixes also the 'strange' non-display of this progress line in -q=1, while all others are shown, which is reflected by all testcase changes.
* | | | | | | | | de-duplicate version strings in the cacheDavid Kalnischkies2014-09-271-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Turns out that version numbers aren't as random as you might guess. In my cache for example, I have: Total package names: 69513 (1390 k) Total package structures: 188259 (9036 k) Total distinct versions: 186345 (13.4 M) Total dependencies: 2052242 (57.5 M) which amounts to 1035873 (10,1 M) strings. Reusing version strings reduces this to 161465 (3.479 k). This comes at a cost of course: Generation is slightly slower, but we are still faster than what we started with and it makes room (also cache size wise) for further changes.
* | | | | | | | | drop stored StringItems in favor of in-memory mappingsDavid Kalnischkies2014-09-278-124/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Strings like Section names or architectures are needed vary often. Instead of writing them each time we need them, we deploy sharing for these special strings. Until now, this was done with a linked list of strings in which we would search, which was stored in the cache. It turns out we can do this just as well in memory as well with a bunch of std::map's. In memory means here that it isn't available anymore if we have a partly invalid cache, but that isn't much of a problem in practice as the status file is compared to the other files we parse very small and includes mostly duplicates, so the space we would gain by storing is more or less equal to the size of the stored linked list…
* | | | | | | | | packages in the cache are sorted by name so noise-freeDavid Kalnischkies2014-09-271-9/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit aa0fe657e46b87cc692895a36df12e8b74bb27bb sorts the package names in the hashtable. We make use of this already in these functions, but as a minor sideeffect it also means that we don't have 'noise' anymore between packages belonging to the same group. We therefore don't need to check for a matching name in Grp.FindPkg anymore. Git-Dch: Ignore
* | | | | | | | | search for pkg names in the cache case-sensitiveDavid Kalnischkies2014-09-271-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Package names have to be lowercase (debian-policy §5.6.1) and in as lowlevel as these method are it would be quiet strange to treat an invalid package "suddently" as a valid one which other tools might or might not accept. If case-insensitivity is really needed the frontend should ensure this rather than these methods waste cpu cycles by default. Git-Dch: Ignore