summaryrefslogtreecommitdiff
path: root/cmdline/apt-mark.cc
Commit message (Collapse)AuthorAgeFilesLines
* look into the right textdomain for apt-utils againDavid Kalnischkies2016-05-281-2/+0
| | | | | Broken in e7e10e47476606e3b2274cf66b1e8ea74b236757 by looking always into "apt" while we ship some tools in "apt-utils"…
* fail instead of segfault on unreadable config filesDavid Kalnischkies2016-05-201-15/+12
| | | | | | | | | | | | | The report mentions "apt list --upgradable", but there are others which have inconsistent behavior ranging from segfaulting to doing something with the partial (and hence incomplete) data. We had a recent report about sources.list (#818628), this one mentions prefences, the obvious next step is conf files… so the testcase is adapted to check for all three in file and directory versions and run a bunch of commands each time which should all have more or less the same behavior in such a case (aka error out). Closes: 824503
* drop some needlessly public declarations in libapt-privateDavid Kalnischkies2015-11-291-2/+2
| | | | Git-Dch: Ignore
* use function pointers instead of weak symbols for cmdline parsingDavid Kalnischkies2015-11-291-1/+1
| | | | | | | | 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.
* review of new/changed translatable program stringsJustin B Rye2015-11-211-3/+3
| | | | | Reference mail: https://lists.debian.org/debian-l10n-english/2015/11/msg00006.html
* revamp all tools help messagesDavid Kalnischkies2015-11-041-15/+4
| | | | | | | | | | | | | | | | 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.
* deal with --version more centrallyDavid Kalnischkies2015-11-041-12/+2
| | | | Git-Dch: Ignore
* move apts cmdline helper type into -privateDavid Kalnischkies2015-11-041-3/+2
| | | | | | | | 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-041-6/+9
| | | | | | | This ensures that location strings loaded from a location specified via configuration (Dir::Locale) effect the help messages for commands. Git-Dch: Ignore
* deduplicate main methodsDavid Kalnischkies2015-11-041-17/+5
| | | | | | | | 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-041-36/+36
| | | | | | | | | | | | | 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
* 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.
* cleanup Container.erase API to look more like std::containersDavid Kalnischkies2015-08-101-1/+1
| | | | | | | | C++11 slightly changes the API again to const_iterator, but we are find with iterators in the C++03 style for now as long as they look and behave equally to the methods of the standard containers. Git-Dch: Ignore
* stop displaying time of build in online helpJérémy Bobbio2015-03-161-2/+1
| | | | | | | | | | | | | | | | | | As part of the “reproducible builds” effort [1], we have noticed that apt could not be built reproducibly. One issue is that it uses the __DATE__ and __TIME__ macros of the C preprocessor to display the time of build in the online help. We believe this information not to be really useful to users as they can always look at the package data and metadata to figure it out. The attached patch simply removes this information. All non-documentation packages can then be built reproducibly with our current experimental framework. [David: changed the string slightly to be untranslateable as well] Closes: 774342
* (error) Same iterator is used with different containersDavid Kalnischkies2015-03-161-1/+1
| | | | | | | | cppcheck reports this error, its not really a problem for us as the API can actually deal with it via implicit conversion, but being explicit can't hurt and the less reported errors the better. Git-Dch: Ignore
* use dpkg --merge-avail only if needed in apt-markDavid Kalnischkies2014-11-191-45/+55
| | | | | | | | | | | Only "recent" versions of dpkg support stdin for merge instead of a file, so as a quick fix we delay calling it until we really need it which fixes most of the problem already. Checking for a specific dpkg version here is deemed too much work, just like using a temporary file here and depends a too high requirement for this minor usecase. After all, it didn't work at all before, so we break nobody here and can fix it if someone complains (with a patch).
* allow uninstalled packages to be put on holdDavid Kalnischkies2014-11-091-6/+57
| | | | | | | | | | | | | | dpkg wants to know about a package before it can be put on hold, so we have to at least hint about its existance in the available file it "maintaince" to know about such stuff. The simple thing would probably be to just feed all Packages files into dpkg as well, but what would be the point really? Exactly, so we take a shortcut here and just create dummies in the available file if we need to which isn't going to be that common as usually you are holding packages back and not off. Who would have thought that a simple feature like setting a package on hold requires more than 200 lines of code… at least with the testcase it is now explicitly tested code.
* use the same code to detect quiet setting in all toolsDavid Kalnischkies2014-11-091-16/+2
| | | | Git-Dch: Ignore
* streamline display of --help in all toolsDavid Kalnischkies2014-11-091-20/+2
| | | | | | | By convention, if I run a tool with --help or --version I expect it to exit successfully with the usage, while if I do call it wrong (like without any parameters) I expect the usage message shown with a non-zero exit.
* cleanup headers and especially #includes everywhereDavid Kalnischkies2014-03-131-9/+20
| | | | | | | | Beside being a bit cleaner it hopefully also resolves oddball problems I have with high levels of parallel jobs. Git-Dch: Ignore Reported-By: iwyu (include-what-you-use)
* warning: unused parameter ‘foo’ [-Wunused-parameter]David Kalnischkies2014-03-131-1/+1
| | | | | Reported-By: gcc -Wunused-parameter Git-Dch: Ignore
* warning: no previous declaration for foobar() [-Wmissing-declarations]David Kalnischkies2014-03-131-6/+6
| | | | | Git-Dch: Ignore Reported-By: gcc -Wmissing-declarations
* apt-mark help shows all commands nowMichael Vogt2014-01-241-0/+5
|
* do chdir("/") after chroot()Michael Vogt2013-08-221-2/+2
|
* squash merge of the feature/apt-binary branch without the changes from ↵Michael Vogt2013-08-121-16/+5
| | | | experimental
* fix some coverity chroot() releated warningsMichael Vogt2013-07-261-2/+2
|
* * cmdline/apt-mark.cc:David Kalnischkies2012-07-041-2/+14
| | | | | | - arch:all packages are treated as arch:native packages, but dpkg expects pkg:all for selections, so use the arch of the installed version instead of the package structure if possible. Thanks to Stepan Golosunov for the report! (Closes: #680041)
* fix two simple spelling issues found by Christian Perrier,David Kalnischkies2012-06-271-1/+1
| | | | | updating all po's, but as it is a simple transformation no re-call and instead deal with them on merge
* the previously used VERSION didn't work everywhere so we are switchingDavid Kalnischkies2012-03-221-1/+1
| | | | to the more standard PACKAGE_VERSION and make it work in every file
* fix the hold-testcase as it has problems with 'foreign' operationsDavid Kalnischkies2012-02-111-2/+2
|
* correctly ignore already (un)hold packagesDavid Kalnischkies2012-02-111-3/+4
|
* * cmdline/apt-mark.cc:David Kalnischkies2012-02-101-17/+112
| | | - detect if dpkg has multiarch support before calling --set-selections
* g++ 4.7 fixesMichael Vogt2012-01-021-0/+1
|\
| * g++ 4.7 fixesMichael Vogt2012-01-021-0/+1
| |
* | - provide a {Package,Version}List similar to {Package,Version}SetDavid Kalnischkies2011-11-111-8/+8
|/ | | | | * cmdline/apt-{get,cache,mark}.cc: - use Lists instead of Sets if input order should be preserved for commands accepting lists of packages, e.g. policy (Closes: #625960)
* use forward declaration in headers if possible instead of includesDavid Kalnischkies2011-09-191-0/+1
|
* reorder includes: add <config.h> if needed and include it at firstDavid Kalnischkies2011-09-131-3/+4
|
* provide a 'dpkg --set-selections' wrapper to set/release holdsDavid Kalnischkies2011-04-261-0/+116
|
* * cmdline/apt-mark.cc:David Kalnischkies2011-04-211-0/+257
- reimplement apt-mark in c++