summaryrefslogtreecommitdiff
path: root/completions
Commit message (Collapse)AuthorAgeFilesLines
* bash-complete search patterns for more commandsVille Skyttä2026-02-171-20/+26
|
* completion: historyChristopher Bock2026-01-051-2/+10
| | | | | | * complete command history-(list|info|undo|redo|rollback). complete the history-id for all but commands but history-list. set complet -o nosort to get the history-ids in a reverse order.
* bash-complete basic list search patternsVille Skyttä2026-01-051-1/+20
|
* completion: apt why/why-notChristopher Bock2025-08-161-3/+3
|
* completion: Add modernize-sources Christopher Bock2025-02-071-0/+1
| | | | Closes: #1094904
* Initial implementation of the 3.0 solverJulian Andres Klode2024-05-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a simple backtracking brute-force solver with heurisitcs, this initial version has the following known gaps: - Errors are not kept from branches, the error reporting after backtracking isn't particularly useful. - We cannot show automatically removed packages - We cannot replace packages with others - We do not have conflict-driven clause learning yet Untested: - Multi-arch This solver is fundamentally different in key aspects: - It solves smaller dependency groups before larger ones, leading us to avoid installing A in A|B if B is installed more often and more consistently. - It only keeps the automatic packages reachable via the strongest path. Currently it only implements autoremoval, but not display of autoremoval as we simply enqueue all automatically installed packages at the end when not doing automatic removal. This will need some translation where we Solve() first, and then Solve() again with the automatically installed packages added such that we can mark them as Garbage for display purposes. - It does not remove manually installed packages. Hook the solver in via the EDSP framework, this allows us to achieve easy initial integration without lots of issues. A lot of this work was planned and executed in my free time and then some leaked into work time I suppose. Implementation notes: - Restore the full backlog of items The annoying thing is that we record only when an item was enqueued and not the level at which it was installed, so when going back a decision level we might have to reinstall packages that were queued at an earlier decision level because they were only installed at a later decision level. - When picking one version, reject the others - Propagate conflicts up to reverse dependencies This will recursively mark every reverse dependency that can no longer be satisfied as MUSTNOT. Also make sure to recursively call Reject(Ver) from Reject(Pkg) to make sure we trigger the Rejections there. This means we now end up having Recursion in the algorithm. An alternative approach would be to push *reject* items to the heap and then do them, but this is not entirely straight forward and it may simply not be necessary. - Sort upgrades before other optional installs containing subsets If I want to upgrade a package A, I schedule A3|A2|A1; if another thing depends specifically on A1; we'd not be installed. Hence we need to sort upgrades first. This only is needed for optional packages; manual packages will figure this out naturally. - Rescoring is lazily implemented. Instead of calling make_heap() after rescoring items, we just mark the items as dirty and reinsert them. We also only rescore from the main solve loop, Reject() marks the heap as needing a rescore due to a Conflict (as some versions will no longer be installable), and RescoreWorkIfNeeded() then will do the rescoring. - Recursive unit propagation: Install() and Reject() recursively call each other to promote decisions across single-version dependencies (or across not-anymore satisfiable reverse-depends). - Make Reason constructors explicit, this enhances readability This makes calls like the one in here be Reject(object, Reason(otherObject)) Ensuring that it's clear that the 2nd argument is a reason at the caller side. - Split Decision into Decision and Hint vs. first draft When branching/deciding, we do not want to override SHOULD and MAY. We do not actually use them yet, and we do actually clean them when backtracking, but let's at least keep the data structure correct. Convert the enum to a 16-bit integer so we can still fit in the same space as before.
* Columnar output for package lists similar to 'ls'Christian Blichmann2024-04-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change makes it a bit easier to quickly grasp the changes about to be performed by apt. It displays package lists in a columnar format by default, similar to what `ls` produces for files. A new long option `--no-list-columns` and an associated `APT::Get::List-Columns` config setting control the behavior. Usage example, with 60 column wide terminal: ``` $ sudo apt upgrade | Reading package lists... Done | Building dependency tree... Done | Reading state information... Done | Calculating upgrade... Done | The following packages were automatically installed and are | no longer required: | libappindicator1 libindicator7 | libdbusmenu-gtk4 linux-image-5.14.0-4-amd64 | Use 'sudo apt autoremove' to remove them. | The following packages have been kept back: | criu linux-headers-amd64 nvidia-settings | libxnvctrl0 nvidia-modprobe xwayland | 0 upgraded, 0 newly installed, 0 to remove and 6 not upgrade| d. | ``` The effect becomes more pronounced with more packages (e.g. when doing a dist-upgrade).
* Merge branch 'dont-bash-complete-pkgs-before-cmd' into 'main'Julian Andres Klode2022-02-221-3/+6
|\ | | | | | | | | Don’t bash-complete package names before the command word See merge request apt-team/apt!221
| * Don’t bash-complete package names before the command wordJörn-Thorben Hinz2022-02-041-2/+5
| | | | | | | | | | | | | | | | Previously, package names would get suggested at the cursor position `_` for a command line like this: ``` ~# apt _ install git vim ```
| * bash-completion: Use the correct index range when looking for the command wordJörn-Thorben Hinz2022-02-041-1/+1
| | | | | | | | | | | | $words[0] contains the first word on the command-line, the name of the program: apt. Also, the last word already typed on the command-line might be the command, don’t ignore it.
* | Provide bash-completions for reinstall (same as for install)Jörn-Thorben Hinz2022-02-011-3/+3
| | | | | | | | Closes: #930295
* | Provide the same bash-completions for autopurge as for autoremoveJörn-Thorben Hinz2022-02-011-2/+2
|/ | | | | | 8ebb95805 missed some places to really bash-complete the autopurge command. Partially closes #930295
* Merge branch 'bash-completion-tweaks-apt-install' into 'main'Julian Andres Klode2022-02-011-9/+8
|\ | | | | | | | | Small tweaks for bash-completion after `apt install` See merge request apt-team/apt!216
| * Don’t fail bash-completion for `apt` when the nounset option is setJörn-Thorben Hinz2022-02-011-6/+4
| | | | | | | | | | Following a practice from upstream bash-completion. See for example https://github.com/scop/bash-completion/commit/b807460140aa6dda09eb2af2ecf3afa1971c84c4
| * Start bash-completing .deb file paths after the first . passed in anJörn-Thorben Hinz2022-01-261-1/+1
| | | | | | | | | | | | | | argument to `apt install` This will start by suggesting ./ and ../ which are both fine path segments for `apt install` to handle later.
| * Bash-complete either package name or .deb filename for `apt install`Jörn-Thorben Hinz2022-01-261-2/+3
| | | | | | | | | | Should provide a tiny speed-up when someone already started typing either one in the current argument.
| * Also bash-complete .deb filenames after `apt install` for paths starting with ~Jörn-Thorben Hinz2022-01-261-1/+1
| | | | | | | | | | | | At the time the bash-completion runs, the ~ (or even ~user) is not yet expanded to /home/user, so it did not match the existing comparison with `/*`.
* | Merge branch 'fix-bash-compl-cmd-comparison' into 'main'Julian Andres Klode2022-02-011-1/+1
|\ \ | | | | | | | | | | | | bash-completion: Don’t misidentify short options as commands to `apt` See merge request apt-team/apt!211
| * | bash-completion: Don’t misidentify short options as commands to `apt`Jörn-Thorben Hinz2022-02-011-1/+1
| |/ | | | | | | | | | | Previously the comparison would match `-s` with `edit-sources`, `-d` with `build-dep` etc. and the real commands would not get suggested after some of the short options.
* / Provide bash-completion of .dsc filenames for `apt build-dep`Jörn-Thorben Hinz2022-01-261-3/+7
|/ | | | Closes: #985899
* bash completion: use `grep -E` instead of `egrep`Ville Skyttä2021-11-131-1/+1
| | | | | | `egrep` has been deprecated in GNU grep since 2007, and in current post 3.7 Git it has been made to emit obsolescence warnings: https://git.savannah.gnu.org/cgit/grep.git/commit/?id=a9515624709865d480e3142fd959bccd1c9372d1
* bash completion: Add autopurge commandTomáš Janoušek2019-09-101-1/+1
|
* bash completion: add keysVasya Novikov2019-01-221-0/+2
|
* bash-completion: Fix spelling of autocleanMatt Kraai2017-05-041-1/+1
| | | | Closes: #861846
* bash-completion: Only complete understood file paths for installJohn R. Lenton2016-11-301-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previouosly apt's bash completion was such that, given $ mkdir xyzzz $ touch xyzzy.deb xyzzx.two.deb you'd get $ apt install xyzz<tab> xyzzx.two.deb xyzzz/ $ apt install /tmp/foo/xyzz<tab> xyzzx.two.deb xyzzz/ this is inconsistent (xyzzx.two.deb is listed but not xyzzy.deb), but worse than that it offered things that apt would not actually recognise as candidates for install: $ sudo apt install xyzzx.two.deb Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package xyzzx.two.deb E: Couldn't find any package by glob 'xyzzx.two.deb' E: Couldn't find any package by regex 'xyzzx.two.deb' With this small (trival, really) change, apt's bash completion will only offer things apt understands, and won't recquire an aditional period in the filename to offer it: $ apt install xyzz<tab>^C $ # (no completions!) $ apt install ./xyzz<tab> xyzzx.two.deb xyzzy.deb xyzzz/ $ apt install /tmp/foo/xyzz xyzzx.two.deb xyzzy.deb xyzzz/ fixes #28 LP: #1645815
* CMake: Install bash completions via cmakeJulian Andres Klode2016-08-151-0/+4
| | | | | | | Having the completions installed only by the packaging was an oversight. Gbp-Dch: ignore
* Provide complete apt bash completionJulian Andres Klode2016-05-131-6/+122
| | | | | | | | | This fixes Debian/apt#13 and the launchpad bug listed below, but is far more advanced. I went through private-cmndline.cc and looked at the supported options. LP: #1573547 Thanks: Elias Fröhner and Svyatoslav Gryaznov for the initial work
* Install bash completion with correct nameJulian Andres Klode2016-01-081-0/+107
Move the completion to completions/bash/apt and install all bash completions from completions/bash. Gbp-Dch: ignore