summaryrefslogtreecommitdiff
path: root/app/flatpak-builtins-info.c
Commit message (Collapse)AuthorAgeFilesLines
* Ensure special characters in permissions and metadata are escapedRyan Gonzalez2023-03-161-2/+6
| | | | | | | | | This prevents someone from placing special characters in order to manipulate the appearance of the permissions list. CVE-2023-28101, GHSA-h43h-fwqx-mpp8 Signed-off-by: Ryan Gonzalez <ryan.gonzalez@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>
* decompose: Convert more FlatpakDir functions to use FlatpakDecomposedAlexander Larsson2020-11-101-2/+2
|
* Delete some unused variablesAlexander Larsson2020-11-101-1/+0
|
* decompose: Use FlatpakDecomposed for bundlesAlexander Larsson2020-11-101-17/+9
|
* decomposed: Return decomposed from find_installed_pref/refAlexander Larsson2020-11-101-5/+1
|
* decomposed: Take decomposed arg in flatpak_dir_load_deployed()Alexander Larsson2020-11-101-37/+30
| | | | Then convert all callers
* Avoid shadowing local variablesPhaedrus Leeds2020-09-151-19/+19
| | | | | | | | | | | Avoid shadowing variables that are already declared in a previous scope, and make such occurrences compile-time errors. These are not functional changes. In a few places do related code cleanup. A similar ostree PR is here: https://github.com/ostreedev/ostree/pull/2195
* info: Only load from specified installationPhaedrus Leeds2020-09-151-3/+1
| | | | | | | | | flatpak_find_deploy_for_ref() will look for a deploy across all installations, but we want to use the user-specified one, e.g. user if --user was passed. Pointed out here: https://github.com/flatpak/flatpak/pull/3853#discussion_r487711857
* Use generated variant accessors for commit objectsAlexander Larsson2020-02-171-7/+9
|
* Convert deploy data to use variant schemasAlexander Larsson2020-02-171-2/+2
|
* app: Don't print "< 0 bytes"Matthew Leeds2020-02-121-1/+1
| | | | Don't imply a download or install uses a negative number of bytes.
* Run uncrustifyMatthew Leeds2019-02-251-1/+1
| | | | | | | | I had to make a few manual edits but other than those the changes look reasonable. Closes: #2715 Approved by: matthiasclasen
* info, remote-info: Use print_wrappedMatthias Clasen2019-01-211-3/+4
| | | | | | | | This makes the NAME - DESCRIPTION line at the top wrap nicely at word boundaries. Closes: #2620 Approved by: alexlarsson
* info: Ellipsize end-of-life messagesMatthias Clasen2019-01-111-2/+8
| | | | | | | These can be long, so ellipsize them. Closes: #2499 Approved by: matthiasclasen
* info: Minor cleanupMatthias Clasen2019-01-111-6/+24
| | | | | | | Use existing defines for metadata fields. Closes: #2502 Approved by: alexlarsson
* info: Fix unicode formatting issuesMatthias Clasen2019-01-111-71/+77
| | | | | | | | | | | | | | printf(), and by extension, g_print() interprets field width in terms of bytes, not characters. Therefore, using %*s for padding strings with non-ASCII characters does not work. Instead, use the new utility function for aligned lines. While we are doing this, also fix up the alignment of the extension sections in the output. Closes: #2502 Approved by: alexlarsson
* info: Fix the --installation arg nameMatthias Clasen2019-01-111-1/+1
| | | | | | | | | | The info command has its own --system/--user/--installation options, but it was not setting a name for the argument of --installation. This was showing up in the completion missing a '=' after --installation. Closes: #2534 Approved by: alexlarsson
* info: Add a missing checkMatthias Clasen2019-01-091-1/+2
| | | | | | | | Don't consider 'Version:' for indentation when we don't have version information to show. Closes: #2521 Approved by: mwleeds
* info: Show license informationMatthias Clasen2019-01-091-12/+18
| | | | | | | This seems the right thing to do. Closes: #2521 Approved by: mwleeds
* info: Don't format size when poking at detailsMatthias Clasen2019-01-041-1/+1
| | | | | | | | | | | When the -s option is used, it is likely that the result is getting screenscraped and reparsed. Make that easier by producing a plain number in this case. Closes: #2536 Approved by: mwleeds
* info: Rename a variable for clarityMatthias Clasen2019-01-041-4/+4
| | | | | Closes: #2536 Approved by: mwleeds
* info: Move Sdk out of the commit groupAlexander Larsson2018-12-191-2/+2
| | | | | Closes: #2409 Approved by: alexlarsson
* info: Convert to use appdata from the deploy dataAlexander Larsson2018-12-191-7/+13
| | | | | Closes: #2409 Approved by: alexlarsson
* deploy-data: Prepare for versioningAlexander Larsson2018-12-191-2/+2
| | | | | | | | | | | | | | | | | 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
* info: Revise the outputMatthias Clasen2018-12-191-25/+93
| | | | | | | | | | | Show a description and show the appstream version, and tidy up the formatting. This gets us closer to the design in https://github.com/flatpak/flatpak/wiki/CLI-experimental-design Closes: #2409 Approved by: alexlarsson
* repo, info, remote-info: Share timestamp formattingMatthias Clasen2018-12-191-16/+0
| | | | | | | | Make format_timestamp() a shared utility, instead of having 3 almost identical copies. Closes: #2409 Approved by: alexlarsson
* info: Fix memleakAlexander Larsson2018-12-101-0/+2
|
* uninstall: Add support for fuzzy matchingMatthew Leeds2018-11-171-2/+2
| | | | | | | | | | | | | | | | | This adds support for fuzzy matching ref names (AKA "typo helper") to the uninstall command to mirror what the install command has. In short, this means you can do "flatpak uninstall gedit" instead of "flatpak uninstall org.gnome.gedit". Flatpak will prompt you to choose between similarly named installed refs, and will only make the choice for you if --assumeyes was used and there's only one match. Note that this commit does have the side effect that if there are multiple matching refs with the same ID (e.g. with different branches or in different installations) you are prompted to choose between them. Previously you were shown an error message. Closes: #2330 Approved by: matthiasclasen
* info: Fix leakAlexander Larsson2018-08-131-1/+3
| | | | | | | We have to free the return value of flatpak_deploy_get_dir. Closes: #1964 Approved by: mwleeds
* info: Fix leakAlexander Larsson2018-08-131-1/+1
| | | | | | | We have to free the FlatpakDir Closes: #1964 Approved by: mwleeds
* info: Fix leakAlexander Larsson2018-08-131-2/+2
| | | | | | | flatpak_dir_read_latest return value has to be freed Closes: #1964 Approved by: mwleeds
* Run uncrustifyAlexander Larsson2018-07-081-47/+47
| | | | | Closes: #1870 Approved by: alexlarsson
* Make p2p build non-optionalAlexander Larsson2018-06-191-2/+0
| | | | | Closes: #1800 Approved by: alexlarsson
* Fix a few mistakes in the docsMatthew Leeds2018-06-151-1/+1
|
* info: Add show-runtime and show-sdkAlexander Larsson2018-06-041-1/+32
| | | | | | | Also show sdk in regular output Closes: #1753 Approved by: alexlarsson
* flatpak info: Add --show-locationAlexander Larsson2018-06-041-1/+10
| | | | | | | This shows the location the ref is deployed to Closes: #1753 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-2/+2
| | | | | | | This is the start of the merging of lib/* into common/* Closes: #1706 Approved by: alexlarsson
* info: Add end-of-life statusAlexander Larsson2018-04-121-0/+8
| | | | | Closes: #1566 Approved by: alexlarsson
* run: Allow specifying an exact commit and runtime-commitAlexander Larsson2018-04-041-1/+1
| | | | | This also looks for removed but live deploys so that an app can be re-started as long as it is live.
* app: Print a warning if xa.metadata doesn't existMatthew Leeds2018-02-091-0/+4
| | | | | | | | | | | | All flatpaks built using version 0.9.4 or newer should have the xa.metadata field in the commit metadata, so warn if it doesn't exist. This commit changes the info command to print a warning rather than nothing and changes the info-remote command to print a warning rather than error out. Closes: #1351 Approved by: alexlarsson
* info: Show collection ID if availableMatthew Leeds2018-02-091-0/+10
| | | | | | | | If flatpak is compiled with P2P support and the commit in question has a collection ID in its metadata, show it. Closes: #1351 Approved by: alexlarsson
* info: Add support for flatpak info --file-accessAlexander Larsson2018-02-071-9/+26
| | | | | | | | This allows you to see if a particular app has access to a specific path. Closes: #1387 Approved by: alexlarsson
* Add info --show-permissionsAlexander Larsson2018-02-071-1/+25
| | | | | | | This shows the active permissions for the app, including any overrides. Closes: #1387 Approved by: alexlarsson
* app: Move installation management to flatpak-main.cMatthew Leeds2017-12-121-96/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* info: Add fields to match remote-infoAlexander Larsson2017-11-241-1/+40
| | | | | | | | This adds the Date, Subject and Parent fields that are shown by remote-info so these match for the fields where it makes sense. Closes: #1192 Approved by: alexlarsson
* fix crash in flatpak info when app is not present in originRobert McQueen2017-07-141-2/+4
|
* info: Make --show-metadata machine parseableAlexander Larsson2017-06-191-19/+17
| | | | | This is useful mainly to parse the keyfile, and is not very nice for pretty output.