summaryrefslogtreecommitdiff
path: root/apt-private
Commit message (Collapse)AuthorAgeFilesLines
* delay build-dep variable initialisation until neededDavid Kalnischkies2016-01-141-18/+20
| | | | Git-Dch: Ignore
* mark not-declared helper function for showsrc as staticDavid Kalnischkies2016-01-141-2/+2
| | | | Git-Dch: Ignore
* Do not show multiple identical apt-cache showsrc entriesMichael Vogt2016-01-141-3/+18
| | | | Closes: #734922
* AUTHORS: Update: I am active, bubulle is notJulian Andres Klode2016-01-121-1/+2
| | | | Gbp-Dch: ignore
* Sort the list of sources to be built and linkedMattia Rizzolo2016-01-111-2/+2
| | | | | | | | | Fix reproducibility issue due to readdir() order by sorting the list of sources to be built and linked. [jak@debian.org: Added summary and fixed typo] Closes: #810509
* search: Handle packages without descriptionJulian Andres Klode2016-01-111-2/+5
| | | | | | | | | | | | | If a package has no description, we would crash in search. While this should not happen, there seem to be some weird cases where it does. A safer way might be to make the whole parser thing safe against this, so pkgRecords::Lookup(Desc.FileList()) works and returns a parser where all values are empty. This would also fix all other instances of this bug, if there are any. Closes: #810622
* apt-helper: cat-file: Add -C/--compress optionJulian Andres Klode2016-01-071-1/+5
| | | | | | This allows passing compressing the output. The compressor must be a compressor name, extension, or an extension without the leading dot.
* Add new APT::Keep-Downloaded-Packages optionMichael Vogt2016-01-022-0/+13
| | | | | | | | | | This option controls if downloaded packages should be kept after a successful install or if they should be deleted. The default for "apt-get" is that they are kept (just like before). However the default for "apt" is that they get deleted. Closes: #160743
* fail installing build-deps if parsing them failedDavid Kalnischkies2016-01-021-1/+1
| | | | Git-Dch: Ignore
* ensure we got a lock in clean operationDavid Kalnischkies2015-12-231-4/+4
| | | | | | We try to acquired the locks, but we didn't stop if we failed to get it… Closes: 808561
* non-existing directories don't need to be cleanedDavid Kalnischkies2015-12-141-8/+18
| | | | | | | | | | Trying to clean up directories which do not exist seems rather silly if you think about it, so let apt think about it and stop it. Depends a bit on the caller if this is fixing anything for them as they might try to acquire a lock or doing other clever things as apt does. Closes: 807477
* require explicit paths to dsc/control as we do for deb filesDavid Kalnischkies2015-12-011-54/+59
| | | | | | | | | | | | | | Otherwise a user is subject to unexpected content-injection depending on which directory she happens to start apt in. This also cleans up the code requiring less implementation details in build-dep which is always good. Technically, this is an ABI break as we override virtual methods, but that they weren't overridden was a mistake resulting in pure classes, which shouldn't be pure, so they were unusable – and as they are new in 1.1 nobody is using them yet (and hopefully ever as they are borderline implementation details). Closes: 806693
* deal with configured build-essential firstDavid Kalnischkies2015-12-011-16/+23
| | | | | | | There is no need to check configured build-essentials for each package, doing it once at the start ought to be enough. Git-Dch: Ignore
* split build-dep satisfier loop out of DoBuildDepDavid Kalnischkies2015-12-011-292/+302
| | | | | | | Lets do this non-behaviour change before we modify the source for real as the reflow and moving would otherwise hide all the interesting changes. Git-Dch: Ignore
* drop some needlessly public declarations in libapt-privateDavid Kalnischkies2015-11-295-12/+9
| | | | Git-Dch: Ignore
* move 'unmet' handling into libapt-privateDavid Kalnischkies2015-11-292-0/+130
| | | | Git-Dch: Ignore
* do not override exact targetrelease matches with lesser matchesAndreas Cadhalpun2015-11-291-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The relevant testcases are in test/integration/test-apt-get-source. There is a test for #731853 that is supposed to "ensure that apt will pick the higher version number" of 0.0.1 (stable) and 0.1 (stable). However, this works by pure chance, as simply reversing the order of the two insertsource lines makes the test fail. So #731853 isn't really fixed, yet. Actually, that's related to the problem I reported, as the underlying issue for both is the same: In the FindSrc function apt chooses a new 'best hit', if either * there is a target release and it matches the release of the package, * or the version of the package is higher than the last best hit. Consider having 1.0 (stable), 2.0 (unstable) and 1.5 (unstable), in this order. Looking for the version in stable, apt first selects 1.0, because the release matches the target release, but then subsequently selects 2.0, because the version is higher. Looking for the version in unstable, apt first selects 2.0, because the release matches the target release, but then subsequently selects 1.5, because the release also matches the target release. The correct way would be to choose a new 'best hit', if either * there is a target release and it matches the release of the package, * or there is no target release and the version is higher than the last best hit. Closes: 746412 Mail-Reference: <565A604B.7090104@googlemail.com> Mail-Archive: https://lists.debian.org/debian-devel/2015/11/msg00470.html
* use function pointers instead of weak symbols for cmdline parsingDavid Kalnischkies2015-11-292-10/+9
| | | | | | | | Passing function pointers around while working on this was very icky, but if weak symbols are too much to ask for… Reverts "do not use "-Wl,-Bsymbolic-functions" during the build to avoid breakage" aka a5fc9be36211a290a7abc3ca2a8bf98943bc1f57.
* Revert "Revert "appease adequate with some weak symbols for -private""Julian Andres Klode2015-11-282-2/+6
| | | | This reverts commit 7ac9386cb6e272625490fcf3e8183b45e28bbc43.
* Revert "appease adequate with some weak symbols for -private"Julian Andres Klode2015-11-282-6/+2
| | | | | | This reverts commit 28f24d3dad1844af316337d565ba2ebc11c8ce97. This fails on Ubuntu as they build with -Bsymbolic-functions.
* appease adequate with some weak symbols for -privateDavid Kalnischkies2015-11-272-2/+6
| | | | Closes: #806422
* show potentially arch-qualified fullname in 'apt show'David Kalnischkies2015-11-211-0/+1
| | | | | | We do not show the architecture as a dedicated field as this is rather technical information, but as packagename it makes sense to show the architecture as other part of apt will refer to it in this way.
* apply various suggestions made by cppcheckDavid Kalnischkies2015-11-057-11/+8
| | | | | Reported-By: cppcheck Git-Dch: Ignore
* drop privileges in copy:// method as we do for file://David Kalnischkies2015-11-051-0/+2
| | | | | | | | | | | Continueing on the track of dropping privileges in all methods, lets drop it in copy, too, as the reasoning for it is very similar to file and the interaction between the too quiet interesting as copy kinda surfed as a fallback for file not being able to read the file. Both now show a better error message as well as it was previously claiming to have a hashsum mismatch, given that it couldn't read the file. Git-Dch: Ignore
* wrap every unlink call to check for != /dev/nullDavid Kalnischkies2015-11-041-1/+1
| | | | | | | | | | | | | | | | Unlinking /dev/null is bad, we shouldn't do that. Also, we should print at least a warning if we tried to unlink a file but didn't manage to pull it of (ignoring the case were the file is /dev/null or doesn't exist in the first place). This got triggered by a relatively unlikely to cause problem in pkgAcquire::Worker::PrepareFiles which would while temporary uncompressed files (which are set to keep compressed) figure out that to files are the same and prepare for sharing by deleting them. Bad move. That also shows why not printing a warning is a bad idea as this hide the error for in non-root test runs. Git-Dch: Ignore
* sanify API to get 'the' candidate versionDavid Kalnischkies2015-11-041-2/+2
| | | | | | | | | This was discussed a while ago on #debian-apt and now that I see myself making this mistake lets bite the bullet and fix it in the easy way out version: Using a new name which fits with a similar named setter and deprecate the old method instead of 'hostily' changing API. Closes: #803471
* revamp all tools help messagesDavid Kalnischkies2015-11-042-17/+53
| | | | | | | | | | | | | | | | The general idea is: A small paragraph on the tool itself as a description, a list of the most used (!= all) commands available in the tool, a remark where to find more information on the tool and its commands (aka: in the manpage) and finally a common block referring to even more manpages. In exchange options are completely omitted from the output as well as deprecated or obscure commands. (Better) Information about them is available in the manpages anyway and the few options which were listed before were also the least interesting ones (-o -c -q and co are hardly of interest for someone totally new looking to find info by asking for help and anyone with a bit of experience doesn't need this short list. Those would need a list of options applying to the command they call, but they are too numerous and command specific to list them sanely in this context.
* show version and type in "apt (r)depends"David Kalnischkies2015-11-041-0/+2
| | | | | | We can't for compatibility reasons in apt-cache, but apt can. Closes: 218995
* hidden support more apt-get/apt-cache commands in aptDavid Kalnischkies2015-11-048-1/+1595
| | | | | | | | | | | | | | apt is supposed to be a user-friendly interface, so while these commands are usually poweruser material and therefore do not need to be shown in general introduction manpages/help messages its of no use to not allow users to use them. This includes clean, autoclean, build-dep, source, download, changelog, depends, rdepends and showsrc – it doesn't include more non-interactive commands like dump or xvcg as those are usually used by scripts if at all. Closes: 778234, 780700, 781237
* deal with --version more centrallyDavid Kalnischkies2015-11-042-3/+28
| | | | Git-Dch: Ignore
* move apts cmdline helper type into -privateDavid Kalnischkies2015-11-042-10/+20
| | | | | | | | Its not as simple as I initially thought to abstract this enough to make it globally usable, so lets not pollute global namespace with this for now. Git-Dch: Ignore
* generate commands array after config is loadedDavid Kalnischkies2015-11-042-46/+68
| | | | | | | This ensures that location strings loaded from a location specified via configuration (Dir::Locale) effect the help messages for commands. Git-Dch: Ignore
* new quiet level -qq for apt to hide progress outputDavid Kalnischkies2015-11-045-14/+29
| | | | | | | | | -q is for logging and -qqq (old -qq) basically kills every output expect errors, so there should be a way of declaring a middleground in which the output of e.g. 'update' isn't as verbose, but still shows some things. The test framework was actually making use of by accident as it ignored the quiet level in output setup for apt before. Eventually we should figure out some better quiet levels for all tools…
* deduplicate main methodsDavid Kalnischkies2015-11-044-9/+99
| | | | | | | | All mains pretty much do the same thing, so lets try a little harder to move the common parts into -private to have the real differences more visible. Git-Dch: Ignore
* split up help messages for simpler reuseDavid Kalnischkies2015-11-042-9/+10
| | | | | | | | | | | | | That is one huge commit with busy work only: Help messages used to be one big translateable string, which is a pain for translators and hard to reuse for us. This change there 'explodes' this single string into new string for each documented string trying hard to split up the translated messages as well. This actually restores many translations as previously adding a single command made all of the bug message fuzzy. The splitup also highlighted that its easy to forget a line, duplicate one and similar stuff. Git-Dch: Ignore
* disable updating insecure repositories in apt by defaultDavid Kalnischkies2015-11-041-0/+1
| | | | | | apt is an interactive command and the reasons we haven't this option set for everything is mostly in keeping compatibility for a little while longer to allow scripts to be changed if need be.
* move 'search' implementations as wellDavid Kalnischkies2015-11-043-5/+211
| | | | Git-Dch: Ignore
* centralize 'show' implementation of apt and apt-cacheDavid Kalnischkies2015-11-043-46/+174
| | | | | | | | | | The show commands have different styles in both binaries as the audience is potentially very different, but that doesn't mean we need to separate the implementation especially as they are slightly similar. This also allows us to switch between the different show versions at runtime via an option. Git-Dch: Ignore
* add binary-specific options via Binary scopeDavid Kalnischkies2015-11-041-2/+16
| | | | | | Especially with apt now, it can be useful to set an option only for apt and not for apt-get. Using a binary-specific subtree which is merged into the root seems like a simple enough trick to achieve this.
* suggest 'apt autoremove' to get right of unneeded packagesDavid Kalnischkies2015-11-041-1/+5
| | | | | | | | | | The bugreport is more conservative in asking for a conditional, but given that this is a message intended to be read by users to be run by users we should suggest using a command intended to be used by users. And while we are at, add sudo to the message – conditional of course. Closes: 801571
* support .deb files in upgrade operations as wellDavid Kalnischkies2015-11-043-26/+31
| | | | | | The main part is refactoring through to allow hiding the magic needed to support .deb files in deeper layers of libapt so that frontends have less exposure to Debian specific classes like debDebPkgFileIndex.
* allow all dpkg selections to be set via apt-mark and libaptDavid Kalnischkies2015-11-041-8/+20
| | | | | | As we have support for 'hold', we need support for undoing a hold which in effect means that we implemented most other states as well, just that they weren't exposed in the interface directly so far.
* Allow -i and -u as aliases for installed and upgradable in listJulian Andres Klode2015-10-201-2/+2
| | | | This makes things much easier to use
* avoid using global PendingError to avoid failing too often too soonDavid Kalnischkies2015-09-141-1/+1
| | | | | | | | | | | | | | | | | | | Our error reporting is historically grown into some kind of mess. A while ago I implemented stacking for the global error which is used in this commit now to wrap calls to functions which do not report (all) errors via return, so that only failures in those calls cause a failure to propergate down the chain rather than failing if anything (potentially totally unrelated) has failed at some point in the past. This way we can avoid stopping the entire acquire process just because a single source produced an error for example. It also means that after the acquire process the cache is generated – even if the acquire process had failures – as we still have the old good data around we can and should generate a cache for (again). There are probably more instances of this hiding, but all these looked like the easiest to work with and fix with reasonable (aka net-positive) effects.
* do not discard new manual-bits while applying EDSP solutionsDavid Kalnischkies2015-09-141-7/+2
| | | | | | | | | | | | | | In private-install.cc we call MarkInstall with FromUser=true, which sets the bit accordingly, but while applying the EDSP solution we call mark install on all packages with FromUser=false, so MarkInstall believes this install is an automatic one and sets it to auto – so that a new package which is explicitely installed via an external solver is marked as auto and is hence also up for garbage collection in a following call. Ideally MarkInstall wouldn't reset it, but the detection is hard to do without regressing in other cases – and ideally ideally MarkInstall wouldn't deal with the autobit at all – so we work around this on the calling side for now.
* implement dpkgs vision of interpreting pkg:<arch> dependenciesDavid Kalnischkies2015-09-142-0/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | How the Multi-Arch field and pkg:<arch> dependencies interact was discussed at DebConf15 in the "MultiArch BoF". dpkg and apt (among other tools like dose) had a different interpretation in certain scenarios which we resolved by agreeing on dpkg view – and this commit realizes this agreement in code. As was the case so far libapt sticks to the idea of trying to hide MultiArch as much as possible from individual frontends and instead translates it to good old SingleArch. There are certainly situations which can be improved in frontends if they know that MultiArch is upon them, but these are improvements – not necessary changes needed to unbreak a frontend. The implementation idea is simple: If we parse a dependency on foo:amd64 the dependency is formed on a package 'foo:amd64' of arch 'any'. This package is provided by package 'foo' of arch 'amd64', but not by 'foo' of arch 'i386'. Both of those foo packages provide each other through (assuming foo is M-A:foreign) to allow a dependency on 'foo' to be satisfied by either foo of amd64 or i386. Packages can also declare to provide 'foo:amd64' which is translated to providing 'foo:amd64:any' as well. This indirection over provides was chosen as the alternative would be to teach dependency resolvers how to deal with architecture specific dependencies – which violates the design idea of avoiding resolver changes, especially as architecture-specific dependencies are a cornercase with quite a few subtil rules. Handling it all over versioned provides as we already did for M-A in general seems much simpler as it just works for them. This switch to :any has actually a "surprising" benefit as well: Even frontends showing a package name via .Name() [which doesn't show the architecture] will display the "architecture" for dependencies in which it was explicitely requested, while we will not show the 'strange' :any arch in FullName(true) [= pretty-print] either. Before you had to specialcase these and by default you wouldn't get these details shown. The only identifiable disadvantage is that this complicates error reporting and handling. apt-get's ShowBroken has existing problems with virtual packages [it just shows the name without any reason], so that has to be worked on eventually. The other case is that detecting if a package is completely unknown or if it was at least referenced somewhere needs to acount for this "split" – not that it makes a practical difference which error is shown… but its one of the improvements possible.
* if file is inaccessible for _apt, disable privilege drop in acquireDavid Kalnischkies2015-08-312-51/+0
| | | | | | | | | | | | | | | We had a very similar method previously for our own private usage, but with some generalisation we can move this check into the acquire system proper so that all frontends profit from this compatibility change. As we are disabling a security feature here a warning is issued and frontends are advised to consider reworking their download logic if possible. Note that this is implemented as an all or nothing situation: We can't just (not) drop privileges for a subset of the files in a fetcher, so in case you have to download some files with and some without you need to use two fetchers.
* install: Set a local deb as the candidate for that packageJulian Andres Klode2015-08-271-0/+12
| | | | | This ensures that we can install .deb files that are not the candidate for a given package.
* Add support for "apt-cache showsrc --only-source srcpkgname"Michael Vogt2015-08-181-1/+5
| | | | | Thanks: Steve Slangasek for the suggestion Closes: 695633
* Re-add support for G++ 4.8 and configure travis to use itJulian Andres Klode2015-08-172-2/+2
| | | | | | This makes tests work again! Gbp-Dch: ignore