summaryrefslogtreecommitdiff
path: root/app/flatpak-builtins-list.c
Commit message (Collapse)AuthorAgeFilesLines
* list: Show a warning if we can't load the current versionSimon McVittie2023-02-081-2/+8
| | | | | | | Conceptually similar to the previous commit, except it didn't crash before, just didn't display anything. Signed-off-by: Simon McVittie <smcv@collabora.com>
* list: Handle error in flatpak_dir_load_deployed()Simon McVittie2023-02-081-1/+11
| | | | | | | | | flatpak_dir_load_deployed() can fail and return NULL. If that happens, there is a semi-installed but broken app, and we should show a warning rather than crashing. Resolves: https://github.com/flatpak/flatpak/issues/5293 Signed-off-by: Simon McVittie <smcv@collabora.com>
* Add a vim modeline and .editorconfigPhaedrus Leeds2022-08-221-1/+1
| | | | | | | | | To make indentation work with less effort. The modeline was copied from libostree with minor modification and the .editorconfig from GLib. The advantage of having both a modeline and an editorconfig is we can work out of the box on more editor setups, and the modeline allows us to specify the style with a lot more fine grained control.
* build: Consistently include libglnx header as "libglnx.h"Simon McVittie2022-04-111-1/+1
| | | | | | | | | | | | | | Recent Meson versions have warnings if you add the subprojects directory as an include path, because the way Meson wants to consume subprojects is by the subproject's build system producing a Meson dependency object that encapsulates its include directory. Flatpak doesn't have a Meson build system yet, but I'm working on that. libglnx seems to be set up to have the libglnx directory be its include path instead: for example, ostree (by the author of libglnx) already uses "libglnx.h" or <libglnx.h> everywhere. Do the same here. Signed-off-by: Simon McVittie <smcv@collabora.com>
* list: Tweak logic for excluding Locale/Debug extensionsPhaedrus Leeds2021-11-181-21/+13
| | | | | | | | | | | | | | | | | | | | The man page states that the --all option for the list command includes runtime extensions (e.g. that end in .Locale or .Debug) and this is the case. When --all is omitted, we only show such extensions when the thing they extend is not already in the list. However when you run a command like "flatpak list --runtime --columns=application,branch", you get a list that excludes runtime locale extensions but includes app locale extensions, since the corresponding apps are not in the list despite presumably being installed. This doesn't seem like the right behavior, so tweak the logic so that app locale extensions are excluded when --all is omitted and --runtime is used. Strictly speaking the "extension-of" information is not guaranteed to be present in the deploy data (which acquires it from the metadata), but in practice it seems to be present for all but Sources extensions, and I think it should be considered required since we are already using it to implement functionality elsewhere in Flatpak: https://github.com/flatpak/flatpak/issues/4585
* list: Add a g_assert() for a coverity warningPhaedrus Leeds2021-05-041-0/+1
|
* app: Use autocleanup for FlatpakTablePrinterSimon McVittie2021-04-161-3/+1
| | | | | Fixes: https://github.com/flatpak/flatpak/issues/4223 Fixes: https://github.com/flatpak/flatpak/issues/4224
* decomposed: Remove _decomposed prefix on functionsAlexander Larsson2020-11-101-2/+2
| | | | | We now converted most of these and removed the non-prefixed functions, so rename them back.
* decomposed: Take decomposed arg in flatpak_dir_load_deployed()Alexander Larsson2020-11-101-1/+1
| | | | Then convert all callers
* list: Use decomposedAlexander Larsson2020-11-101-81/+57
|
* decomposed: Convert various "current ref" functions to use FlatpakDecomposedAlexander Larsson2020-11-101-2/+2
|
* utils: Allow passing sizes to more utilsAlexander Larsson2020-10-291-1/+1
| | | | | | | | These now take (optional) string length args: flatpak_id_has_subref_suffix() flatpak_levenshtein_distance() flatpak_is_valid_name() flatpak_is_valid_branch()
* list: Fix a tiny whitespace errorMatthew Leeds2020-04-271-1/+1
|
* Convert deploy data to use variant schemasAlexander Larsson2020-02-171-1/+1
|
* builtins: hide runtimes with [list|remote-ls] --app-runtimeWill Thompson2019-10-291-1/+1
| | | | | | | | | | | | | | | | | Currently, if you run: flatpak remote-ls flathub --app-runtime=com.endlessm.Platform//eos3.2 you see no apps (correct) but hundreds of runtimes. This is inconsistent with the documentation for the '--app-runtime' option, which says: > List applications that use the given runtime To fix this, default to not showing runtimes if '--app-runtime' is given. This is consistent with the behaviour if just '--app' is specified. If you run 'flatpak list --app-runtime=com.example.Foo --runtime' then you get apps using that runtime, plus all other runtimes, which seems fair enough to me.
* list/remote-ls/search: Split description fieldAlexander Larsson2019-04-241-8/+9
| | | | | | | | | | | | | Instead of combining name and comment we split them into two columns. We also disable the comment column by default for list and remote-ls as it is very poor in long tables. However, it is still there for search where it seems more useful. Also, the Application column title changed to Application ID to make it clearer what it is compared to the "Name" column. Closes: #2852 Approved by: alexlarsson
* list: Skip origin column if all origins are the sameAlexander Larsson2019-04-231-1/+1
| | | | | Closes: #2850 Approved by: matthiasclasen
* list: Skip arch column if all arches are the sameAlexander Larsson2019-04-231-1/+1
| | | | | Closes: #2850 Approved by: matthiasclasen
* CLI: Add skip_unique_if_default to ColumnAlexander Larsson2019-04-231-1/+2
| | | | | | | | Additionally flatpak_table_printer_set_columns now takes a boolean to say whether the arguments in use are the default. Closes: #2850 Approved by: matthiasclasen
* list: Add a runtime columnMatthias Clasen2019-04-121-1/+6
| | | | | | | This is useful information, so we should allow showing it. Closes: #2815 Approved by: alexlarsson
* Fix flatpak-list --archAlexander Larsson2019-03-191-1/+1
| | | | | | | It was looking at the wrong part of the ref... Closes: #2765 Approved by: mwleeds
* Run uncrustifyMatthew Leeds2019-02-251-19/+19
| | | | | | | | I had to make a few manual edits but other than those the changes look reasonable. Closes: #2715 Approved by: matthiasclasen
* table printer: Redo column handlingMatthias Clasen2019-01-141-24/+13
| | | | | | | | | | | | Move expand and ellipsize to the Column struct, and change flatpak_table_printer_set_column_titles to flatpak_table_printer_set_columns that sets up not just the title, but also expand and ellipsize. Update all callers. Closes: #2460 Approved by: alexlarsson
* Fix list ellipsizingMatthias Clasen2019-01-141-10/+9
| | | | | | | | | We were inadvertedly adding extra columns when trying to set existing columns as ellipsizable. Oops. Closes: #2460 Approved by: alexlarsson
* Add column completion to all commandsMatthias Clasen2019-01-111-0/+1
| | | | | | | | Call flatpak_complete_columns for every command that understands --columns. Closes: #2445 Approved by: alexlarsson
* list: Reserve -a to mean --allMatthew Leeds2019-01-081-1/+1
| | | | | | | | | When the --app-runtime option was added to the list command, -a was made its shortcut, but this already belongs to --all, so return it to the latter. Closes: #2543 Approved by: matthiasclasen
* list: Ellipsize options tooMatthias Clasen2019-01-081-0/+3
| | | | | | | The options column shows eol messages, which are long. Closes: #2497 Approved by: matthiasclasen
* list, remote-ls: Avoid a stray newlineMatthias Clasen2019-01-071-3/+6
| | | | | | | If we have nothing to print, don't print a stray newline. Closes: #2461 Approved by: matthiasclasen
* list/remote-ls: Move version and branch column ahead of archAlexander Larsson2018-12-201-3/+3
| | | | | Closes: #2448 Approved by: alexlarsson
* tables: Add support for ellipsize start and use for app idAlexander Larsson2018-12-201-4/+4
| | | | | | | | I think this makes a lot more sense than ellipsizing in the middle. Most app ids start with a common prefix after all. Closes: #2448 Approved by: alexlarsson
* list, search: Ellipsize app ids in the middleMatthias Clasen2018-12-201-2/+2
| | | | | | | | This preserves relevant information at the beginning and the end. Closes: #2448 Approved by: alexlarsson
* list, search: ellipsize more columnsMatthias Clasen2018-12-201-0/+3
| | | | | | | | The application IDs also tend to be long, so ellipsize that column as well. Closes: #2448 Approved by: alexlarsson
* list: Default to showing installation if multiple dirs searchedAlexander Larsson2018-12-201-0/+7
| | | | | Closes: #2450 Approved by: alexlarsson
* list: Sort table by refAlexander Larsson2018-12-201-1/+4
| | | | | Closes: #2450 Approved by: alexlarsson
* list: Add arch to default column setAlexander Larsson2018-12-191-1/+1
| | | | | | | | Without this its impossible to tell apart e.g. multiple runtimes for different arches. Closes: #2409 Approved by: alexlarsson
* CLI: Rename Architecture => Arch in list headersAlexander Larsson2018-12-191-1/+1
| | | | | | | | Its really wasteful to have headers much wider than the items in the column. Closes: #2409 Approved by: alexlarsson
* list: Get appdata from the deploy dataAlexander Larsson2018-12-191-19/+15
| | | | | Closes: #2409 Approved by: alexlarsson
* deploy-data: Prepare for versioningAlexander Larsson2018-12-191-1/+1
| | | | | | | | | | | | | | | | | This adds a version to the deply data format, assuming that if there is no version then it is 0. Also extends all loaders so that it can specify a required version, with the goal that most users are fine with old versions, but if you need more recent we have a (costly) conversion process to upgrade (will be added later). The library and the flatpak list/info commands require the most current version for full info, all other users can use any version. Also, as part of this we now pass the ref to flatpak_load_deploy_data() as this will be needed later for the backwards compat support. Closes: #2409 Approved by: alexlarsson
* list: Revise the outputMatthias Clasen2018-12-191-8/+49
| | | | | | | | | | | | Add new description, installation and version columns, revise the list of default columns, and make use of the new ellipsization support in the table printer. This gets us closer to the design in https://github.com/flatpak/flatpak/wiki/CLI-experimental-design Closes: #2409 Approved by: alexlarsson
* list: Spell out subpathsMatthias Clasen2018-10-101-1/+5
| | | | | This is useful information when debugging language-related issues.
* list: Add a --columns optionMatthias Clasen2018-10-051-67/+96
| | | | | | | This is more flexible than --show-details. Closes: #2090 Approved by: alexlarsson
* list: Add an option to filter by runtimeMatthias Clasen2018-10-051-4/+46
| | | | | | | | This lets you use list --app --app-runtime=org.gnome.Platform//3.24 to see which apps on your system still depend on this old runtime. Closes: #2175 Approved by: alexlarsson
* Run uncrustifyAlexander Larsson2018-07-081-4/+5
| | | | | Closes: #1870 Approved by: alexlarsson
* Make various operation work without a system installationAlexander Larsson2018-05-311-1/+1
| | | | | | | | This makes info, list, remotes, and search work if there is no system flatpak repo. Before it failed with EPERM. Closes: #1742 Approved by: alexlarsson
* common: Rename all private headers to *-private.hAlexander Larsson2018-05-241-1/+1
| | | | | | | This is the start of the merging of lib/* into common/* Closes: #1706 Approved by: alexlarsson
* list: Show end-of-life statusAlexander Larsson2018-04-121-4/+11
| | | | | Closes: #1566 Approved by: alexlarsson
* app: Move installation management to flatpak-main.cMatthew Leeds2017-12-121-83/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some builtin flatpak commands work on a single installation, and others work on multiple installations (such as the remotes command that lists both system and user remotes). Currently flatpak_option_context_parse() only supports returning one installation to its caller, and any commands that want to support multiple installations have to implement that themselves which leads to a lot of code duplication. This commit changes flatpak_option_context_parse() to take three new flags: * FLATPAK_BUILTIN_FLAG_ONE_DIR maintains the old behavior by returning one installation (i.e. user if --user was passed, system if --system, etc.). * FLATPAK_BUILTIN_FLAG_STANDARD_DIRS will get all the installations specified by the options, or the user and system ones if none were. * FLATPAK_BUILTIN_FLAG_ALL_DIRS includes non-default system installations along with the user and system ones if none were specified. These flags also affect what options are parsed and whether the directories are ensured to exist, so it makes sense in some circumstances for callers to pass a NULL out_dirs even when not using FLATPAK_BUILTIN_FLAG_NO_DIR. This commit also changes all the callers of flatpak_option_context_parse() so they maintain their behavior. The only functional change introduced by this is that using --installation multiple times for commands that only support one now leads to an error emitted by flatpak rather than by g_option_context_parse(). A follow-up commit will use this refactoring to make many commands behave more intelligently in determining which installation to use. Closes: #1205 Approved by: alexlarsson
* dir: Print debug output when opening flatpak dirsMatthew Leeds2017-10-041-0/+5
| | | | | | | | | | | | | | | | | | | | It's easy to end up with multiple flatpak installations on a system, and it's not always clear which one(s) flatpak is using. So this commit adds some debug output in some cases when flatpak opens an installation directory such as /var/lib/flatpak. This is especially important for people who build flatpak themselves because if you omit --prefix=/usr or use --with-system-install-dir your flatpak will look in non-standard locations like /usr/local/var/lib/flatpak. If we were to print this every time a flatpak directory is opened, it would flood the log. So instead add a utility function and use it strategically. Many flatpak commands will log the directory when they use flatpak_option_context_parse(), others in flatpak_find_deploy_for_ref(), and for others the logging has been added manually. Closes: #1067 Approved by: alexlarsson
* Handle app ids with dashes when ignoring locale/debug.Alexander Larsson2017-05-301-7/+6
| | | | | org.foo.foo-bar extensions become org.foo.foo_bar.Locale, etc, so we need to handle this properly.
* list/remote-ls: Also ignore .Sources by defaultAlexander Larsson2017-05-301-1/+2
|