summaryrefslogtreecommitdiff
path: root/cmdline
Commit message (Collapse)AuthorAgeFilesLines
* Improve and test distclean implementationDavid Kalnischkies2024-01-031-0/+2
| | | | | | | | | | | | | The implementation as-is as various smaller/esoteric bugs and inconsistencies like apt-get not supporting them, the option -s being supported in code but not accepted on the command line, the regex not escaping the dot before the file extension and exposing more implementation details to public headers than we actually need. Also comes with a small test case to ensure it actually works. References: bd7c126e3fb1b94e76e0e632c657cea854586844
* Merge branch 'fix-959093' into 'main'Julian Andres Klode2023-12-081-0/+2
|\ | | | | | | | | Add 'dist-clean' command to remove packages and list files See merge request apt-team/apt!290
| * Add 'dist-clean' command to remove packages and list filesGábor Németh2023-11-221-0/+2
| | | | | | | | | | | | | | We assume all files in the 'listsdir' are candidates. Keep only files ending with Release, Release.gpg, and InRelease. Closes: #959093
* | Use a more gitignore style matchingJulian Andres Klode2023-02-271-2/+2
|/ | | | | | | | Use a rightmost match for / so that if we end up with a Section: a/b/c, a 'c' matcher still matches. If the section does not contain any /, it can be matched using /pattern, e.g. /c only matches Section: c, but not Section: a/b/c.
* Have values in Section config trees refer to them in all componentsDavid Kalnischkies2023-01-301-10/+23
| | | | | | | | | | | | | | | | | | Hard coding each and every component is not only boring but given that everyone is free to add or use more we end up in situations in which apt behaves differently for the same binary package just because metadata said it is in different components (e.g. non-free vs. non-free-firmware). It is also probably not what the casual user would expect. So we instead treat a value without a component as if it applies for all of them. The previous behaviour can be restored by prefixing the value with "<undefined>/" as in the component is not defined. In an ideal world we would probably use "*/foo" for the new default instead of changing the behaviour for "foo", but it seems rather unlikely that the old behaviour is actually desired. All existing values were duplicated for all (previously) known components in Debian and Ubuntu.
* improve `--help` text for cmdline `apt autoremove`Camiel Vletter2022-12-131-1/+1
|
* Documentation for autopurge commandquazgar2022-10-282-0/+2
|
* Use pkgTagSection::Key in more places in src:aptDavid Kalnischkies2022-04-012-7/+9
| | | | | | | | | | The speed critical paths were converted earlier, but the remaining could benefit a tiny bit from this as well especially as we have the facility now available and can therefore brush up the code in various places in the process as well. Also takes the time to add the hidden Exists method advertised in the headers, but previously not implemented.
* Warn if the legacy trusted.gpg keyring is used for verificationJulian Andres Klode2022-02-221-0/+3
| | | | | With apt-key going away, people need to manage key files, rather than keys, so they need to know if any keys are in the legacy keyring.
* Fix "was already not hold" message grammarVille Skyttä2022-01-241-1/+1
|
* Use short options for cmpWalter Lozano2021-11-261-3/+3
| | | | | | | | In order to be consistent with other uses of cmp and to improve compatiblity with other implementations, like busybox one, change long options to short ones. Signed-off-by: Walter Lozano <walter.lozano@collabora.com>
* Use `command -v` instead of `which`Ville Skyttä2021-11-041-12/+1
| | | | | | | | | | `which` has been deprecated in debianutils 5.0+. The recommended replacement, `command -v`, is mandated by Debian policy these days, in addition to being required by POSIX and its predecessor specs at least since 1994. Not found commands cause no output from `command -v` per POSIX, so remove the redundant 2>&1's while at it.
* Inhibit autoremove calculation in apt-mark and apt showDavid Kalnischkies2021-08-281-0/+4
| | | | | | | As we never display the information in these code paths there isn't a lot of point in calculating it first saving us some precious CPU cycles. References: d6f3458badf2cfea3ca7de7632ae31daff5742be
* Merge branch 'pu/upgradecounter' into 'main'Julian Andres Klode2021-04-291-2/+7
|\ | | | | | | | | Count uninstallable packages in "not upgraded" See merge request apt-team/apt!169
| * Count uninstallable packages in "not upgraded"David Kalnischkies2021-04-251-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a first step of the solver can figure out that a package is uninstallable it might reset the candidate so that later steps are prevented from exploring this dead end. While that helps the resolver it can confuse the display of the found solution as this will include an incorrect count of packages not upgraded in this solution. It was possible before, but happens a fair bit more with the April/May resolver changes last year so finally doing proper counting is a good idea. Sadly this is a bit harder than just getting the number first and than subtracting the packages we upgraded from it as the user can influence candidates via the command line and a package which could be upgraded, but is removed instead shouldn't count as not upgraded as we clearly did something with it. So we keep a list of packages instead of a number which also help in the upgrade cmds as those want to show the list. Closes: #981535
* | Call MarkAndSweep only manually in apt-get for autoremoveDavid Kalnischkies2021-04-261-0/+2
|/ | | | | | | | | | | | | | | | | | | | | | | An interactive tool like aptitude needs these flags current far more often than we do as a user can see them in apt only in one very well defined place – the autoremove display block – so we don't need to run it up to four times while a normal "apt install" is processed as that is just busywork. The effect on runtime is minimal, as a single run doesn't take too long anyhow, but it cuts down tremendously on debug output at the expense of requiring some manual handholding. This is opt-in so that aptitude doesn't need to change nor do we need to change our own tools like "apt list" where it is working correctly as intended. A special flag and co is needed as we want to prevent the ActionGroup inside pkgDepCache::Init to be inhibited already so we need to insert ourselves while the DepCache is still in the process of being built. This is also the reason why the debug output in some tests changed to all unmarked, but that is fine as the marking could have been already obsoleted by the actions taken, just inhibited by a proper action group.
* Proper URI encoding for config requests to our test webserverDavid Kalnischkies2020-12-181-0/+9
| | | | | | Our http method encodes the URI again which results in the double encoding we have unwrap in the webserver (we did already, but we skip the filename handling now which does the first decode).
* pkgnames: Do not exclude virtual packages with --all-namesJulian Andres Klode2020-10-261-7/+3
| | | | | | | | | We accidentally excluded virtual packages by excluding every group that had a package, but where the package had no versions. Rewrite the code so the lookup consistently uses VersionList() instead of FirstVersion and FindPkg("any") - those are all the same, and this is easier to read.
* pkgnames: Correctly set the default for AllNames to falseJulian Andres Klode2020-10-261-1/+1
| | | | | | | We passed "false" instead of false, and that apparently got cast to bool, because it's a non-null pointer. LP: #1876495
* Merge branch 'pu/less-slaves' into 'master'Julian Andres Klode2020-08-041-1/+1
|\ | | | | | | | | Remove master/slave terminology See merge request apt-team/apt!124
| * CMake: Rename add_slaves() to add_links()Julian Andres Klode2020-07-141-1/+1
| | | | | | | | Sorry!
* | Merge branch 'pu/apt-key-deprecated' into 'master'Julian Andres Klode2020-08-041-4/+16
|\ \ | |/ |/| | | | | Fully deprecate apt-key, schedule removal for Q2/2022 See merge request apt-team/apt!119
| * apt-key: Allow depending on gpg instead of gnupgJulian Andres Klode2020-05-061-2/+2
| | | | | | | | | | Maintainer scripts that need to use apt-key del might as well depend on gpg, they don't need the full gnupg suite.
| * Fully deprecate apt-key, schedule removal for Q2/2022Julian Andres Klode2020-05-061-2/+14
| | | | | | | | | | | | | | | | | | People are still using apt-key add and friends, despite that not being guaranteed to work. Let's tell them to stop doing so. We might still want a list command at a future point, but this needs deciding, and a blanket ban atm seems like a sensible step until we figured that out.
* | Replace some magic 64*1024 with APT_BUFFER_SIZEJulian Andres Klode2020-06-231-3/+2
|/
* apt-helper: Add analyze-pattern helperJulian Andres Klode2020-03-121-0/+32
| | | | | | | | | | | | | | The analyze-pattern helper parses a pattern and then renders the parsed pattern, allowing you to analyze how the parser interpreted the string. This can be useful to analyse (yes, analyse-pattern also works) why a pattern is different from aptitude or why it does not work as expected. It can also be used to check if apt has pattern support, although that will miss out on the version shipped in eoan, but who really cares about that longer term anyway?
* cdrom: Remove old udev dlopen stuffJulian Andres Klode2020-02-261-1/+1
|
* Make map_pointer<T> typesafeJulian Andres Klode2020-02-241-2/+2
| | | | | | | | | | | Instead of just using uint32_t, which would allow you to assign e.g. a map_pointer<Version> to a map_pointer<Package>, use our own smarter struct that has strict type checking. We allow creating a map_pointer from a nullptr, and we allow comparing map_pointer to nullptr, which also deals with comparisons against 0 which are often used, as 0 will be implictly converted to nullptr.
* Replace map_pointer_t with map_pointer<T>Julian Andres Klode2020-02-241-4/+4
| | | | | | This is a first step to a type safe cache, adding typing information everywhere. Next, we'll replace map_pointer<T> implementation with a type safe one.
* Merge branch 'master' into 'master'Julian Andres Klode2020-02-181-9/+21
|\ | | | | | | | | apt-mark: don't lie about successful marks See merge request apt-team/apt!94
| * apt-mark: don't lie about successful marksTris Emmy Wilson2020-01-091-9/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit fixes an issue where apt-mark would say it had made a change before actually making the change. For example, when running as a user without permission to write to extended_states, the package is not marked but apt-mark claims it is: ~ % apt-mark manual rxvt-unicode rxvt-unicode set to manually installed. E: Could not create [...snip...] (13: Permission denied) E: Failed to write temporary StateFile /var/lib/apt/extended_states This commit moves reporting of "[package] set to [manually | automatically] installed" after saving extended_states and confirming it was successful.
* | Remove includes of (md5|sha1|sha2).h headersJulian Andres Klode2020-01-141-1/+0
|/ | | | Remove it everywhere, except where it is still needed.
* Fix typos reported by codespell in code commentsDavid Kalnischkies2019-07-101-1/+1
| | | | | | | | Also in old changelogs, but nothing really user visible like error messages or alike so barely noteworthy. Reported-By: codespell Gbp-Dch: Ignore
* Apply various suggestions by cppcheckDavid Kalnischkies2019-07-085-15/+12
| | | | Reported-By: cppcheck
* Introduce apt satisfy and apt-get satisfyJulian Andres Klode2019-06-112-0/+2
| | | | | | | | | | | | | | | | | | Allow to satisfy dependency strings supplied on the command line, optionally prefixed with "Conflicts:" to satisfy them like Conflicts. Build profiles and architecture restriction lists, as used in build dependencies, are supported as well. Compared to build-dep, build-essential is not installed automatically, and installing of recommended packages follows the global default, which defaults to yes. Closes: #275379 See merge request apt-team/apt!63
* apt-mark: Add hidden showheld alias for showholdJulian Andres Klode2019-05-101-2/+2
| | | | For Unit193 and those who value grammar, I suppose.
* cacheset: Remove simple cases of deprecated codeJulian Andres Klode2019-05-061-4/+4
| | | | | | This is missing the ones that are still actively used in cacheset.cc, we need to clean those up too, but they are obviously more tricky.
* Merge libapt-inst into libapt-pkgJulian Andres Klode2019-05-061-4/+4
|
* apt-helper: Support multiple hashes for a fileJulian Andres Klode2019-04-301-6/+28
| | | | | | This just peels supported hashes of the command-line until we reach a non-hash. For legacy compatability support, the first hash may be an empty string.
* sptr: Remove deprecated smart pointer classesJulian Andres Klode2019-02-262-2/+0
| | | | Please use the standard C++ variants instead.
* Merge branch 'pu/refuseunsignedlines' into 'master'Julian Andres Klode2019-02-011-23/+11
|\ | | | | | | | | Fail if InRelease or Release.gpg contain unsigned lines See merge request apt-team/apt!45
| * Merge and reuse tmp file handling across the boardDavid Kalnischkies2019-01-241-23/+11
| | | | | | | | | | | | Having many rather similar implementations especially if one is exported while others aren't (and the rest of it not factored out at all) seems suboptimal.
* | Add a "reinstall" command as an alias for "install --reinstall".Josh Triplett2019-01-272-0/+2
|/ | | | aptitude has a similar "reinstall" command for precedent.
* Merge branch 'patch-2' of github.com:techtonik/aptJulian Andres Klode2019-01-221-0/+1
|\
| * apt.cc: Add "apt info" alias for muscle memoryanatoly techtonik2018-11-211-0/+1
| | | | | | | | Muscle memory is acquired from querying package info with tools like snap, dnf etc.
* | apt-mark: Introduce minimize-manualJulian Andres Klode2019-01-101-0/+122
| | | | | | | | | | | | | | This visits dependencies of all manually installed metapackages, as determined by APT::Never-MarkAuto-Sections, and marks them as automatically installed. It can be used to clean up autoflags after a d-i install, for example.
* | Generalize %s does not take any argumentsJulian Andres Klode2019-01-101-1/+1
| | | | | | | | | | | | | | | | This used to be "apt-cache stats does not take any arguments", but replace "apt-cache stats" with "%s" so we can reuse it for other commands. Gbp-Dch: ignore
* | Merge branch 'bugfix/spaceinconfig' into 'master'Julian Andres Klode2018-12-041-1/+1
|\ \ | | | | | | | | | | | | Use quoted tagnames in config dumps See merge request apt-team/apt!32
| * | Use quoted tagnames in config dumpsDavid Kalnischkies2018-11-291-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | Tagnames in configuration can include spaces (and other nasties) e.g. in repository-specific configuration options due to Origin/Label potentially containing a space. The configuration file format supports parsing quoted as well as encoded spaces, but the output generated by apt-config and other places which might be feedback into apt via parsing (e.g. before calling apt-key in our gpgv method) do not quote and hence produce invalid configuration files. Changing the default to be an encoded tagname ensures that the output of dump can be used as a config file, but other users might not expect this so that is technically a backward-breaking change.
* / Provide a "autopurge" shortcutJulian Andres Klode2018-12-032-0/+2
|/ | | | | | | This adds a new "autopurge" command that will is a shortcut for "autoremove --purge" Thanks: Michael Vogt for the initial work