summaryrefslogtreecommitdiff
path: root/cmdline
Commit message (Collapse)AuthorAgeFilesLines
* review of new/changed translatable program stringsJustin B Rye2015-11-216-11/+12
| | | | | Reference mail: https://lists.debian.org/debian-l10n-english/2015/11/msg00006.html
* wrap every unlink call to check for != /dev/nullDavid Kalnischkies2015-11-041-2/+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
* revamp all tools help messagesDavid Kalnischkies2015-11-0410-131/+56
| | | | | | | | | | | | | | | | 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.
* hidden support more apt-get/apt-cache commands in aptDavid Kalnischkies2015-11-043-1506/+20
| | | | | | | | | | | | | | 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-0410-104/+15
| | | | Git-Dch: Ignore
* move apts cmdline helper type into -privateDavid Kalnischkies2015-11-0410-28/+21
| | | | | | | | 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-0410-75/+99
| | | | | | | 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-043-19/+16
| | | | | | | | | -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-0410-210/+53
| | | | | | | | 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-0410-230/+219
| | | | | | | | | | | | | 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
* move 'search' implementations as wellDavid Kalnischkies2015-11-042-207/+3
| | | | Git-Dch: Ignore
* centralize 'show' implementation of apt and apt-cacheDavid Kalnischkies2015-11-042-141/+3
| | | | | | | | | | 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
* allow all dpkg selections to be set via apt-mark and libaptDavid Kalnischkies2015-11-041-37/+65
| | | | | | 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.
* provide public interface to hold/unhold packagesDavid Kalnischkies2015-11-041-146/+16
| | | | | | We had this code lying around in apt-mark for a while now, but other frontends need this (and similar) functionality as well, so its high time that we provide a public interface in libapt for this stuff.
* switch 'apt-mark hold' from Pkg to Ver based operationDavid Kalnischkies2015-11-041-31/+18
| | | | | | | | | | | | | | Users hold a package foo (at version X) or try to prevent the installation of foo (usually based on the information they know about version X), even if we say that we "hold a package". Conceptionally we also need to know about which architecture we are talking and that is an information bound to a version (as a package can change architecture over time). We internally did this lookup from Pkg to Ver already, we just move this to a central place where the user has a change to influence it now. Git-Dch: Ignore
* add cacheset push_back wrapping for std::back_inserterDavid Kalnischkies2015-11-041-11/+7
| | | | | | | | | | | | As usual by now, not all containers wrapped by the cacheset containers support all methods, like push_back now, but they fail on use of these unusable methods only. Would be nice to not expose these methods for unsupporting containers at all, but that means either a lot of classes or a lot of std::enable_if magic, which seems like too big work for this small wrapper for now. Git-Dch: Ignore
* implement operator* for cacheset iteratorsDavid Kalnischkies2015-11-041-39/+38
| | | | | | | | | | | | | | | | Technically an abi-break as we change a template parameter to std::iterator for this, but this class is empty in all instances and just causes the right typedefs to be set – which were incorrect as detected by std::stable_partition as its implementation uses ::pointer and needs also a operator* implementation. In practice CacheSets have no external users (yet) and the difference is visible only at compile time (which was an error before and now works), not while linking. The changes to apt-mark are functionally identical to the code before, just that we use a std:: algorithm now instead of trying hard on our own.
* implement a public pkgSystem::MultiArchSupportedDavid Kalnischkies2015-11-041-36/+1
| | | | | | Some codepaths need to check if the system (in our case usually dpkg) supports MultiArch or not. We had copy-pasted the check so far into these paths, but having it as a system check is better for reusability.
* deal with spaces in path, command and filepaths in apt-keyDavid Kalnischkies2015-09-141-43/+61
| | | | | | | | Filenames we get could include spaces, but also the tmpdir we work in and the failures we print in return a very generic and unhelpful… Properly supporting spaces is a bit painful as we constructed gpg command before, which is now moved to (multilevel) calls to temporary scripts instead.
* various changes to increase test-coverageDavid Kalnischkies2015-09-144-21/+13
| | | | | | | And of course, testing obscure things ends up showing obscure 'bugs' or better shortcomings/inconsitencies, so lets fix them with the tests. Git-Dch: Ignore
* implement apt-get source msg 'Please use: $vcs' for gitDavid Kalnischkies2015-09-141-21/+13
| | | | | A bit unfair that only Bzr had this message. Lets at least print it for git as well with the option of adding more later without string changes.
* use a less generic special trigger filename for stdinDavid Kalnischkies2015-09-141-1/+1
| | | | Git-Dch: Ignore
* fix insecure use of /tmp in EDSP solver 'dump'David Kalnischkies2015-09-141-12/+29
| | | | | | | | | | | | As said in the bugreport, this is hardly a serious problem on a security front, but it was always on the list to have the filename configurable somehow and the stable filename is a problem for parallel executions. Using an environment variable (APT_EDSP_DUMP_FILENAME) for this is more or less the best we can do here as solvers do not get told about our configuration and such. Closes: 795600
* implement dpkgs vision of interpreting pkg:<arch> dependenciesDavid Kalnischkies2015-09-141-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* use clock() as source for SRV randomnessDavid Kalnischkies2015-09-011-14/+16
| | | | | | | | | | | | | | | Initializing a random number generator with the time since epoch could be good enough, but reaches its limits in test code as the 100 iterations might very well happen in the same second and hence the seed number is always the same… clock() has a way lower resolution so it changes more often and not unimportant: If many users start the update at the same time it isn't to unlikely the SRV record will be ordered in the same second choosing the same for them all, but it seems less likely that the exact same clock() time has passed for them. And if I have to touch this, lets change a few other things as well to make me and/or compilers a bit happier (clang complained about the usage of a GNU extension in the testcase for example).
* if file is inaccessible for _apt, disable privilege drop in acquireDavid Kalnischkies2015-08-312-11/+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.
* implement indextargets option 'DefaultEnabled'David Kalnischkies2015-08-291-0/+2
| | | | | | | | | | | Some targets like Contents-udeb are special-needs targets. Shipping the configuration snippet for them is okay, but they shouldn't be downloaded by default. Forcing the user to enable targets by uncommenting targets is wrong and this would still not really solve the problem completely as even if you want to download some -udebs it will probably not be for all sources you have enabled, so having the possibility of disabling a target by default, but giving the user the option to enable it on a per-source entry basis is better.
* implement PDiff patching for compressed filesDavid Kalnischkies2015-08-281-1/+4
| | | | | | | | | | | | | | | | | | Some additional files like 'Contents' are very big and should therefore kept compressed on the disk, which apt-file did in the past. It also implemented pdiff patching of these files by un- and recompressing these files on-the-fly, with this commit we can do the same – but we can do this in both pdiff patching styles (client and server merging) and secured by hashes. Hashes are in so far slightly complicated as we can't compare the hashes of the compressed files as we might compress them differently than the server would (different compressor versions, options, …), so we must compare the hashes of the uncompressed content. While this commit has changes in public headers, the classes it changes are marked as hidden, so nobody can use them directly, which means the ABI break is internal only.
* sources.list and indextargets option for pdiffsDavid Kalnischkies2015-08-271-1/+6
| | | | | | | Disabling pdiffs can be useful occasionally, like if you have a fast local mirror where the download doesn't matter, but still want to use it for non-local mirrors. Also, some users might prefer it to only use it for very big indextargets like Contents.
* use always priv-dropping for changelog download as rootDavid Kalnischkies2015-08-271-4/+1
| | | | | | | First of, the temporary directory we download the changelog to needs to be owned by _apt, but that also means that we don't need to check if we could/should drop privs as the download happens to a dedicated tempdir and only after that it is moved to its final location by a privileged user.
* fix various typos reported by codespellDavid Kalnischkies2015-08-271-1/+1
| | | | Reported-By: codespell
* Merge remote-tracking branch 'mvo/feature/srv-records' into debian/experimentalMichael Vogt2015-08-202-1/+29
|\
| * cleanupMichael Vogt2015-08-181-3/+6
| |
| * Merge remote-tracking branch 'upstream/debian/experimental' into ↵Michael Vogt2015-08-188-337/+421
| |\ | | | | | | | | | feature/srv-records
| * \ Merge branch 'debian/experimental' into feature/srv-recordsMichael Vogt2015-08-1814-633/+814
| |\ \ | | | | | | | | | | | | | | | | | | | | Conflicts: cmdline/apt-helper.cc cmdline/makefile
| * | | add GetSrvRecord helper to apt-pkg/contrib/srvrec.{cc,h}Michael Vogt2014-05-202-1/+26
| | | |
* | | | Add support for "apt-cache showsrc --only-source srcpkgname"Michael Vogt2015-08-181-0/+4
| | | | | | | | | | | | | | | | | | | | Thanks: Steve Slangasek for the suggestion Closes: 695633
* | | | Provide "apt-get full-upgrade" to match "apt full-upgrade"Michael Vogt2015-08-181-0/+1
| |_|/ |/| |
* | | Show full package records in apt-cache search -fKusanagi Kouichi2015-08-161-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | This just changes the DoSearch code to use DisplayRecord to display the record when the full record is requested. Closes: #660851 [jak@debian.org: Wrote the commit message]
* | | When looking if Provides match, OR them with the normal patchesJulian Andres Klode2015-08-161-1/+1
| | | | | | | | | | | | | | | | | | | | | Simply overriding the value caused patterns that previously matched a real package name to not match anymore. Closes: #760868
* | | apt-get: allow non-root --print-uris build-depJulian Andres Klode2015-08-141-1/+3
| | | | | | | | | | | | Closes: #283400
* | | apt: Add autoremove and auto-remove commandsJulian Andres Klode2015-08-141-0/+3
| | |
* | | Make auto-remove and auto-clean aliases for the versions without -Julian Andres Klode2015-08-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Some people type them instead of autoremove and autoclean, so make them happy. Closes: #274159 Makes-Happy: Ansgar
* | | apt-cache: Show an error if stats gets any argumentsJulian Andres Klode2015-08-141-1/+6
| | | | | | | | | | | | Closes: #153161
* | | Merge branch 'debian/experimental' of https://github.com/DonKult/apt into ↵Julian Andres Klode2015-08-141-1/+1
|\ \ \ | | | | | | | | | | | | debian/experimental
| * | | Replace all "press enter" occurrences with "press [Enter]"Luca Bruno2015-08-121-1/+1
| | | | | | | | | | | | | | | | | | | | Thanks: Andre Felipe Machado for initial patch Closes: 414848
* | | | Deprecate SPtrArray<T> and convert everyone to unique_ptr<T[]>Julian Andres Klode2015-08-132-4/+4
| | | | | | | | | | | | | | | | More standardization
* | | | Mark SPtr as deprecated, and convert users to std::unique_ptrJulian Andres Klode2015-08-131-3/+3
| | | | | | | | | | | | | | | | Switch to std::unique_ptr, as this is safer than SPtr.
* | | | apt-cache: Improve translateability of the "with priority" thingJulian Andres Klode2015-08-121-2/+2
| | | | | | | | | | | | | | | | Gbp-Dch: ignore
* | | | apt-cache: Modify policy output to use per-version pinsJulian Andres Klode2015-08-121-13/+30
|/ / / | | | | | | | | | Also optionally enable old output by setting APT::Policy=0.