Table of Contents
Table of Contents
FlatpakInstallation — Installation information
FlatpakInstallation is the toplevel object that software installers should use to operate on an flatpak applications.
An FlatpakInstallation object provides information about an installation location for flatpak applications. Typical installation locations are either system-wide (in $prefix/var/lib/flatpak) or per-user (in ~/.local/share/flatpak).
FlatpakInstallation can list configured remotes as well as installed application and runtime references (in short: refs), and it can add, remove and modify remotes.
FlatpakInstallation can also run, install, update and uninstall applications and runtimes, but FlatpakTransaction is a better, high-level API for these tasks.
To get a list of all configured installations, use flatpak_get_system_installations()
,
together with flatpak_installation_new_user()
.
The FlatpakInstallation API is threadsafe in the sense that it is safe to run two operations at the same time, in different threads (or processes).
FlatpakInstallation * flatpak_installation_new_system (GCancellable *cancellable
,GError **error
);
Creates a new FlatpakInstallation for the default system-wide installation.
FlatpakInstallation * flatpak_installation_new_system_with_id (const char *id
,GCancellable *cancellable
,GError **error
);
Creates a new FlatpakInstallation for the system-wide installation id
.
id | the ID of the system-wide installation. | [nullable] |
cancellable | a GCancellable. | [nullable] |
error | return location for a GError |
Since: 0.8
FlatpakInstallation * flatpak_installation_new_user (GCancellable *cancellable
,GError **error
);
Creates a new FlatpakInstallation for the per-user installation.
FlatpakInstallation * flatpak_installation_new_for_path (GFile *path
,gboolean user
,GCancellable *cancellable
,GError **error
);
Creates a new FlatpakInstallation for the installation at the given path
.
path | a GFile | |
user | whether this is a user-specific location | |
cancellable | a GCancellable. | [nullable] |
error | return location for a GError |
gboolean
flatpak_installation_get_is_user (FlatpakInstallation *self
);
Returns whether the installation is for a user-specific location.
GFile *
flatpak_installation_get_path (FlatpakInstallation *self
);
Returns the installation location for self
.
GFileMonitor * flatpak_installation_create_monitor (FlatpakInstallation *self
,GCancellable *cancellable
,GError **error
);
Gets monitor object for the installation. The returned file monitor will emit the “changed” signal whenever an application or runtime was installed, uninstalled or updated.
FlatpakInstalledRef * flatpak_installation_install (FlatpakInstallation *self
,const char *remote_name
,FlatpakRefKind kind
,const char *name
,const char *arch
,const char *branch
,FlatpakProgressCallback progress
,gpointer progress_data
,GCancellable *cancellable
,GError **error
);
flatpak_installation_install
has been deprecated since version 1.7.0 and should not be used in newly-written code.
Use flatpak_transaction_add_install()
instead.
This is an old deprecated function, you should use
FlatpakTransaction and flatpak_transaction_add_install()
instead. It has a lot more interesting features.
Install a new application or runtime.
Note that this function was originally written to always return a FlatpakInstalledRef. Since 0.9.13, passing FLATPAK_INSTALL_FLAGS_NO_DEPLOY will only pull refs into the local flatpak repository without deploying them, however this function will be unable to provide information on the installed ref, so FLATPAK_ERROR_ONLY_PULLED will be set and the caller must respond accordingly.
self | ||
remote_name | name of the remote to use | |
kind | what this ref contains (an FlatpakRefKind) | |
name | name of the app/runtime to fetch | |
arch | which architecture to fetch (default: current architecture). | [nullable] |
branch | which branch to fetch (default: 'master'). | [nullable] |
progress | progress callback. | [scope call][nullable] |
progress_data | user data passed to | [closure progress][nullable] |
cancellable | a GCancellable. | [nullable] |
error | return location for a GError |
FlatpakInstalledRef * flatpak_installation_install_full (FlatpakInstallation *self
,FlatpakInstallFlags flags
,const char *remote_name
,FlatpakRefKind kind
,const char *name
,const char *arch
,const char *branch
,const char * const *subpaths
,FlatpakProgressCallback progress
,gpointer progress_data
,GCancellable *cancellable
,GError **error
);
flatpak_installation_install_full
has been deprecated since version 1.7.0 and should not be used in newly-written code.
Use flatpak_transaction_add_install()
instead.
This is an old deprecated function, you should use
FlatpakTransaction and flatpak_transaction_add_install()
instead. It has a lot more interesting features.
Install a new application or runtime.
Note that this function was originally written to always return a FlatpakInstalledRef. Since 0.9.13, passing FLATPAK_INSTALL_FLAGS_NO_DEPLOY will only pull refs into the local flatpak repository without deploying them, however this function will be unable to provide information on the installed ref, so FLATPAK_ERROR_ONLY_PULLED will be set and the caller must respond accordingly.
self | ||
flags | set of FlatpakInstallFlags flag | |
remote_name | name of the remote to use | |
kind | what this ref contains (an FlatpakRefKind) | |
name | name of the app/runtime to fetch | |
arch | which architecture to fetch (default: current architecture). | [nullable] |
branch | which branch to fetch (default: 'master'). | [nullable] |
subpaths | A list of subpaths to fetch, or | [nullable][array zero-terminated=1] |
progress | progress callback. | [scope call][nullable] |
progress_data | user data passed to | [closure progress][nullable] |
cancellable | a GCancellable. | [nullable] |
error | return location for a GError |
FlatpakInstalledRef * flatpak_installation_update (FlatpakInstallation *self
,FlatpakUpdateFlags flags
,FlatpakRefKind kind
,const char *name
,const char *arch
,const char *branch
,FlatpakProgressCallback progress
,gpointer progress_data
,GCancellable *cancellable
,GError **error
);
flatpak_installation_update
has been deprecated since version 1.7.0 and should not be used in newly-written code.
Use flatpak_transaction_add_update()
instead.
This is an old deprecated function, you should use
FlatpakTransaction and flatpak_transaction_add_update()
instead. It has a lot more interesting features.
Update an application or runtime.
If the specified package is not installed, then FLATPAK_ERROR_NOT_INSTALLED
will be thrown.
If no updates could be found on the remote end and the package is
already up to date, then FLATPAK_ERROR_ALREADY_INSTALLED
will be thrown.
self | ||
flags | set of FlatpakUpdateFlags flag | |
kind | whether this is an app or runtime | |
name | name of the app or runtime to update | |
arch | architecture of the app or runtime to update (default: current architecture). | [nullable] |
branch | name of the branch of the app or runtime to update (default: master). | [nullable] |
progress | the callback. | [scope call][nullable] |
progress_data | user data passed to | [closure progress][nullable] |
cancellable | a GCancellable. | [nullable] |
error | return location for a GError |
FlatpakInstalledRef * flatpak_installation_update_full (FlatpakInstallation *self
,FlatpakUpdateFlags flags
,FlatpakRefKind kind
,const char *name
,const char *arch
,const char *branch
,const char * const *subpaths
,FlatpakProgressCallback progress
,gpointer progress_data
,GCancellable *cancellable
,GError **error
);
flatpak_installation_update_full
has been deprecated since version 1.7.0 and should not be used in newly-written code.
Use flatpak_transaction_add_update()
instead.
This is an old deprecated function, you should use
FlatpakTransaction and flatpak_transaction_add_update()
instead. It has a lot more interesting features.
Update an application or runtime.
If the specified package is not installed, then FLATPAK_ERROR_NOT_INSTALLED
will be thrown.
If no updates could be found on the remote end and the package is
already up to date, then FLATPAK_ERROR_ALREADY_INSTALLED
will be thrown.
self | ||
flags | set of FlatpakUpdateFlags flag | |
kind | whether this is an app or runtime | |
name | name of the app or runtime to update | |
arch | architecture of the app or runtime to update (default: current architecture). | [nullable] |
branch | name of the branch of the app or runtime to update (default: master). | [nullable] |
subpaths | A list of subpaths to fetch, or | [nullable][array zero-terminated=1] |
progress | the callback. | [scope call][nullable] |
progress_data | user data passed to | [closure progress][nullable] |
cancellable | a GCancellable. | [nullable] |
error | return location for a GError |
gboolean flatpak_installation_uninstall (FlatpakInstallation *self
,FlatpakRefKind kind
,const char *name
,const char *arch
,const char *branch
,FlatpakProgressCallback progress
,gpointer progress_data
,GCancellable *cancellable
,GError **error
);
flatpak_installation_uninstall
has been deprecated since version 1.7.0 and should not be used in newly-written code.
Use flatpak_transaction_add_uninstall()
instead.
This is an old deprecated function, you should use
FlatpakTransaction and flatpak_transaction_add_uninstall()
instead. It has a lot more interesting features.
Uninstall an application or runtime.
self | ||
kind | what this ref contains (an FlatpakRefKind) | |
name | name of the app or runtime to uninstall | |
arch | architecture of the app or runtime to uninstall; if
| [nullable] |
branch | name of the branch of the app or runtime to uninstall;
if | [nullable] |
progress | the callback. | [scope call][nullable] |
progress_data | user data passed to | [closure progress][nullable] |
cancellable | a GCancellable. | [nullable] |
error | return location for a GError |
gboolean flatpak_installation_uninstall_full (FlatpakInstallation *self
,FlatpakUninstallFlags flags
,FlatpakRefKind kind
,const char *name
,const char *arch
,const char *branch
,FlatpakProgressCallback progress
,gpointer progress_data
,GCancellable *cancellable
,GError **error
);
flatpak_installation_uninstall_full
has been deprecated since version 1.7.0 and should not be used in newly-written code.
Use flatpak_transaction_add_uninstall()
instead.
This is an old deprecated function, you should use
FlatpakTransaction and flatpak_transaction_add_uninstall()
instead. It has a lot more interesting features.
Uninstall an application or runtime.
self | ||
flags | set of FlatpakUninstallFlags flags | |
kind | what this ref contains (an FlatpakRefKind) | |
name | name of the app or runtime to uninstall | |
arch | architecture of the app or runtime to uninstall; if
| [nullable] |
branch | name of the branch of the app or runtime to uninstall;
if | [nullable] |
progress | the callback. | [scope call][nullable] |
progress_data | user data passed to | [closure progress][nullable] |
cancellable | a GCancellable. | [nullable] |
error | return location for a GError |
Since: 0.11.8
gboolean flatpak_installation_launch (FlatpakInstallation *self
,const char *name
,const char *arch
,const char *branch
,const char *commit
,GCancellable *cancellable
,GError **error
);
Launch an installed application.
You can use flatpak_installation_get_installed_ref()
or
flatpak_installation_get_current_installed_app()
to find out what builds
are available, in order to get a value for commit
.
self | ||
name | name of the app to launch | |
arch | which architecture to launch (default: current architecture). | [nullable] |
branch | which branch of the application (default: "master"). | [nullable] |
commit | the commit of | [nullable] |
cancellable | a GCancellable. | [nullable] |
error | return location for a GError |
gboolean flatpak_installation_launch_full (FlatpakInstallation *self
,FlatpakLaunchFlags flags
,const char *name
,const char *arch
,const char *branch
,const char *commit
,FlatpakInstance **instance_out
,GCancellable *cancellable
,GError **error
);
Launch an installed application.
You can use flatpak_installation_get_installed_ref()
or
flatpak_installation_get_current_installed_app()
to find out what builds
are available, in order to get a value for commit
.
Compared to flatpak_installation_launch()
, this function returns a FlatpakInstance
that can be used to get information about the running instance. You can also use
it to wait for the instance to be done with g_child_watch_add()
if you pass the
FLATPAK_LAUNCH_FLAGS_DO_NOT_REAP flag.
self | ||
flags | set of FlatpakLaunchFlags | |
name | name of the app to launch | |
arch | which architecture to launch (default: current architecture). | [nullable] |
branch | which branch of the application (default: "master"). | [nullable] |
commit | the commit of | [nullable] |
instance_out | return location for a FlatpakInstance. | [nullable] |
cancellable | a GCancellable. | [nullable] |
error | return location for a GError |
Since: 1.1
FlatpakInstalledRef * flatpak_installation_get_current_installed_app (FlatpakInstallation *self
,const char *name
,GCancellable *cancellable
,GError **error
);
Get the last build of reference name
that was installed with
flatpak_installation_install()
, or NULL
if the reference has
never been installed locally.
self | ||
name | the name of the app | |
cancellable | a GCancellable. | [nullable] |
error | return location for a GError |
const char *
flatpak_installation_get_display_name (FlatpakInstallation *self
);
Returns the display name of the installation for self
.
Note that this function may return NULL
if the installation
does not have a display name.
Since: 0.8
const char *
flatpak_installation_get_id (FlatpakInstallation *self
);
Returns the ID of the installation for self
.
The ID for the default system installation is "default". The ID for the user installation is "user".
Since: 0.8
FlatpakInstalledRef * flatpak_installation_get_installed_ref (FlatpakInstallation *self
,FlatpakRefKind kind
,const char *name
,const char *arch
,const char *branch
,GCancellable *cancellable
,GError **error
);
Returns information about an installed ref, such as the available builds, its size, location, etc.
self | ||
kind | whether this is an app or runtime | |
name | name of the app/runtime to fetch | |
arch | which architecture to fetch (default: current architecture). | [nullable] |
branch | which branch to fetch (default: "master"). | [nullable] |
cancellable | a GCancellable. | [nullable] |
error | return location for a GError |
gboolean flatpak_installation_get_min_free_space_bytes (FlatpakInstallation *self
,guint64 *out_bytes
,GError **error
);
Returns the min-free-space config value from the OSTree repository of this installation.
Applications can use this value, together with information about the available disk space and the size of pending updates or installs, to estimate whether a pull operation will fail due to running out of disk space.
Since: 1.1
gint
flatpak_installation_get_priority (FlatpakInstallation *self
);
Returns the numeric priority of the installation for self
.
Since: 0.8
FlatpakStorageType
flatpak_installation_get_storage_type (FlatpakInstallation *self
);
Returns the type of storage of the installation for self
.
Since: 0.8
void flatpak_installation_set_no_interaction (FlatpakInstallation *self
,gboolean no_interaction
);
This method can be used to prevent interactive authorization dialogs to appear
for operations on self
. This is useful for background operations that are not
directly triggered by a user action.
By default, interaction is allowed.
Since: 1.1.1
gboolean
flatpak_installation_get_no_interaction
(FlatpakInstallation *self
);
Returns the value set with flatpak_installation_set_no_interaction()
.
Since: 1.1.1
GPtrArray * flatpak_installation_list_installed_refs (FlatpakInstallation *self
,GCancellable *cancellable
,GError **error
);
Lists the installed references.
a GPtrArray of FlatpakInstalledRef instances.
[transfer container][element-type FlatpakInstalledRef]
GPtrArray * flatpak_installation_list_installed_refs_by_kind (FlatpakInstallation *self
,FlatpakRefKind kind
,GCancellable *cancellable
,GError **error
);
Lists the installed references of a specific kind.
self | ||
kind | the kind of installation | |
cancellable | a GCancellable. | [nullable] |
error | return location for a GError |
a GPtrArray of FlatpakInstalledRef instances.
[transfer container][element-type FlatpakInstalledRef]
GPtrArray * flatpak_installation_list_installed_refs_for_update (FlatpakInstallation *self
,GCancellable *cancellable
,GError **error
);
Lists the installed apps and runtimes that have an update available, either
from the configured remote or locally available but not deployed (see
flatpak_transaction_set_no_deploy()
).
This also checks if any of FlatpakInstalledRef has a missing FlatpakRelatedRef
(which has should-download
set to TRUE
) or runtime. If so, it adds the
ref to the returning GPtrArray to pull in the FlatpakRelatedRef or runtime
again via an update operation in FlatpakTransaction.
In case more than one app needs an update of the same runtime or extension, this function will return all of those apps.
a GPtrArray of
FlatpakInstalledRef instances, or NULL
on error.
[transfer container][element-type FlatpakInstalledRef]
GPtrArray * flatpak_installation_list_installed_related_refs_sync (FlatpakInstallation *self
,const char *remote_name
,const char *ref
,GCancellable *cancellable
,GError **error
);
Lists all the locally installed refs from remote_name
that are
related to ref
. These are things that are interesting to install,
update, or uninstall together with ref
. For instance, locale data
or debug information.
This function is similar to flatpak_installation_list_remote_related_refs_sync, but instead of looking at what is available on the remote, it only looks at the locally installed refs. This is useful for instance when you're looking for related refs to uninstall, or when you're planning to use FLATPAK_UPDATE_FLAGS_NO_PULL to install previously pulled refs.
self | ||
remote_name | the name of the remote | |
ref | the ref | |
cancellable | a GCancellable. | [nullable] |
error | return location for a GError |
a GPtrArray of FlatpakRelatedRef instances.
[transfer container][element-type FlatpakRelatedRef]
Since: 0.6.7
GPtrArray * flatpak_installation_list_unused_refs (FlatpakInstallation *self
,const char *arch
,GCancellable *cancellable
,GError **error
);
Lists the installed references that are not 'used'.
A reference is used if it is either an application,
or the runtime or sdk of a used ref, or an extension of a used ref.
Pinned runtimes are also considered used; see flatpak-pin(1) and
flatpak_installation_list_pinned_refs()
.
self | ||
arch | if non- | [nullable] |
cancellable | a GCancellable. | [nullable] |
error | return location for a GError |
a GPtrArray of FlatpakInstalledRef instances.
[transfer container][element-type FlatpakInstalledRef]
Since: 1.1.2
GPtrArray * flatpak_installation_list_remote_refs_sync (FlatpakInstallation *self
,const char *remote_or_uri
,GCancellable *cancellable
,GError **error
);
Lists all the applications and runtimes in a remote.
self | ||
remote_or_uri | the name or URI of the remote | |
cancellable | a GCancellable. | [nullable] |
error | return location for a GError |
a GPtrArray of FlatpakRemoteRef instances.
[transfer container][element-type FlatpakRemoteRef]
GPtrArray * flatpak_installation_list_remote_refs_sync_full (FlatpakInstallation *self
,const char *remote_or_uri
,FlatpakQueryFlags flags
,GCancellable *cancellable
,GError **error
);
Lists all the applications and runtimes in a remote.
self | ||
remote_or_uri | the name or URI of the remote | |
flags | set of FlatpakQueryFlags | |
cancellable | a GCancellable. | [nullable] |
error | return location for a GError |
a GPtrArray of FlatpakRemoteRef instances.
[transfer container][element-type FlatpakRemoteRef]
Since: 1.3.3
GPtrArray * flatpak_installation_list_remotes_by_type (FlatpakInstallation *self
,const FlatpakRemoteType types[]
,gsize num_types
,GCancellable *cancellable
,GError **error
);
Lists only the remotes whose type is included in the types
argument.
Since flatpak 1.7 this will never return any types except FLATPAK_REMOTE_TYPE_STATIC. Equivalent functionallity to FLATPAK_REMOTE_TYPE_USB can be had by listing remote refs with FLATPAK_QUERY_FLAGS_ONLY_SIDELOADED.
self | ||
types | an array of FlatpakRemoteType. | [array length=num_types] |
num_types | the number of types provided in | |
cancellable | a GCancellable. | [nullable] |
error | return location for a GError |
GPtrArray * flatpak_installation_list_remote_related_refs_sync (FlatpakInstallation *self
,const char *remote_name
,const char *ref
,GCancellable *cancellable
,GError **error
);
Lists all the available refs on remote_name
that are related to
ref
, and the subpaths to use. These are things that are
interesting to install, update, or uninstall together with
ref
. For instance, locale data or debug information.
The returned list contains all available related refs, but not
every one should always be installed. For example,
flatpak_related_ref_should_download()
returns TRUE
if the
reference should be installed/updated with the app, and
flatpak_related_ref_should_delete()
returns TRUE
if it
should be uninstalled with the main ref.
The commit property of each FlatpakRelatedRef is not guaranteed to be
non-NULL
.
self | ||
remote_name | the name of the remote | |
ref | the ref | |
cancellable | a GCancellable. | [nullable] |
error | return location for a GError |
a GPtrArray of FlatpakRelatedRef instances.
[transfer container][element-type FlatpakRelatedRef]
Since: 0.6.7
GPtrArray * flatpak_installation_list_remotes (FlatpakInstallation *self
,GCancellable *cancellable
,GError **error
);
Lists the static remotes, in priority (highest first) order. For same priority, an earlier added remote comes before a later added one.
FlatpakRemote * flatpak_installation_get_remote_by_name (FlatpakInstallation *self
,const gchar *name
,GCancellable *cancellable
,GError **error
);
Looks up a remote by name.
self | ||
name | a remote name | |
cancellable | a GCancellable. | [nullable] |
error | return location for a GError |
GBytes * flatpak_installation_fetch_remote_metadata_sync (FlatpakInstallation *self
,const char *remote_name
,FlatpakRef *ref
,GCancellable *cancellable
,GError **error
);
Obtains the metadata file from a commit.
NOTE: Since 0.11.4 this information is accessible in FlatpakRemoteRef, so this function is not very useful anymore.
self | ||
remote_name | the name of the remote | |
ref | the ref | |
cancellable | a GCancellable. | [nullable] |
error | return location for a GError |
FlatpakRemoteRef * flatpak_installation_fetch_remote_ref_sync (FlatpakInstallation *self
,const char *remote_name
,FlatpakRefKind kind
,const char *name
,const char *arch
,const char *branch
,GCancellable *cancellable
,GError **error
);
Gets the current remote branch of a ref in the remote.
self | ||
remote_name | the name of the remote | |
kind | what this ref contains (an FlatpakRefKind) | |
name | name of the app/runtime to fetch | |
arch | which architecture to fetch (default: current architecture). | [nullable] |
branch | which branch to fetch (default: 'master'). | [nullable] |
cancellable | a GCancellable. | [nullable] |
error | return location for a GError |
FlatpakRemoteRef * flatpak_installation_fetch_remote_ref_sync_full (FlatpakInstallation *self
,const char *remote_name
,FlatpakRefKind kind
,const char *name
,const char *arch
,const char *branch
,FlatpakQueryFlags flags
,GCancellable *cancellable
,GError **error
);
Gets the current remote branch of a ref in the remote.
self | ||
remote_name | the name of the remote | |
kind | what this ref contains (an FlatpakRefKind) | |
name | name of the app/runtime to fetch | |
arch | which architecture to fetch (default: current architecture). | [nullable] |
branch | which branch to fetch (default: 'master'). | [nullable] |
flags | set of FlatpakQueryFlags | |
cancellable | a GCancellable. | [nullable] |
error | return location for a GError |
Since: 1.3.3
gboolean flatpak_installation_fetch_remote_size_sync (FlatpakInstallation *self
,const char *remote_name
,FlatpakRef *ref
,guint64 *download_size
,guint64 *installed_size
,GCancellable *cancellable
,GError **error
);
Gets information about the maximum amount of data that needs to be transferred to pull the ref from a remote repository, and about the amount of local disk space that is required to check out this commit.
Note that if there are locally available data that are in the ref, which is common for instance if you're doing an update then the real download size may be smaller than what is returned here.
NOTE: Since 0.11.4 this information is accessible in FlatpakRemoteRef, so this function is not very useful anymore.
self | ||
remote_name | the name of the remote | |
ref | the ref | |
download_size | return location for the (maximum) download size. | [out] |
installed_size | return location for the installed size. | [out] |
cancellable | a GCancellable. | [nullable] |
error | return location for a GError |
char * flatpak_installation_load_app_overrides (FlatpakInstallation *self
,const char *app_id
,GCancellable *cancellable
,GError **error
);
Loads the metadata overrides file for an application.
self | ||
app_id | an application id | |
cancellable | a GCancellable. | [nullable] |
error | return location for a GError |
gboolean flatpak_installation_update_appstream_sync (FlatpakInstallation *self
,const char *remote_name
,const char *arch
,gboolean *out_changed
,GCancellable *cancellable
,GError **error
);
Updates the local copy of appstream for remote_name
for the specified arch
.
If you need progress feedback, use flatpak_installation_update_appstream_full_sync()
.
self | ||
remote_name | the name of the remote | |
arch | Architecture to update, or | [nullable] |
out_changed | Set to | [nullable] |
cancellable | a GCancellable. | [nullable] |
error | return location for a GError |
FlatpakInstalledRef * flatpak_installation_install_bundle (FlatpakInstallation *self
,GFile *file
,FlatpakProgressCallback progress
,gpointer progress_data
,GCancellable *cancellable
,GError **error
);
flatpak_installation_install_bundle
has been deprecated since version 1.7.0 and should not be used in newly-written code.
Use flatpak_transaction_add_install_bundle()
instead.
This is an old deprecated function, you should use
FlatpakTransaction and flatpak_transaction_add_install_bundle()
instead. It has a lot more interesting features.
Install an application or runtime from an flatpak bundle file. See flatpak-build-bundle(1) for how to create bundles.
self | ||
file | a GFile that is an flatpak bundle | |
progress | progress callback. | [scope call][nullable] |
progress_data | user data passed to | [closure progress][nullable] |
cancellable | a GCancellable. | [nullable] |
error | return location for a GError |
FlatpakRemoteRef * flatpak_installation_install_ref_file (FlatpakInstallation *self
,GBytes *ref_file_data
,GCancellable *cancellable
,GError **error
);
flatpak_installation_install_ref_file
has been deprecated since version 1.7.0 and should not be used in newly-written code.
Use flatpak_transaction_add_install_flatpakref()
instead.
This is an old deprecated function, you should use
FlatpakTransaction and flatpak_transaction_add_install_flatpakref()
instead. It has a lot more interesting features.
Creates a remote based on the passed in .flatpakref file contents
in ref_file_data
and returns the FlatpakRemoteRef that can be used
to install it.
Note, the FlatpakRemoteRef will not have the commit field set, or other details, to
avoid unnecessary roundtrips. If you need that you have to resolve it
explicitly with flatpak_installation_fetch_remote_ref_sync()
.
self | ||
ref_file_data | The ref file contents | |
cancellable | a GCancellable. | [nullable] |
error | return location for a GError |
Since: 0.6.10
gboolean flatpak_installation_drop_caches (FlatpakInstallation *self
,GCancellable *cancellable
,GError **error
);
Drops all internal (in-memory) caches. For instance, this may be needed to pick up new or changed remotes configured outside this installation instance.
gboolean flatpak_installation_add_remote (FlatpakInstallation *self
,FlatpakRemote *remote
,gboolean if_needed
,GCancellable *cancellable
,GError **error
);
Adds a new remote
object to the set of remotes. This is similar
to flatpak_installation_modify_remote()
for non-existing remote
names. However, if the named remote already exists then instead of
modifying it it fails with FLATPAK_ERROR_ALREADY_INSTALLED
, or if
if_needed
is true it silently succeeds without doing anything.
As an exception to the last, if the local config has a filter defined,
but the new remote unsets the filter (for example, it comes from an
unfiltered .flatpakref via flatpak_remote_new_from_file()
) the the local
remote filter gets reset. This is to allow the setup where there is a
default setup of a filtered remote, yet you can still use the standard
flatpakref file to get the full contents without getting two remotes.
self | ||
remote | the new FlatpakRemote | |
if_needed | if | |
cancellable | a GCancellable. | [nullable] |
error | return location for a GError |
Since: 1.3.4
gboolean flatpak_installation_modify_remote (FlatpakInstallation *self
,FlatpakRemote *remote
,GCancellable *cancellable
,GError **error
);
Saves changes in the remote
object.
self | ||
remote | the modified FlatpakRemote | |
cancellable | a GCancellable. | [nullable] |
error | return location for a GError |
gboolean flatpak_installation_remove_remote (FlatpakInstallation *self
,const char *name
,GCancellable *cancellable
,GError **error
);
Removes the remote with the given name from the installation.
self | ||
name | the name of the remote to remove | |
cancellable | a GCancellable. | [nullable] |
error | return location for a GError |
gboolean flatpak_installation_update_remote_sync (FlatpakInstallation *self
,const char *name
,GCancellable *cancellable
,GError **error
);
Updates the local configuration of a remote repository by fetching the related information from the summary file in the remote OSTree repository and committing the changes to the local installation.
self | ||
name | the name of the remote to update | |
cancellable | a GCancellable. | [nullable] |
error | return location for a GError |
Since: 0.6.13
gboolean flatpak_installation_cleanup_local_refs_sync (FlatpakInstallation *self
,GCancellable *cancellable
,GError **error
);
Remove all OSTree refs from the local flatpak repository which are not
in a deployed state. The next time the underlying OSTree repo is pruned,
objects which were attached to that ref will be removed. This is useful if
you pulled a flatpak refs using flatpak_installation_install_full()
and
specified FLATPAK_INSTALL_FLAGS_NO_DEPLOY
but then decided not to
deploy the refs later on and want to remove the local refs to prevent them
from taking up disk space. Note that this will not remove the objects
referred to by ref
from the underlying OSTree repo, you should use
flatpak_installation_prune_local_repo()
to do that.
Since: 0.10.0
char * flatpak_installation_get_config (FlatpakInstallation *self
,const char *key
,GCancellable *cancellable
,GError **error
);
Get a global configuration option for the installation, see
flatpak_installation_set_config_sync()
for supported keys.
self | ||
key | the name of the key to get | |
cancellable | a GCancellable. | [nullable] |
error | return location for a GError |
The (newly allocated) value, or NULL
on error (G_KEY_FILE_ERROR_KEY_NOT_FOUND
error if key is not set)
char ** flatpak_installation_get_default_languages (FlatpakInstallation *self
,GError **error
);
Get the default languages used by the installation to decide which subpaths to install of locale extensions. This list may also be used by frontends like GNOME Software to decide which language-specific apps to display. An empty array means that all languages should be installed.
A possibly empty array of strings, or NULL
on error.
[array zero-terminated=1][element-type utf8][transfer full]
Since: 1.5.0
char ** flatpak_installation_get_default_locales (FlatpakInstallation *self
,GError **error
);
Like flatpak_installation_get_default_languages()
but includes territory
information (e.g. en_US
rather than en
) which may be included in the
extra-languages
configuration.
Strings returned by this function are in the format specified by
setlocale()
: language[_territory][.codeset][@modifier]
.
A possibly empty array of locale strings, or NULL
on error.
[array zero-terminated=1][element-type utf8][transfer full]
Since: 1.5.1
gboolean flatpak_installation_prune_local_repo (FlatpakInstallation *self
,GCancellable *cancellable
,GError **error
);
Remove all orphaned OSTree objects from the underlying OSTree repo in
self
.
Since: 0.10.0
gboolean flatpak_installation_remove_local_ref_sync (FlatpakInstallation *self
,const char *remote_name
,const char *ref
,GCancellable *cancellable
,GError **error
);
Remove the OSTree ref given by remote_name
:ref
from the local flatpak
repository. The next time the underlying OSTree repo is pruned, objects
which were attached to that ref will be removed. This is useful if you
pulled a flatpak ref using flatpak_installation_install_full()
and
specified FLATPAK_INSTALL_FLAGS_NO_DEPLOY
but then decided not to
deploy the ref later on and want to remove the local ref to prevent it
from taking up disk space. Note that this will not remove the objects
referred to by ref
from the underlying OSTree repo, you should use
flatpak_installation_prune_local_repo()
to do that.
self | ||
remote_name | the name of the remote | |
ref | the ref | |
cancellable | a GCancellable. | [nullable] |
error | return location for a GError |
Since: 0.10.0
gboolean flatpak_installation_set_config_sync (FlatpakInstallation *self
,const char *key
,const char *value
,GCancellable *cancellable
,GError **error
);
Set a global configuration option for the installation, currently
the only supported keys are languages
, which is a semicolon-separated
list of language codes like "sv;en;pl"
, or ""
to mean all languages,
and extra-languages
, which is a semicolon-separated list of locale
identifiers like "en;en_DK;zh_HK.big5hkscs;uz_UZ.utf8@cyrillic"
.
self | ||
key | the name of the key to set | |
value | the new value, or | |
cancellable | a GCancellable. | [nullable] |
error | return location for a GError |
gboolean flatpak_installation_update_appstream_full_sync (FlatpakInstallation *self
,const char *remote_name
,const char *arch
,FlatpakProgressCallback progress
,gpointer progress_data
,gboolean *out_changed
,GCancellable *cancellable
,GError **error
);
Updates the local copy of appstream for remote_name
for the specified arch
.
self | ||
remote_name | the name of the remote | |
arch | Architecture to update, or | [nullable] |
progress | progress callback. | [scope call][nullable] |
progress_data | user data passed to | [closure progress][nullable] |
out_changed | Set to | [nullable] |
cancellable | a GCancellable. | [nullable] |
error | return location for a GError |
gboolean flatpak_installation_run_triggers (FlatpakInstallation *self
,GCancellable *cancellable
,GError **error
);
Run the trigger commands to update the files exported by the apps in
self
. Should be used after one or more app install, upgrade or
uninstall operations with the FLATPAK_INSTALL_FLAGS_NO_TRIGGERS
,
FLATPAK_UPDATE_FLAGS_NO_TRIGGERS
or FLATPAK_UNINSTALL_FLAGS_NO_TRIGGERS
flags set.
Since: 1.0.3
const char *
flatpak_get_default_arch (void
);
Returns the canonical name for the arch of the current machine.
const char *const *
flatpak_get_supported_arches (void
);
Returns the canonical names for the arches that are supported (i.e. can run) on the current machine, in order of priority (default is first).
GPtrArray * flatpak_get_system_installations (GCancellable *cancellable
,GError **error
);
Lists the system installations according to the current configuration and current availability (e.g. doesn't return a configured installation if not reachable).
a GPtrArray of FlatpakInstallation instances.
[transfer container][element-type FlatpakInstallation]
Since: 0.8
void (*FlatpakProgressCallback) (const char *status
,guint progress
,gboolean estimating
,gpointer user_data
);
The progress callback is called repeatedly during long-running operations such as installations or updates, and can be used to update progress information in a user interface.
The callback occurs in the thread-default context of the caller.
Flags to alter the behavior of e.g flatpak_installation_list_remote_refs_sync_full()
.
Default | ||
Don't do any network i/o, but only return cached data. This can return stale data, or a FLATPAK_ERROR_NOT_CACHED error, however it is a lot more efficient if you're doing many requests. | ||
Only list refs available from sideload repos; see flatpak(1). (Snce: 1.7) |
Since: 1.3.3
Flags to alter the behavior of flatpak_installation_update()
.
Fetch remote builds and install the latest one (default) | ||
Don't install any new builds that might be fetched | ||
Don't try to fetch new builds from the remote repo | ||
Don't use static deltas when pulling | ||
Don't prune the local OSTree repository after updating (Since: 0.11.8) | ||
Don't call triggers after updating. If used,
the caller must later call |
Flags to alter the behavior of flatpak_installation_install_full()
.
Default | ||
Don't use static deltas when pulling | ||
Don't install any new builds that might be fetched | ||
Don't try to fetch new builds from the remote repo | ||
Don't call triggers after installing. If used,
the caller must later call |
Flags to alter the behavior of flatpak_installation_uninstall_full()
.
Default | ||
Don't prune the local OSTree repository after uninstalling | ||
Don't call triggers after uninstalling. If used,
the caller must later call |
Since: 0.11.8
Flags to alter the behavior of flatpak_installation_launch_full()
.
Default | ||
Do not reap the child. Use this if you want to wait
for the child with |
FlatpakRemote — Remote repository
A FlatpakRemote object provides information about a remote repository (or short: remote) that has been configured.
At its most basic level, a remote has a name and the URL for the repository. In addition, they provide some additional information that can be useful when presenting repositories in a UI, such as a title, a priority or a "don't enumerate" flags.
To obtain FlatpakRemote objects for the configured remotes
on a system, use flatpak_installation_list_remotes()
or
flatpak_installation_get_remote_by_name()
.
FlatpakRemote *
flatpak_remote_new (const char *name
);
Returns a new remote object which can be used to configure a new remote.
Note: This is a local configuration object, you must commit changes
using flatpak_installation_modify_remote()
or flatpak_installation_add_remote()
for the changes to take
effect.
FlatpakRemote * flatpak_remote_new_from_file (const char *name
,GBytes *data
,GError **error
);
Returns a new pre-filled remote object which can be used to configure a new remote. The fields in the remote are filled in according to the values in the passed in flatpakrepo file.
Note: This is a local configuration object, you must commit changes
using flatpak_installation_modify_remote()
or flatpak_installation_add_remote()
for the changes to take
effect.
Since: 1.3.4
const char *
flatpak_remote_get_name (FlatpakRemote *self
);
Returns the name of the remote repository.
GFile * flatpak_remote_get_appstream_dir (FlatpakRemote *self
,const char *arch
);
Returns the directory where this remote will store locally cached
appstream information for the specified arch
.
GFile * flatpak_remote_get_appstream_timestamp (FlatpakRemote *self
,const char *arch
);
Returns the timestamp file that will be updated whenever the appstream information
has been updated (or tried to update) for the specified arch
.
char *
flatpak_remote_get_collection_id (FlatpakRemote *self
);
Returns the repository collection ID of this remote, if set.
void flatpak_remote_set_collection_id (FlatpakRemote *self
,const char *collection_id
);
Sets the repository collection ID of this remote.
Note: This is a local modification of this object, you must commit changes
using flatpak_installation_modify_remote()
for the changes to take
effect.
char *
flatpak_remote_get_default_branch (FlatpakRemote *self
);
Returns the default branch configured for the remote.
Since: 0.6.12
void flatpak_remote_set_default_branch (FlatpakRemote *self
,const char *default_branch
);
Sets the default branch configured for this remote.
Note: This is a local modification of this object, you must commit changes
using flatpak_installation_modify_remote()
for the changes to take
effect.
Since: 0.6.12
gboolean
flatpak_remote_get_gpg_verify (FlatpakRemote *self
);
Returns whether GPG verification is enabled for the remote.
void flatpak_remote_set_gpg_verify (FlatpakRemote *self
,gboolean gpg_verify
);
Sets the gpg_verify config of this remote. See flatpak_remote_get_gpg_verify()
.
Note: This is a local modification of this object, you must commit changes
using flatpak_installation_modify_remote()
for the changes to take
effect.
void flatpak_remote_set_gpg_key (FlatpakRemote *self
,GBytes *gpg_key
);
Sets the trusted gpg key for this remote.
Note: This is a local modification of this object, you must commit changes
using flatpak_installation_modify_remote()
for the changes to take
effect.
gboolean
flatpak_remote_get_nodeps (FlatpakRemote *self
);
Returns whether this remote should be used to find dependencies.
void flatpak_remote_set_nodeps (FlatpakRemote *self
,gboolean nodeps
);
Sets the nodeps config of this remote. See flatpak_remote_get_nodeps()
.
Note: This is a local modification of this object, you must commit changes
using flatpak_installation_modify_remote()
for the changes to take
effect.
gboolean
flatpak_remote_get_noenumerate (FlatpakRemote *self
);
Returns whether this remote should be used to list applications.
void flatpak_remote_set_noenumerate (FlatpakRemote *self
,gboolean noenumerate
);
Sets the noenumeration config of this remote. See flatpak_remote_get_noenumerate()
.
Note: This is a local modification of this object, you must commit changes
using flatpak_installation_modify_remote()
for the changes to take
effect.
int
flatpak_remote_get_prio (FlatpakRemote *self
);
Returns the priority for the remote.
void flatpak_remote_set_prio (FlatpakRemote *self
,int prio
);
Sets the prio config of this remote. See flatpak_remote_get_prio()
.
Note: This is a local modification of this object, you must commit changes
using flatpak_installation_modify_remote()
for the changes to take
effect.
FlatpakRemoteType
flatpak_remote_get_remote_type (FlatpakRemote *self
);
Get the value of “type”.
Since: 0.9.8
char *
flatpak_remote_get_title (FlatpakRemote *self
);
Returns the title of the remote.
void flatpak_remote_set_title (FlatpakRemote *self
,const char *title
);
Sets the repository title of this remote.
Note: This is a local modification of this object, you must commit changes
using flatpak_installation_modify_remote()
for the changes to take
effect.
char *
flatpak_remote_get_comment (FlatpakRemote *self
);
Returns the comment of the remote.
Since: 1.4
void flatpak_remote_set_comment (FlatpakRemote *self
,const char *comment
);
Sets the comment of this remote.
Note: This is a local modification of this object, you must commit changes
using flatpak_installation_modify_remote()
for the changes to take
effect.
Since: 1.4
char *
flatpak_remote_get_description (FlatpakRemote *self
);
Returns the description of the remote.
Since: 1.4
void flatpak_remote_set_description (FlatpakRemote *self
,const char *description
);
Sets the description of this remote.
Note: This is a local modification of this object, you must commit changes
using flatpak_installation_modify_remote()
for the changes to take
effect.
Since: 1.4
char *
flatpak_remote_get_homepage (FlatpakRemote *self
);
Returns the homepage url of the remote.
Since: 1.4
void flatpak_remote_set_homepage (FlatpakRemote *self
,const char *homepage
);
Sets the homepage of this remote.
Note: This is a local modification of this object, you must commit changes
using flatpak_installation_modify_remote()
for the changes to take
effect.
Since: 1.4
char *
flatpak_remote_get_icon (FlatpakRemote *self
);
Returns the icon url of the remote.
Since: 1.4
void flatpak_remote_set_icon (FlatpakRemote *self
,const char *icon
);
Sets the homepage of this remote.
Note: This is a local modification of this object, you must commit changes
using flatpak_installation_modify_remote()
for the changes to take
effect.
Since: 1.4
char *
flatpak_remote_get_url (FlatpakRemote *self
);
Returns the repository URL of this remote.
void flatpak_remote_set_url (FlatpakRemote *self
,const char *url
);
Sets the repository URL of this remote.
Note: This is a local modification of this object, you must commit changes
using flatpak_installation_modify_remote()
for the changes to take
effect.
gboolean
flatpak_remote_get_disabled (FlatpakRemote *self
);
Returns whether this remote is disabled.
void flatpak_remote_set_disabled (FlatpakRemote *self
,gboolean disabled
);
Sets the disabled config of this remote. See flatpak_remote_get_disabled()
.
Note: This is a local modification of this object, you must commit changes
using flatpak_installation_modify_remote()
for the changes to take
effect.
char *
flatpak_remote_get_filter (FlatpakRemote *self
);
Returns the filter file of the remote.
Since: 1.4
void flatpak_remote_set_filter (FlatpakRemote *self
,const char *filter_path
);
Sets a filter for this remote.
Note: This is a local modification of this object, you must commit changes
using flatpak_installation_modify_remote()
for the changes to take
effect.
Since: 1.4
char *
flatpak_remote_get_main_ref (FlatpakRemote *self
);
Returns the main ref of this remote, if set. The main ref is the ref that an origin remote is created for.
Since: 1.1.1
void flatpak_remote_set_main_ref (FlatpakRemote *self
,const char *main_ref
);
Sets the main ref of this remote. The main ref is the ref that an origin remote is created for.
Note: This is a local modification of this object, you must commit changes
using flatpak_installation_modify_remote()
for the changes to take
effect.
Since: 1.1.1
“name”
property“name” gchar *
Name of the remote, as used in configuration files and when interfacing
with OSTree. This is typically human readable, but could be generated, and
must conform to ostree_validate_remote_name()
. It should typically not be
presented in the UI.
Owner: FlatpakRemote
Flags: Read / Write
Default value: NULL
“type”
property“type” FlatpakRemoteType
The type of the remote: whether it comes from static configuration files
(FLATPAK_REMOTE_TYPE_STATIC
) or has been dynamically found from the local
network or a mounted USB drive (FLATPAK_REMOTE_TYPE_LAN
,
FLATPAK_REMOTE_TYPE_USB
). Dynamic remotes may be added and removed over
time.
Owner: FlatpakRemote
Flags: Read / Write / Construct Only
Default value: FLATPAK_REMOTE_TYPE_STATIC
Since: 0.9.8
FlatpakTransactionOperation — Operation in a transaction
FlatpakTransactionOperation is an object that represents a single operation in a transaction. You receive a FlatpakTransactionOperation object with the “new-operation” signal.
GFile *
flatpak_transaction_operation_get_bundle_path
(FlatpakTransactionOperation *self
);
Gets the path to the bundle.
const char *
flatpak_transaction_operation_get_commit
(FlatpakTransactionOperation *self
);
Gets the commit ID for the operation.
This information is available when the transaction is resolved, i.e. when “ready” is emitted.
FlatpakTransactionOperationType
flatpak_transaction_operation_get_operation_type
(FlatpakTransactionOperation *self
);
Gets the type of the operation.
const char *
flatpak_transaction_operation_get_ref (FlatpakTransactionOperation *self
);
Gets the ref that the operation applies to.
const char *
flatpak_transaction_operation_get_remote
(FlatpakTransactionOperation *self
);
Gets the remote that the operation applies to.
GKeyFile *
flatpak_transaction_operation_get_metadata
(FlatpakTransactionOperation *self
);
Gets the metadata that will be applicable when the operation is done.
This can be compared to the current metadata returned
by flatpak_transaction_operation_get_old_metadata()
to find new required permissions and similar changes.
This information is available when the transaction is resolved, i.e. when “ready” is emitted.
GKeyFile *
flatpak_transaction_operation_get_old_metadata
(FlatpakTransactionOperation *self
);
Gets the metadata current metadata for the ref that self
works on.
Also see flatpak_transaction_operation_get_metadata()
.
This information is available when the transaction is resolved, i.e. when “ready” is emitted.
guint64
flatpak_transaction_operation_get_download_size
(FlatpakTransactionOperation *self
);
Gets the maximum download size for the operation.
Note that this does not include the size of dependencies, and the actual download may be smaller, if some of the data is already available locally.
For uninstall operations, this returns 0.
This information is available when the transaction is resolved, i.e. when “ready” is emitted.
Since: 1.1.2
guint64
flatpak_transaction_operation_get_installed_size
(FlatpakTransactionOperation *self
);
Gets the installed size for the operation.
Note that even for a new install, the extra space required on disk may be smaller than this number, if some of the data is already available locally.
For uninstall operations, this returns 0.
This information is available when the transaction is resolved, i.e. when “ready” is emitted.
Since: 1.1.2
const char *
flatpak_transaction_operation_type_to_string
(FlatpakTransactionOperationType kind
);
Converts the operation type to a string.
FlatpakTransactionProgress — Progress of an operation
FlatpakTransactionProgress is an object that represents the progress of a single operation in a transaction. You obtain a FlatpakTransactionProgress with the “new-operation” signal.
gboolean
flatpak_transaction_progress_get_is_estimating
(FlatpakTransactionProgress *self
);
Gets whether the progress is currently estimating
int
flatpak_transaction_progress_get_progress
(FlatpakTransactionProgress *self
);
Gets the current progress.
char *
flatpak_transaction_progress_get_status
(FlatpakTransactionProgress *self
);
Gets the current status string
void flatpak_transaction_progress_set_update_frequency (FlatpakTransactionProgress *self
,guint update_interval
);
Sets how often progress should be updated.
guint64
flatpak_transaction_progress_get_bytes_transferred
(FlatpakTransactionProgress *self
);
Gets the number of bytes that have been transferred.
Since: 1.1.2
guint64
flatpak_transaction_progress_get_start_time
(FlatpakTransactionProgress *self
);
Gets the time at which this operation has started, as monotonic time.
Since: 1.1.2
“changed”
signalvoid user_function (FlatpakTransactionProgress *object, gpointer user_data)
Emitted when some detail of the progress object changes, you can call the various methods to get the current status.
Flags: Run Last
FlatpakTransaction — Transaction information
FlatpakTransaction is an object representing an install/update/uninstall
transaction. You create an object like this using flatpak_transaction_new_for_installation()
and then you add all the operations (installs, updates, etc) you wish to do. Then
you start the transaction with flatpak_transaction_run()
which will resolve all kinds
of dependencies and report progress and status while downloading and installing these.
The dependency resolution that is the first step of executing a transaction can
be influenced by flatpak_transaction_set_disable_dependencies()
,
flatpak_transaction_set_disable_related()
, flatpak_transaction_add_dependency_source()
and flatpak_transaction_add_default_dependency_sources()
.
The underlying operations that get orchestrated by a FlatpakTransaction are: pulling
new data from remote repositories, deploying newer applications or runtimes and pruning
old deployments. Which of these operations are carried out can be controlled with
flatpak_transaction_set_no_pull()
, flatpak_transaction_set_no_deploy()
and
flatpak_transaction_set_disable_prune()
.
A transaction is a blocking operation, and all signals are emitted in the same thread. This means you should either handle the signals directly (say, by doing blocking console interaction, or by just returning without interaction), or run the operation in a separate thread and do your own forwarding to the GUI thread.
Despite the name, a FlatpakTransaction is more like a batch operation than a transaction in the database sense. Individual operations are carried out sequentially, and are atomic. They become visible to the system as they are completed. When an error occurs, already completed operations are not rolled back.
For each operation that is executed during a transaction, you first get a “new-operation” signal, followed by either a “operation-done” or “operation-error”.
The FlatpakTransaction API is threadsafe in the sense that it is safe to run two transactions at the same time, in different threads (or processes).
Note: Transactions (or any other install/update operation) to a system installation rely on the ability to create files that are readable by other users. Some users set a umask that prohibits this. Unfortunately there is no good way to work around this in a threadsafe, local way, so such setups will break by default. The flatpak commandline app works around this by calling umask(022) in the early setup, and it is recommended that other apps using libflatpak do this too.
FlatpakTransaction * flatpak_transaction_new_for_installation (FlatpakInstallation *installation
,GCancellable *cancellable
,GError **error
);
Creates a new FlatpakTransaction object that can be used to do installation
and updates of multiple refs, as well as their dependencies, in a single
operation. Set the options you want on the transaction and add the
refs you want to install/update, then start the transaction with
flatpak_transaction_run()
.
gboolean flatpak_transaction_add_install (FlatpakTransaction *self
,const char *remote
,const char *ref
,const char **subpaths
,GError **error
);
Adds installing the given ref to this transaction.
The remote
can either be a configured remote of the installation,
or a file:// uri pointing at a local repository to install from,
in which case an origin remote is created.
gboolean flatpak_transaction_add_install_bundle (FlatpakTransaction *self
,GFile *file
,GBytes *gpg_data
,GError **error
);
Adds installing the given bundle to this transaction.
gboolean flatpak_transaction_add_install_flatpakref (FlatpakTransaction *self
,GBytes *flatpakref_data
,GError **error
);
Adds installing the given flatpakref to this transaction.
gboolean flatpak_transaction_add_rebase (FlatpakTransaction *self
,const char *remote
,const char *ref
,const char **subpaths
,const char **previous_ids
,GError **error
);
Adds updating the previous_ids
of the given ref to this transaction, via either
installing the ref
if it was not already present. The will treat ref
as the
result of following an eol-rebase, and data migration from the refs in
previous_ids
will be set up.
See flatpak_transaction_add_install()
for a description of remote
.
self | ||
remote | the name of the remote | |
ref | the ref | |
subpaths | the subpaths to include, or | [nullable] |
previous_ids | Previous ids to add to the given ref. These should simply be the ids, not the full ref names (e.g. org.foo.Bar, not org.foo.Bar/x86_64/master). | [nullable][array zero-terminated=1] |
error | return location for a GError |
Since: 1.3.3.
gboolean flatpak_transaction_add_update (FlatpakTransaction *self
,const char *ref
,const char **subpaths
,const char *commit
,GError **error
);
Adds updating the given ref to this transaction.
gboolean flatpak_transaction_add_uninstall (FlatpakTransaction *self
,const char *ref
,GError **error
);
Adds uninstalling the given ref to this transaction.
void
flatpak_transaction_add_default_dependency_sources
(FlatpakTransaction *self
);
Similar to flatpak_transaction_add_dependency_source()
, but adds
all the default installations, which means all the defined system-wide
(but not per-user) installations.
void flatpak_transaction_add_dependency_source (FlatpakTransaction *self
,FlatpakInstallation *installation
);
Adds an extra installation as a source for application dependencies. This means that applications can be installed in this transaction relying on runtimes from this additional installation (whereas it would normally install required runtimes that are not installed in the installation the transaction works on).
Also see flatpak_transaction_add_default_dependency_sources()
.
gboolean flatpak_transaction_run (FlatpakTransaction *transaction
,GCancellable *cancellable
,GError **error
);
Executes the transaction.
During the course of the execution, various signals will get emitted. The FlatpakTransaction::choose-remote-for-ref and “add-new-remote” signals may get emitted while resolving operations. “ready” is emitted when the transaction has been fully resolved, and “new-operation” and “operation-done” are emitted while the operations are carried out. If an error occurs at any point during the execution, “operation-error” is emitted.
Note that this call blocks until the transaction is done.
FlatpakTransactionOperation *
flatpak_transaction_get_current_operation
(FlatpakTransaction *self
);
Gets the current operation.
FlatpakInstallation *
flatpak_transaction_get_installation (FlatpakTransaction *self
);
Gets the installation this transaction was created for.
GList *
flatpak_transaction_get_operations (FlatpakTransaction *self
);
Gets the list of operations. Skipped operations are not included. The order of the list is the order in which the operations are executed.
gboolean
flatpak_transaction_is_empty (FlatpakTransaction *self
);
Returns whether the transaction contains any non-skipped operations.
void flatpak_transaction_set_disable_dependencies (FlatpakTransaction *self
,gboolean disable_dependencies
);
Sets whether the transaction should ignore runtime dependencies when resolving operations for applications.
void flatpak_transaction_set_disable_prune (FlatpakTransaction *self
,gboolean disable_prune
);
Sets whether the transaction should avoid pruning the local OSTree repository after updating.
void flatpak_transaction_set_disable_related (FlatpakTransaction *self
,gboolean disable_related
);
Sets whether the transaction should avoid adding related refs when resolving operations. Related refs are extensions that are suggested by apps, such as locales.
void flatpak_transaction_set_disable_static_deltas (FlatpakTransaction *self
,gboolean disable_static_deltas
);
Sets whether the transaction should avoid using static deltas when pulling.
void flatpak_transaction_set_no_deploy (FlatpakTransaction *self
,gboolean no_deploy
);
Sets whether the transaction should download updates, but not deploy them.
gboolean
flatpak_transaction_get_no_deploy (FlatpakTransaction *self
);
Gets whether the transaction is only downloading updates, and not deploying them.
Since: 1.5.1
void flatpak_transaction_set_no_pull (FlatpakTransaction *self
,gboolean no_pull
);
Sets whether the transaction should operate only on locally available data.
gboolean
flatpak_transaction_get_no_pull (FlatpakTransaction *self
);
Gets whether the transaction should operate only on locally available data.
Since: 1.5.1
void flatpak_transaction_set_reinstall (FlatpakTransaction *self
,gboolean reinstall
);
Sets whether the transaction should uninstall first if a ref is already installed.
void flatpak_transaction_set_force_uninstall (FlatpakTransaction *self
,gboolean force_uninstall
);
Sets whether the transaction should uninstall files even if they're used by a running application.
void flatpak_transaction_set_default_arch (FlatpakTransaction *self
,const char *arch
);
Sets the architecture to default to where it is unspecified.
void flatpak_transaction_set_parent_window (FlatpakTransaction *self
,const char *parent_window
);
Sets the parent window (if any) to use for any UI show by this transaction. This is used by authenticators if they need to interact with the user during authentication.
The format of this string depends on the display system in use, and is the same as used by xdg-desktop-portal.
On X11 it should be of the form x11:$xid where $xid is the hex version of the xwindows id.
On wayland is should be wayland:$handle where handle is gotten by using the export call of the xdg-foreign-unstable wayland extension.
Since: 1.5.1
const char *
flatpak_transaction_get_parent_window (FlatpakTransaction *self
);
Gets the parent window set for this transaction, or NULL
if unset. See
flatpak_transaction_get_parent_window()
.
Since: 1.5.1
void flatpak_transaction_abort_webflow (FlatpakTransaction *self
,guint id
);
Cancel an ongoing webflow authentication request. This can be call
in the time between “webflow-start” returned
TRUE
, and “webflow-done” is emitted. It will
cancel the ongoing authentication operation.
This is useful for example if you're showing an authenticaion window with a browser, but the user closed it before it was finished.
Since: 1.5.1
The type of a FlatpakTransactionOperation.
“installation”
property“installation” FlatpakInstallation *
The installation that the transaction operates on.
Owner: FlatpakTransaction
Flags: Read / Write / Construct Only
“add-new-remote”
signalgboolean user_function (FlatpakTransaction *object, gint reason, gchar *from_id, gchar *suggested_remote_name, gchar *url, gpointer user_data)
The ::add-new-remote signal gets emitted if, as part of the transaction,
it is required or recommended that a new remote is added, for the reason
described in reason
.
object | ||
reason | A FlatpakTransactionRemoteReason for this suggestion. | [type FlatpakTransactionRemoteReason] |
from_id | The id of the app/runtime | |
suggested_remote_name | The suggested remote name | |
url | The repo url | |
user_data | user data set when the signal handler was connected. |
Flags: Run Last
“basic-auth-start”
signalgboolean user_function (FlatpakTransaction *object, gchar *remote, gchar *realm, GVariant *options, gint id, gpointer user_data)
The ::basic-auth-start signal gets emitted when a basic user/password
authentication is needed during the operation. If the caller handles this
it should ask the user for the user and password and return TRUE
. Once
the information is gathered call flatpak_transaction_complete_basic_auth()
with it.
If the client does not support basic auth then return FALSE
from this signal
(or don't implement it). This will abort the authentication and likely
result in the transaction failing (unless the authentication was somehow
optional).
object | ||
remote | The remote we're authenticating with | |
realm | The url to show | |
options | Extra options, currently unused | |
id | The id of the operation, can be used to finish it | |
user_data | user data set when the signal handler was connected. |
Flags: Run Last
Since: 1.5.2
“choose-remote-for-ref”
signalgint user_function (FlatpakTransaction *object, gchar *for_ref, gchar *runtime_ref, GStrv remotes, gpointer user_data)
The ::choose-remote-for-ref signal gets emitted when a remote needs to be selected during the execution of the transaction.
object | ||
for_ref | The ref we are installing | |
runtime_ref | The ref we are looking for | |
remotes | the remotes that has the ref, sorted in prio order | |
user_data | user data set when the signal handler was connected. |
Flags: Run Last
“end-of-lifed”
signalvoid user_function (FlatpakTransaction *object, gchar *ref, gchar *reason, gchar *rebase, gpointer user_data)
The ::end-of-lifed signal gets emitted when a ref is found to be marked as end-of-life during the execution of the transaction.
Flags: Run Last
“end-of-lifed-with-rebase”
signalgboolean user_function (FlatpakTransaction *object, gchar *remote, gchar *ref, gchar *reason, gchar *rebased_to_ref, GStrv previous_ids, gpointer user_data)
The ::end-of-lifed-with-rebase signal gets emitted when a ref is found to be marked as end-of-life before the transaction begins. Unlike “end-of-lifed”, this signal allows for the transaction to be modified in order to e.g. install the rebased ref.
object | ||
remote | The remote for the ref we are processing | |
ref | The ref we are processing | |
reason | The eol reason, or | |
rebased_to_ref | The new name, if rebased, or | |
previous_ids | The previous names for the rebased ref (if any), including the one from | |
user_data | user data set when the signal handler was connected. |
TRUE
if the operation on this end-of-lifed ref should
be skipped, FALSE
if it should remain.
Flags: Run Last
“install-authenticator”
signalvoid user_function (FlatpakTransaction *object, gchar *remote, gchar *authenticator_ref, gpointer user_data)
The ::install-authenticator signal gets emitted if, as part of resolving the transaction, we need to use an authenticator, but the authentication is not installed, but is available to be installed from the ref.
The application can handle this signal, and if so create another transaction to install the authenticator.
The default handler does nothing, and if the authenticator is not installed when the signal handler fails the transaction will error out.
object | ||
remote | The remote name | |
authenticator_ref | The ref for the authenticator | |
user_data | user data set when the signal handler was connected. |
Flags: Run Last
Since: 1.7.4
“new-operation”
signalvoid user_function (FlatpakTransaction *object, FlatpakTransactionOperation *operation, FlatpakTransactionProgress *progress, gpointer user_data)
The ::new-operation signal gets emitted during the execution of the transaction when a new operation is beginning.
object | ||
operation | The new FlatpakTransactionOperation | |
progress | A FlatpakTransactionProgress for | |
user_data | user data set when the signal handler was connected. |
Flags: Run Last
“operation-done”
signalvoid user_function (FlatpakTransaction *object, FlatpakTransactionOperation *operation, gchar *commit, gint result, gpointer user_data)
The ::operation-done signal gets emitted during the execution of the transaction when an operation is finished.
object | ||
operation | The FlatpakTransactionOperation which finished | |
commit | The commit | |
result | A FlatpakTransactionResult giving details about the result. | [type FlatpakTransactionResult] |
user_data | user data set when the signal handler was connected. |
Flags: Run Last
“operation-error”
signalgboolean user_function (FlatpakTransaction *object, FlatpakTransactionOperation *operation, GError *error, gint details, gpointer user_data)
The ::operation-error signal gets emitted when an error occurs during the execution of the transaction.
object | ||
operation | The FlatpakTransactionOperation which failed | |
error | A GError | |
details | A FlatpakTransactionErrorDetails with details about the error. | [type FlatpakTransactionErrorDetails] |
user_data | user data set when the signal handler was connected. |
Flags: Run Last
“ready”
signalgboolean user_function (FlatpakTransaction *object, gpointer user_data)
The ::ready signal is emitted when all the refs involved in the operation
have been resolved to commits, and the required authentication for all ops is gotten.
At this point flatpak_transaction_get_operations()
will return all the operations
that will be executed as part of the transaction.
Flags: Run Last
“ready-pre-auth”
signalgboolean user_function (FlatpakTransaction *object, gpointer user_data)
The ::ready-pre-auth signal is emitted when all the refs involved in the operation have been resolved to commits, but all we might not necessarily have asked for authenticaion for all there required operations. This is very similar to the ::ready signal, and you can chose which one (or both) to use depending on how you want to handle authentication in your user interface.
At this point flatpak_transaction_get_operations()
will return all the operations
that will be executed as part of the transaction. You can call flatpak_transaction_operation_get_requires_authentication()
to see which will require authentication.
Flags: Run Last
“webflow-done”
signalvoid user_function (FlatpakTransaction *object, GVariant *options, gint id, gpointer user_data)
The ::webflow-done signal gets emitted when the authentication finished the webflow, independent of the reason and results. If you for were showing a web-browser window it can now be closed.
object | ||
options | Extra options, currently unused | |
id | The id of the operation | |
user_data | user data set when the signal handler was connected. |
Flags: Run Last
Since: 1.5.1
“webflow-start”
signalgboolean user_function (FlatpakTransaction *object, gchar *remote, gchar *url, GVariant *options, gint id, gpointer user_data)
The ::webflow-start signal gets emitted when some kind of user
authentication is needed during the operation. If the caller handles this
it should show the url in a webbrowser and return TRUE
. This will
eventually cause the webbrowser to finish the authentication operation and
operation will continue, as signaled by the webflow-done being emitted.
If the client does not support webflow then return FALSE
from this signal
(or don't implement it). This will abort the authentication and likely
result in the transaction failing (unless the authentication was somehow
optional).
During the time between webflow-start and webflow-done the client can call
flatpak_transaction_abort_webflow()
to manually abort the authentication.
This is useful if the user aborted the authentication operation some way,
like e.g. closing the browser window.
object | ||
remote | The remote we're authenticating with | |
url | The url to show | |
options | Extra options, currently unused | |
id | The id of the operation, can be used to cancel it | |
user_data | user data set when the signal handler was connected. |
Flags: Run Last
Since: 1.5.1
FlatpakRef — Application reference
char * | flatpak_ref_format_ref () |
const char * | flatpak_ref_get_arch () |
const char * | flatpak_ref_get_branch () |
const char * | flatpak_ref_get_collection_id () |
const char * | flatpak_ref_get_commit () |
FlatpakRefKind | flatpak_ref_get_kind () |
const char * | flatpak_ref_get_name () |
FlatpakRef * | flatpak_ref_parse () |
GObject ╰── FlatpakRef ├── FlatpakBundleRef ├── FlatpakInstalledRef ├── FlatpakRelatedRef ╰── FlatpakRemoteRef
Currently Flatpak manages two types of binary artifacts: applications, and runtimes. Applications contain a program that desktop users can run, while runtimes contain only libraries and data. An FlatpakRef object (or short: ref) can refer to either of these.
Both applications and runtimes are identified by a 4-tuple of strings: kind,
name, arch and branch, e.g. app/org.gnome.evince/x86_64/master. The functions
flatpak_ref_parse()
and flatpak_ref_format_ref()
can be used to convert
FlatpakRef objects into this string representation and back.
FlatpakRef objects are immutable and can be passed freely between threads.
To uniquely identify a particular version of an application or runtime, you need a commit.
The subclasses FlatpakInstalledRef and FlatpakRemoteRef provide more information for artifacts that are locally installed or available from a remote repository.
char *
flatpak_ref_format_ref (FlatpakRef *self
);
Convert an FlatpakRef object into a string representation that
can be parsed by flatpak_ref_parse()
.
const char *
flatpak_ref_get_arch (FlatpakRef *self
);
Gets the arch or the ref.
const char *
flatpak_ref_get_branch (FlatpakRef *self
);
Gets the branch of the ref.
const char *
flatpak_ref_get_collection_id (FlatpakRef *self
);
Gets the collection ID of the ref.
const char *
flatpak_ref_get_commit (FlatpakRef *self
);
Gets the commit of the ref.
FlatpakRefKind
flatpak_ref_get_kind (FlatpakRef *self
);
Gets the kind of artifact that this ref refers to.
const char *
flatpak_ref_get_name (FlatpakRef *self
);
Gets the name of the ref.
FlatpakRef * flatpak_ref_parse (const char *ref
,GError **error
);
Tries to parse a full ref name and return a FlatpakRef (without a commit set) or fail if the ref is invalid somehow.
ref | A string ref name, such as "app/org.test.App/x86_64/master" | |
error | return location for a GError |
“arch”
property“arch” gchar *
The architecture of the application or runtime.
Owner: FlatpakRef
Flags: Read / Write / Construct Only
Default value: NULL
“branch”
property“branch” gchar *
The branch of the application or runtime.
Owner: FlatpakRef
Flags: Read / Write / Construct Only
Default value: NULL
“collection-id”
property“collection-id” gchar *
The collection ID.
Owner: FlatpakRef
Flags: Read / Write / Construct Only
Default value: NULL
“commit”
property“commit” gchar *
The commit.
Owner: FlatpakRef
Flags: Read / Write / Construct Only
Default value: NULL
“kind”
property“kind” FlatpakRefKind
The kind of artifact.
Owner: FlatpakRef
Flags: Read / Write / Construct Only
Default value: FLATPAK_REF_KIND_APP
“name”
property“name” gchar *
The name of the application or runtime.
Owner: FlatpakRef
Flags: Read / Write / Construct Only
Default value: NULL
FlatpakInstalledRef — Installed application reference
GHashTable * | appdata-content-rating | Read / Write / Construct Only |
gchar * | appdata-content-rating-type | Read / Write / Construct Only |
gchar * | appdata-license | Read / Write / Construct Only |
gchar * | appdata-name | Read / Write / Construct Only |
gchar * | appdata-summary | Read / Write / Construct Only |
gchar * | appdata-version | Read / Write / Construct Only |
gchar * | deploy-dir | Read / Write |
gchar * | end-of-life | Read / Write / Construct Only |
gchar * | end-of-life-rebase | Read / Write / Construct Only |
guint64 | installed-size | Read / Write |
gboolean | is-current | Read / Write |
gchar * | latest-commit | Read / Write |
gchar * | origin | Read / Write |
GStrv | subpaths | Read / Write |
A FlatpakInstalledRef provides information about an installed application or runtime (in short: ref), such as the available builds, its size, location, etc.
const char *
flatpak_installed_ref_get_deploy_dir (FlatpakInstalledRef *self
);
Gets the deploy dir of the ref.
guint64
flatpak_installed_ref_get_installed_size
(FlatpakInstalledRef *self
);
Returns the installed size of the ref.
gboolean
flatpak_installed_ref_get_is_current (FlatpakInstalledRef *self
);
Returns whether the ref is current.
const char *
flatpak_installed_ref_get_latest_commit
(FlatpakInstalledRef *self
);
Gets the latest commit of the ref.
const char *
flatpak_installed_ref_get_origin (FlatpakInstalledRef *self
);
Gets the origin of the ref.
GBytes * flatpak_installed_ref_load_appdata (FlatpakInstalledRef *self
,GCancellable *cancellable
,GError **error
);
Loads the compressed xml appdata for this ref (if it exists).
a GBytes containing the compressed appdata file,
or NULL
if an error occurred.
[transfer full]
Since: 1.1.2
GBytes * flatpak_installed_ref_load_metadata (FlatpakInstalledRef *self
,GCancellable *cancellable
,GError **error
);
Loads the metadata file for this ref.
const char *
flatpak_installed_ref_get_appdata_license
(FlatpakInstalledRef *self
);
Returns the license field from the appdata.
Since: 1.1.2
const char *
flatpak_installed_ref_get_appdata_name
(FlatpakInstalledRef *self
);
Returns the name field from the appdata.
The returned string is localized.
Since: 1.1.2
const char *
flatpak_installed_ref_get_appdata_summary
(FlatpakInstalledRef *self
);
Returns the summary field from the appdata.
The returned string is localized.
Since: 1.1.2
const char *
flatpak_installed_ref_get_appdata_version
(FlatpakInstalledRef *self
);
Returns the default version field from the appdata.
Since: 1.1.2
GHashTable *
flatpak_installed_ref_get_appdata_content_rating
(FlatpakInstalledRef *self
);
Returns the content rating field from the appdata. This is a potentially
empty mapping of content rating attribute IDs to values, to be interpreted
by the semantics of the content rating type (see
flatpak_installed_ref_get_appdata_content_rating_type()
).
Since: 1.4.2
const char *
flatpak_installed_ref_get_appdata_content_rating_type
(FlatpakInstalledRef *self
);
Returns the content rating type from the appdata. For example, oars-1.0
or
oars-1.1
.
Since: 1.4.2
const char * const *
flatpak_installed_ref_get_subpaths (FlatpakInstalledRef *self
);
Returns the subpaths that are installed, or NULL
if all files installed.
const char *
flatpak_installed_ref_get_eol (FlatpakInstalledRef *self
);
Returns the end-of-life reason string, or NULL
if the
ref is not end-of-lifed.
const char *
flatpak_installed_ref_get_eol_rebase (FlatpakInstalledRef *self
);
Returns the end-of-life rebased ref, or NULL
if the
ref is not end-of-lifed.
“appdata-content-rating”
property“appdata-content-rating” GHashTable *
The content rating data from the appdata.
Owner: FlatpakInstalledRef
Flags: Read / Write / Construct Only
“appdata-content-rating-type”
property“appdata-content-rating-type” gchar *
The type of the content rating data from the appdata.
Owner: FlatpakInstalledRef
Flags: Read / Write / Construct Only
Default value: NULL
“appdata-license”
property“appdata-license” gchar *
The license from the appdata.
Owner: FlatpakInstalledRef
Flags: Read / Write / Construct Only
Default value: NULL
“appdata-name”
property“appdata-name” gchar *
The localized name field from the appdata.
Owner: FlatpakInstalledRef
Flags: Read / Write / Construct Only
Default value: NULL
“appdata-summary”
property“appdata-summary” gchar *
The localized summary field from the appdata.
Owner: FlatpakInstalledRef
Flags: Read / Write / Construct Only
Default value: NULL
“appdata-version”
property“appdata-version” gchar *
The default version field from the appdata.
Owner: FlatpakInstalledRef
Flags: Read / Write / Construct Only
Default value: NULL
“deploy-dir”
property“deploy-dir” gchar *
Where the application is installed.
Owner: FlatpakInstalledRef
Flags: Read / Write
Default value: NULL
“end-of-life”
property“end-of-life” gchar *
The reason for the ref to be end of life.
Owner: FlatpakInstalledRef
Flags: Read / Write / Construct Only
Default value: NULL
“end-of-life-rebase”
property“end-of-life-rebase” gchar *
The new ref for the end-of-lifed ref.
Owner: FlatpakInstalledRef
Flags: Read / Write / Construct Only
Default value: NULL
“installed-size”
property“installed-size” guint64
The installed size of the application.
Owner: FlatpakInstalledRef
Flags: Read / Write
Default value: 0
“is-current”
property“is-current” gboolean
Whether the application is current.
Owner: FlatpakInstalledRef
Flags: Read / Write
Default value: FALSE
“latest-commit”
property“latest-commit” gchar *
The latest commit.
Owner: FlatpakInstalledRef
Flags: Read / Write
Default value: NULL
“origin”
property“origin” gchar *
The origin.
Owner: FlatpakInstalledRef
Flags: Read / Write
Default value: NULL
“subpaths”
property“subpaths” GStrv
The subpaths for a partially installed ref.
Owner: FlatpakInstalledRef
Flags: Read / Write
FlatpakRelatedRef — Related application reference
gboolean | should-autoprune | Read / Write / Construct Only |
gboolean | should-delete | Read / Write / Construct Only |
gboolean | should-download | Read / Write / Construct Only |
GStrv | subpaths | Read / Write / Construct Only |
A FlatpakRelatedRef provides information about an ref that is related to another ref. For instance, the local extension ref of an app.
FlatpakRelatedRef * flatpak_related_ref_new (const char *full_ref
,const char *commit
,char **subpaths
,gboolean download
,gboolean delete
);
Creates a new FlatpakRelatedRef object.
const char * const *
flatpak_related_ref_get_subpaths (FlatpakRelatedRef *self
);
Returns the subpaths that should be installed/updated for the ref.
This returns NULL
if all files should be installed.
Since: 0.6.7
gboolean
flatpak_related_ref_should_download (FlatpakRelatedRef *self
);
Returns whether to auto-download the ref with the main ref.
Since: 0.6.7
gboolean
flatpak_related_ref_should_delete (FlatpakRelatedRef *self
);
Returns whether to auto-delete the ref with the main ref.
Since: 0.6.7
gboolean
flatpak_related_ref_should_autoprune (FlatpakRelatedRef *self
);
Returns whether to delete when pruning unused refs.
Since: 0.11.8
“should-autoprune”
property“should-autoprune” gboolean
Whether to delete when pruning unused refs.
Owner: FlatpakRelatedRef
Flags: Read / Write / Construct Only
Default value: FALSE
“should-delete”
property“should-delete” gboolean
Whether to auto-delete the ref with the main ref.
Owner: FlatpakRelatedRef
Flags: Read / Write / Construct Only
Default value: FALSE
“should-download”
property“should-download” gboolean
Whether to auto-download the ref with the main ref.
Owner: FlatpakRelatedRef
Flags: Read / Write / Construct Only
Default value: FALSE
“subpaths”
property“subpaths” GStrv
The subpaths for a partially installed ref.
Owner: FlatpakRelatedRef
Flags: Read / Write / Construct Only
FlatpakRemoteRef — Remote application reference
guint64 | download-size | Read / Write / Construct Only |
gchar * | end-of-life | Read / Write / Construct Only |
gchar * | end-of-life-rebase | Read / Write / Construct Only |
guint64 | installed-size | Read / Write / Construct Only |
GBytes * | metadata | Read / Write / Construct Only |
gchar * | remote-name | Read / Write / Construct Only |
A FlatpakRemoteRef provides information about an application or runtime (in short: ref) that is available from a remote repository.
const char *
flatpak_remote_ref_get_remote_name (FlatpakRemoteRef *self
);
Gets the remote name of the ref.
guint64
flatpak_remote_ref_get_download_size (FlatpakRemoteRef *self
);
Returns the download size of the ref.
const char *
flatpak_remote_ref_get_eol (FlatpakRemoteRef *self
);
Returns the end-of-life reason string, or NULL
if the
ref is not end-of-lifed.
const char *
flatpak_remote_ref_get_eol_rebase (FlatpakRemoteRef *self
);
Returns the end-of-life rebased ref, or NULL
if the
ref is not end-of-lifed.
guint64
flatpak_remote_ref_get_installed_size (FlatpakRemoteRef *self
);
Returns the installed size of the ref.
GBytes *
flatpak_remote_ref_get_metadata (FlatpakRemoteRef *self
);
Returns the app metadata from the metadata cache of the ref.
“download-size”
property“download-size” guint64
The download size of the application.
Owner: FlatpakRemoteRef
Flags: Read / Write / Construct Only
Default value: 0
“end-of-life”
property“end-of-life” gchar *
The reason for the ref to be end of life.
Owner: FlatpakRemoteRef
Flags: Read / Write / Construct Only
Default value: NULL
“end-of-life-rebase”
property“end-of-life-rebase” gchar *
The new ref for the end of lifeed ref.
Owner: FlatpakRemoteRef
Flags: Read / Write / Construct Only
Default value: NULL
“installed-size”
property“installed-size” guint64
The installed size of the application.
Owner: FlatpakRemoteRef
Flags: Read / Write / Construct Only
Default value: 0
“metadata”
property“metadata” GBytes *
The metadata info for the application.
Owner: FlatpakRemoteRef
Flags: Read / Write / Construct Only
“remote-name”
property“remote-name” gchar *
The name of the remote.
Owner: FlatpakRemoteRef
Flags: Read / Write / Construct Only
Default value: NULL
FlatpakBundleRef — Application bundle reference
FlatpakBundleRef * flatpak_bundle_ref_new (GFile *file
,GError **error
);
Creates a new bundle ref for the given file.
GFile *
flatpak_bundle_ref_get_file (FlatpakBundleRef *self
);
Get the file this bundle is stored in.
GBytes *
flatpak_bundle_ref_get_metadata (FlatpakBundleRef *self
);
Get the metadata for the app/runtime
GBytes *
flatpak_bundle_ref_get_appstream (FlatpakBundleRef *self
);
Get the compressed appstream for the app/runtime
GBytes * flatpak_bundle_ref_get_icon (FlatpakBundleRef *self
,int size
);
Get the icon png data for the app/runtime
char *
flatpak_bundle_ref_get_origin (FlatpakBundleRef *self
);
Get the origin url stored in the bundle
guint64
flatpak_bundle_ref_get_installed_size (FlatpakBundleRef *self
);
Returns the installed size for the bundle.
char *
flatpak_bundle_ref_get_runtime_repo_url
(FlatpakBundleRef *self
);
Get the runtime flatpakrepo url stored in the bundle (if any)
Since: 0.8.0
“file”
property“file” GFile *
The bundle file that this ref refers to.
Owner: FlatpakBundleRef
Flags: Read / Write / Construct Only
FlatpakInstance — Information about a running sandbox
GPtrArray * | flatpak_instance_get_all () |
const char * | flatpak_instance_get_id () |
const char * | flatpak_instance_get_app () |
const char * | flatpak_instance_get_arch () |
const char * | flatpak_instance_get_branch () |
const char * | flatpak_instance_get_commit () |
const char * | flatpak_instance_get_runtime () |
const char * | flatpak_instance_get_runtime_commit () |
int | flatpak_instance_get_pid () |
int | flatpak_instance_get_child_pid () |
GKeyFile * | flatpak_instance_get_info () |
gboolean | flatpak_instance_is_running () |
A FlatpakInstance refers to a running sandbox, and contains some basic information about the sandbox setup, such as the application and runtime used inside the sandbox.
Importantly, it also gives access to the PID of the main processes in the sandbox.
One way to obtain FlatpakInstances is to use flatpak_instance_get_all()
.
Another way is to use flatpak_installation_launch_full()
.
Note that process lifecycle tracking is fundamentally racy. You have to be prepared for the sandbox and the processes represented by a FlatpakInstance to not be around anymore.
The FlatpakInstance api was added in Flatpak 1.1.
GPtrArray *
flatpak_instance_get_all (void
);
Gets FlatpakInstance objects for all running sandboxes in the current session.
Since: 1.1
const char *
flatpak_instance_get_id (FlatpakInstance *self
);
Gets the instance ID. The ID is used by Flatpak for bookkeeping purposes and has no further relevance.
Since: 1.1
const char *
flatpak_instance_get_app (FlatpakInstance *self
);
Gets the application ID of the application running in the instance.
Note that this may return NULL
for sandboxes that don't have an application.
Since: 1.1
const char *
flatpak_instance_get_arch (FlatpakInstance *self
);
Gets the architecture of the application running in the instance.
Since: 1.1
const char *
flatpak_instance_get_branch (FlatpakInstance *self
);
Gets the branch of the application running in the instance.
Since: 1.1
const char *
flatpak_instance_get_commit (FlatpakInstance *self
);
Gets the commit of the application running in the instance.
Since: 1.1
const char *
flatpak_instance_get_runtime (FlatpakInstance *self
);
Gets the ref of the runtime used in the instance.
Since: 1.1
const char *
flatpak_instance_get_runtime_commit (FlatpakInstance *self
);
Gets the commit of the runtime used in the instance.
Since: 1.1
int
flatpak_instance_get_pid (FlatpakInstance *self
);
Gets the PID of the outermost process in the sandbox. This is not the application process itself, but a bubblewrap 'babysitter' process.
See flatpak_instance_get_child_pid()
.
Since: 1.1
int
flatpak_instance_get_child_pid (FlatpakInstance *self
);
Gets the PID of the application process in the sandbox.
See flatpak_instance_get_pid()
.
Note that this function may return 0 immediately after launching a sandbox, for a short amount of time.
Since: 1.1
GKeyFile *
flatpak_instance_get_info (FlatpakInstance *self
);
Gets a keyfile that holds information about the running sandbox.
This file is available as /.flatpak-info inside the sandbox as well.
The most important data in the keyfile is available with separate getters, but there may be more information in the keyfile.
Since: 1.1
gboolean
flatpak_instance_is_running (FlatpakInstance *self
);
Finds out if the sandbox represented by self
is still running.
Error codes
#define | FLATPAK_ERROR |
enum | FlatpakError |
#define | FLATPAK_PORTAL_ERROR |
enum | FlatpakPortalError |
The FlatpakError and FlatpakPortalError enumerations contain error codes for some common errors.
Error codes for library functions.
App/runtime is already installed | ||
App/runtime is not installed | ||
App/runtime was only pulled into the local repository but not installed. | ||
The App/Runtime is already installed, but from a different remote. | ||
The transaction was aborted (returned | ||
The App/Runtime install was skipped due to earlier errors. | ||
The App/Runtime needs a more recent version of flatpak. | ||
The specified remote was not found. | ||
A runtime needed for the app was not found. | ||
The pulled commit is a downgrade, and a downgrade wasn't specifically allowed. (Since: 1.0) | ||
A ref could not be parsed. (Since: 1.0.3) | ||
Invalid data. (Since: 1.0.3) | ||
Missing GPG key or signature. (Since: 1.0.3) | ||
Sandbox setup failed. (Since: 1.0.3) | ||
Exporting data failed. (Since: 1.0.3) | ||
Remote can't be uninstalled. (Since: 1.0.3) | ||
Runtime can't be uninstalled. (Since: 1.0.3) | ||
Application, runtime or remote name is invalid. (Since: 1.0.3) | ||
More disk space needed. (Since: 1.2.0) | ||
An operation is being attempted by the wrong user (such as root operating on a user installation). (Since: 1.2.0) | ||
Cached data was requested, but it was not available. (Since: 1.4.0) | ||
The specified ref was not found. (Since: 1.4.0) | ||
An operation was not allowed by the administrative policy. For example, an app is not allowed to be installed due to not complying with the parental controls policy. (Since: 1.5.1) | ||
An authentication operation failed, for example, no correct password was supplied. (Since: 1.7.3) | ||
An operation tried to access a ref, or information about it that it was not authorized. For example, when succesfully authenticating with a server but the user doesn't have permissions for a private ref. (Since: 1.7.3) |
#define FLATPAK_PORTAL_ERROR flatpak_portal_error_quark ()
The error domain for FlatpakPortalError errors.
Version information
#define | FLATPAK_MAJOR_VERSION |
#define | FLATPAK_MINOR_VERSION |
#define | FLATPAK_MICRO_VERSION |
Table of Contents
org.freedesktop.Flatpak.Authenticator
RequestRefTokens (IN s handle_token, IN a{sv} authenticator_options, IN s remote, IN s remote_uri, IN a(ssia{sv}) refs, IN a{sv} options, IN s parent_window, OUT o handle);
RequestRefTokens (IN s handle_token, IN a{sv} authenticator_options, IN s remote, IN s remote_uri, IN a(ssia{sv}) refs, IN a{sv} options, IN s parent_window, OUT o handle);
object path element. See the org.freedesktop.Flatpak.AuthenticatorRequest documentation for
more information about the handle
.
authenticator_options
: Data from the xa.authenticator-options key in the configuration for the remote, it is up to the authenticator to interpret this how it wants.
remote
: The name of the remote we're pulling from.
remote_uri
: The uri of the remote we're pulling from.
refs
: An array of ref that flatpak wants to pull and info about each ref.
options
: An extensible dict with extra options.
parent_window
: Identifier for the application window, see xdg-desktop-portal docs for details on its format.
handle
: Object path for the org.freedesktop.Flatpak.AuthenticatorRequest object representing this call.
Starts a request for resolving the tokens to use for refs
from the remote
(with uri remote_uri
).
This is not a regular dbus call that blocks until the result is done, instead it creates
a org.freedesktop.Flatpak.AuthenticatorRequest object representing the ongoing operation and
returns an object path handle
to it. When the operation succeds the Response signal is emitted
on the request with a response status and a dict with details.
The refs
array elements are of type (ssia{sv}) where the items are:
s: The ref being pulled |
s: The exact commit being pulled |
i: The token-type of the commit |
a{sv}: Extra per-ref metadata, currenlty only has summary.* fields which are copied from the summary per-commit metadata. |
On success (response 0) the returned details should have:
A list of tokens (the first element of the struct), and the refs (the second).
For other response types, see the org.freedesktop.Flatpak.AuthenticatorRequest docs.
Exactly how the authenticator decides on what token to use is up to each implementation, but typically it needs to talk to some kind of network service which in turn may need interaction such as login or entering credit card details. This can be done in two ways:
The authenticator can use a native ui toolkit directly (as its running in the session). To make this work well the
flatpak client can (if its has a UI) pass in the parent_window
argument, allowing the authenticator to open its
dialog in a way that is correctly parented.
Alternatively, if the interaction is web-based, then rather than showing a web browser itself it can emit the WebFlow signal on the request object, which lets the flatpak client show a webview embedded in its ui in a way that works best with its user interface.
For simple user/password authentication (such as http basic authentication systems) there is also a BasicAuth signal that can be used to get the user to interactively authenticate. This kind of authentication is quite limited, but if used it can allow nice interactive authentication even in the command line case.
Currently used keys in the options
argument:
For OCI remotes this is extracted from the summary file and contains the uri to the OCI registry that contains the images.
If true, the authenticator should not do any interaction (and fail instead if it needs to). This can be enabled by clients that want to run in the background.
IN s handle_token
:A string that will be used as the last element of the handle
. Must be a valid
IN a{sv} authenticator_options
:IN s remote
:IN s remote_uri
:IN a(ssia{sv}) refs
:IN a{sv} options
:IN s parent_window
:OUT o handle
:org.freedesktop.Flatpak.Development — Flatpak development interface
HostCommand (IN ay cwd_path, IN aay argv, IN a{uh} fds, IN a{ss} envs, IN u flags, OUT u pid); HostCommandSignal (IN u pid, IN u signal, IN b to_process_group);
The Development interface lets any client, possibly in a sandbox if it has access to the session helper, spawn a process on the host, outside any sandbox.
Clearly this is not something you typically want a sandboxed app to do: it is a sandbox escape allowing arbitrary code execution, and must not be allowed for applications where sandboxing is intended to be a security boundary.
However, it is very useful when using Flatpak for distribution and choice of runtime library stack, without intending to create a security boundary. For instance, if an IDE like GNOME Builder is distributed as a trusted Flatpak app and will be used to build other Flatpak apps, it needs to use this facility to launch a Flatpak build operation inside the sandbox, because otherwise recursive calls to flatpak will not work.
This interface is provided on the D-Bus session bus by the well-known D-Bus name org.freedesktop.Flatpak, at the object path /org/freedesktop/Flatpak/Development.
This documentation describes version 1 of this interface.
HostCommand (IN ay cwd_path, IN aay argv, IN a{uh} fds, IN a{ss} envs, IN u flags, OUT u pid);
This method lets trusted applications (insider or outside a sandbox) run arbitrary commands in the user's session, outside any sandbox.
The following flags values are supported:
Clear the environment.
Kill the sandbox when the caller disappears from the session bus.
Unknown (unsupported) flags are an error and will cause HostCommand() to fail.
Note that unlike org.freedesktop.portal.Flatpak.Spawn(), there is no options parameter here.
IN ay cwd_path
:the working directory for the new process
IN aay argv
:the argv for the new process, starting with the executable to launch
IN a{uh} fds
:an array of file descriptors to pass to the new process
IN a{ss} envs
:an array of variable/value pairs for the environment of the new process
IN u flags
:flags
OUT u pid
:the PID of the new process
HostCommandSignal (IN u pid, IN u signal, IN b to_process_group);
This method lets you send a Unix signal to a process
that was started with HostCommand().
The pid
argument here must be a PID that was returned by a
call to HostCommand() from the same sender: terminating unrelated
processes is not allowed.
IN u pid
:the process ID on the host system
IN u signal
:the signal to send (see signal(7))
IN b to_process_group
:whether to send the signal to the process group
HostCommandExited (u pid, u exit_status);
Emitted when a process started by
HostCommand() exits.
Use g_spawn_check_exit_status(), or the macros such as
WIFEXITED documented in
waitpid(2),
to interpret the exit_status
.
This signal is not emitted for processes that were not launched directly by HostCommand(), for example if a process launched by HostCommand() runs foreground or background child processes.
u pid
:the PID of the process that has ended
u exit_status
:the wait status (see waitpid(2))
org.freedesktop.Flatpak.SessionHelper — Flatpak session service
RequestSession (OUT a{sv} data);
The Flatpak session service is used by the flatpak run command to bridge various resources from the host system into Flatpak sandboxes. It is not intended to be contacted by third-party applications or libraries.
This interface is provided on the D-Bus session bus by the well-known D-Bus name org.freedesktop.Flatpak, at the object path /org/freedesktop/Flatpak/SessionHelper.
Note that the service owning the org.freedesktop.Flatpak well-known name also exports the org.freedesktop.Flatpak.Development interface. As a result, letting a sandboxed application contact that well-known name is a sandbox escape, which must only be allowed for trusted applications where there is not intended to be any security boundary between sandbox and host system.
This documentation describes version 1 of this interface.
org.freedesktop.Flatpak.SystemHelper — Flatpak system service
Deploy (IN ay repo_path, IN u flags, IN s ref, IN s origin, IN as subpaths, IN as previous_ids, IN s installation); DeployAppstream (IN ay repo_path, IN u flags, IN s origin, IN s arch, IN s installation); Uninstall (IN u flags, IN s ref, IN s installation); InstallBundle (IN ay bundle_path, IN u flags, IN s remote, IN s installation, OUT s ref); ConfigureRemote (IN u flags, IN s remote, IN s config, IN ay gpg_key, IN s installation); Configure (IN u flags, IN s key, IN s value, IN s installation); UpdateRemote (IN u flags, IN s remote, IN s installation, IN ay summary_path, IN ay summary_sig_path); RemoveLocalRef (IN u flags, IN s remote, IN s ref, IN s installation); PruneLocalRepo (IN u flags, IN s installation); RunTriggers (IN u flags, IN s installation); EnsureRepo (IN u flags, IN s installation); UpdateSummary (IN u flags, IN s installation); GenerateOciSummary (IN u flags, IN s origin, IN s installation); CancelPull (IN u flags, IN s installation, IN s src_dir); GetRevokefsFd (IN u flags, IN s installation, OUT h fd_index, OUT s src_dir);
The Flatpak system service is used by the libflatpak library to manipulate Flatpak applications and runtimes that are installed system-wide, for example when implementing flatpak install. It is not intended to be contacted by third-party applications or libraries. See the Flatpak source code for more details of this interface's methods.
This interface is provided on the D-Bus system bus by the well-known D-Bus name org.freedesktop.Flatpak.SystemHelper, at the object path /org/freedesktop/Flatpak/SystemHelper.
The system helper runs as a privileged user at the system level, and receives method calls from less-privileged users. Authorization for method calls on this interface is mediated by polkit (formerly PolicyKit) using the policy configuration org.freedesktop.Flatpak.policy, and can be configured by system administrators in the same way as for any other system service that uses polkit.
Deploy (IN ay repo_path, IN u flags, IN s ref, IN s origin, IN as subpaths, IN as previous_ids, IN s installation);
IN ay repo_path
:IN u flags
:IN s ref
:IN s origin
:IN as subpaths
:IN as previous_ids
:IN s installation
:DeployAppstream (IN ay repo_path, IN u flags, IN s origin, IN s arch, IN s installation);
IN ay repo_path
:IN u flags
:IN s origin
:IN s arch
:IN s installation
:Uninstall (IN u flags, IN s ref, IN s installation);
IN u flags
:IN s ref
:IN s installation
:InstallBundle (IN ay bundle_path, IN u flags, IN s remote, IN s installation, OUT s ref);
IN ay bundle_path
:IN u flags
:IN s remote
:IN s installation
:OUT s ref
:ConfigureRemote (IN u flags, IN s remote, IN s config, IN ay gpg_key, IN s installation);
IN u flags
:IN s remote
:IN s config
:IN ay gpg_key
:IN s installation
:Configure (IN u flags, IN s key, IN s value, IN s installation);
IN u flags
:IN s key
:IN s value
:IN s installation
:UpdateRemote (IN u flags, IN s remote, IN s installation, IN ay summary_path, IN ay summary_sig_path);
IN u flags
:IN s remote
:IN s installation
:IN ay summary_path
:IN ay summary_sig_path
:RemoveLocalRef (IN u flags, IN s remote, IN s ref, IN s installation);
IN u flags
:IN s remote
:IN s ref
:IN s installation
:PruneLocalRepo (IN u flags, IN s installation);
IN u flags
:IN s installation
:UpdateSummary (IN u flags, IN s installation);
IN u flags
:IN s installation
:GenerateOciSummary (IN u flags, IN s origin, IN s installation);
IN u flags
:IN s origin
:IN s installation
:org.freedesktop.impl.portal.PermissionStore — Database to store permissions
Lookup (IN s table, IN s id, OUT a{sas} permissions, OUT v data); Set (IN s table, IN b create, IN s id, IN a{sas} app_permissions, IN v data); Delete (IN s table, IN s id); SetValue (IN s table, IN b create, IN s id, IN v data); SetPermission (IN s table, IN b create, IN s id, IN s app, IN as permissions); DeletePermission (IN s table, IN s id, IN s app); List (IN s table, OUT as ids);
The permission store can be used by portals to store permissions that sandboxed applications have to various resources, such as files outside the sandbox.
Since the resources managed by portals can be varied, the permission store is fairly free-form: there can be multiple tables; resources are identified by an ID, as are applications, and permissions are stored as string arrays. None of these strings are interpreted by the permission store in any way.
In addition, the permission store allows to associate extra data (in the form of a GVariant) with each resource.
This document describes version 2 of the permission store interface.
Lookup (IN s table, IN s id, OUT a{sas} permissions, OUT v data);
Looks up the entry for a resource in one of the tables and returns all associated application permissions and data.
IN s table
:the name of the table to use
IN s id
:the resource ID to look up
OUT a{sas} permissions
:map from application ID to permissions
OUT v data
:data that is associated with the resource
Set (IN s table, IN b create, IN s id, IN a{sas} app_permissions, IN v data);
Writes the entry for a resource in the given table.
IN s table
:the name of the table to use
IN b create
:whether to create the table if it does not exist
IN s id
:the resource ID to modify
IN a{sas} app_permissions
:map from application ID to permissions
IN v data
:data to associate with the resource
Delete (IN s table, IN s id);
Removes the entry for a resource in the given table.
IN s table
:the name of the table to use
IN s id
:the resource ID to delete
SetValue (IN s table, IN b create, IN s id, IN v data);
Sets just the data for a resource in the given table.
IN s table
:the name of the table to use
IN b create
:whether to create the table if it does not exist
IN s id
:the resource ID to modify
IN v data
:data to associate with the resource
SetPermission (IN s table, IN b create, IN s id, IN s app, IN as permissions);
Sets the permissions for an application and a resource in the given table.
IN s table
:the name of the table to use
IN b create
:whether to create the table if it does not exist
IN s id
:the resource ID to modify
IN s app
:the application ID to modify
IN as permissions
:permissions to set
Changed (s table, s id, b deleted, v data, a{sas} permissions);
The Changed signal is emitted when the entry for a resource
is modified or deleted. If the entry was deleted, then data
and permissions
contain the last values that were found in the
database. If the entry was modified, they contain the new values.
s table
:the name of the table
s id
:b deleted
:whether the resource was deleted
v data
:the data that is associated the resource
a{sas} permissions
:the permissions that are associated with the resource
org.freedesktop.portal.Documents — Document portal
GetMountPoint (OUT ay path); Add (IN h o_path_fd, IN b reuse_existing, IN b persistent, OUT s doc_id); AddNamed (IN h o_path_parent_fd, IN ay filename, IN b reuse_existing, IN b persistent, OUT s doc_id); AddFull (IN ah o_path_fds, IN u flags, IN s app_id, IN as permissions, OUT as doc_ids, OUT a{sv} extra_out); AddNamedFull (IN h o_path_fd, IN ay filename, IN u flags, IN s app_id, IN as permissions, OUT s doc_id, OUT a{sv} extra_out); GrantPermissions (IN s doc_id, IN s app_id, IN as permissions); RevokePermissions (IN s doc_id, IN s app_id, IN as permissions); Delete (IN s doc_id); Lookup (IN ay filename, OUT s doc_id); Info (IN s doc_id, OUT ay path, OUT a{sas} apps); List (IN s app_id, OUT a{say} docs);
The document portal allows to make files from the outside world available to sandboxed applications in a controlled way.
Exported files will be made accessible to the application via a fuse filesystem that gets mounted at /run/user/$UID/doc/. The filesystem gets mounted both outside and inside the sandbox, but the view inside the sandbox is restricted to just those files that the application is allowed to access.
Individual files will appear at /run/user/$UID/doc/$DOC_ID/filename, where $DOC_ID is the ID of the file in the document store. It is returned by the Add() and AddNamed() calls.
The permissions that the application has for a document store entry (see GrantPermissions()) are reflected in the POSIX mode bits in the fuse filesystem.
The D-Bus interface for the document portal is available under the bus name org.freedesktop.portal.Documents and the object path /org/freedesktop/portal/documents.
This documentation describes version 3 of this interface.
GetMountPoint (OUT ay path);
Returns the path at which the document store fuse filesystem is mounted. This will typically be /run/user/$UID/doc/.
OUT ay path
:the path at which the fuse filesystem is mounted
Add (IN h o_path_fd, IN b reuse_existing, IN b persistent, OUT s doc_id);
Adds a file to the document store. The file is passed in the form of an open file descriptor to prove that the caller has access to the file.
IN h o_path_fd
:open file descriptor for the file to add
IN b reuse_existing
:whether to reuse an existing document store entry for the file
IN b persistent
:whether to add the file only for this session or permanently
OUT s doc_id
:the ID of the file in the document store
AddNamed (IN h o_path_parent_fd, IN ay filename, IN b reuse_existing, IN b persistent, OUT s doc_id);
Creates an entry in the document store for writing a new file.
IN h o_path_parent_fd
:open file descriptor for the parent directory
IN ay filename
:the basename for the file
IN b reuse_existing
:whether to reuse an existing document store entry for the file
IN b persistent
:whether to add the file only for this session or permanently
OUT s doc_id
:the ID of the file in the document store
AddFull (IN ah o_path_fds, IN u flags, IN s app_id, IN as permissions, OUT as doc_ids, OUT a{sv} extra_out);
Adds multiple files to the document store. The file is passed in the form of an open file descriptor to prove that the caller has access to the file.
If the as-needed-by-app flag is given, files will only be added to the document store if the application does not already have access to them. For files that are not added to the document store, the doc_ids array will contain an empty string.
Additionally, if app_id is specified, it will be given the permissions listed in GrantPermission.
The method also returns some extra info that can be used to avoid multiple roundtrips. For now it only contains as "mountpoint", the fuse mountpoint of the document portal.
This method was added in version 2 of the org.freedesktop.portal.Documents interface.
IN ah o_path_fds
:open file descriptors for the files to export
IN u flags
:flags, 1 == reuse_existing, 2 == persistent, 4 == as-needed-by-app
IN s app_id
:an application ID, or empty string
IN as permissions
:the permissions to grant, possible values are 'read', 'write', 'grant-permissions' and 'delete'
OUT as doc_ids
:the IDs of the files in the document store
OUT a{sv} extra_out
:AddNamedFull (IN h o_path_fd, IN ay filename, IN u flags, IN s app_id, IN as permissions, OUT s doc_id, OUT a{sv} extra_out);
Creates an entry in the document store for writing a new file.
If the as-needed-by-app flag is given, file will only be added to the document store if the application does not already have access to it. For file that is not added to the document store, the doc_id will contain an empty string.
Additionally, if app_id is specified, it will be given the permissions listed in GrantPermission.
The method also returns some extra info that can be used to avoid multiple roundtrips. For now it only contains as "mountpoint", the fuse mountpoint of the document portal.
This method was added in version 3 of the org.freedesktop.portal.Documents interface.
IN h o_path_fd
:IN ay filename
:the basename for the file
IN u flags
:flags, 1 == reuse_existing, 2 == persistent, 4 == as-needed-by-app
IN s app_id
:an application ID, or empty string
IN as permissions
:the permissions to grant, possible values are 'read', 'write', 'grant-permissions' and 'delete'
OUT s doc_id
:the ID of the file in the document store
OUT a{sv} extra_out
:GrantPermissions (IN s doc_id, IN s app_id, IN as permissions);
Grants access permissions for a file in the document store to an application.
This call is available inside the sandbox if the application has the 'grant-permissions' permission for the document.
IN s doc_id
:the ID of the file in the document store
IN s app_id
:the ID of the application to which permissions are granted
IN as permissions
:the permissions to grant, possible values are 'read', 'write', 'grant-permissions' and 'delete'
RevokePermissions (IN s doc_id, IN s app_id, IN as permissions);
Revokes access permissions for a file in the document store from an application.
This call is available inside the sandbox if the application has the 'grant-permissions' permission for the document.
IN s doc_id
:the ID of the file in the document store
IN s app_id
:the ID of the application from which permissions are revoked
IN as permissions
:the permissions to revoke, possible values are 'read', 'write', 'grant-permissions' and 'delete'
Delete (IN s doc_id);
Removes an entry from the document store. The file itself is not deleted.
This call is available inside the sandbox if the application has the 'delete' permission for the document.
IN s doc_id
:the ID of the file in the document store
Lookup (IN ay filename, OUT s doc_id);
Looks up the document ID for a file.
This call is not available inside the sandbox.
IN ay filename
:a path in the host filesystem
OUT s doc_id
:the ID of the file in the document store, or '' if the file is not in the document store
Info (IN s doc_id, OUT ay path, OUT a{sas} apps);
Gets the filesystem path and application permissions for a document store entry.
This call is not available inside the sandbox.
IN s doc_id
:the ID of the file in the document store
OUT ay path
:the path for the file in the host filesystem
OUT a{sas} apps
:a dictionary mapping application IDs to the permissions for that application
List (IN s app_id, OUT a{say} docs);
Lists documents in the document store for an application (or for all applications).
This call is not available inside the sandbox.
IN s app_id
:an application ID, or '' to list all documents
OUT a{say} docs
:a dictonary mapping document IDs to their filesystem path
org.freedesktop.portal.Flatpak — Flatpak portal
Spawn (IN ay cwd_path, IN aay argv, IN a{uh} fds, IN a{ss} envs, IN u flags, IN a{sv} options, OUT u pid); SpawnSignal (IN u pid, IN u signal, IN b to_process_group); CreateUpdateMonitor (IN a{sv} options, OUT o handle);
The flatpak portal exposes some interactions with flatpak on the host to the sandbox. For example, it allows you to restart the applications or start a more sandboxed instance.
This portal is available on the D-Bus session bus under the bus name org.freedesktop.portal.Flatpak and the object path /org/freedesktop/portal/Flatpak.
This documentation describes version 4 of this interface.
Spawn (IN ay cwd_path, IN aay argv, IN a{uh} fds, IN a{ss} envs, IN u flags, IN a{sv} options, OUT u pid);
This method lets you start a new instance of your application, optionally enabling a tighter sandbox.
The following flags values are supported:
Clear the environment.
Spawn the latest version of the app.
Spawn in a sandbox (equivalent of the sandbox option of flatpak run).
Spawn without network (equivalent of the unshare=network option of flatpak run).
Kill the sandbox when the caller disappears from the session bus.
Expose the sandbox pids in the callers sandbox, only supported if using user namespaces for containers (not setuid), see the support property.
This was added in version 3 of this interface (available from flatpak 1.6.0 and later).
Emit a SpawnStarted signal once the sandboxed process has been fully started.
This was added in version 4 of this interface (available from flatpak 1.8.0 and later).
Unknown (unsupported) flags are an error and will cause Spawn() to fail.
Unknown (unsupported) options are ignored. The following options are supported:
A list of filenames for files inside the sandbox that will be exposed to the new sandbox, for reading and writing. Note that absolute paths or subdirectories are not allowed.
The files must be in the sandbox
subdirectory of
the instance directory (i.e. ~/.var/app/$APP_ID/sandbox
).
A list of filenames for files inside the sandbox that will be exposed to the new sandbox, readonly. Note that absolute paths or subdirectories are not allowed.
The files must be in the sandbox
subdirectory of
the instance directory (i.e. ~/.var/app/$APP_ID/sandbox
).
A list of file descriptor for files inside the sandbox that will be exposed to the new sandbox, for reading and writing (if the caller has write access). The file descriptors must be opened with O_PATH and O_NOFOLLOW and cannot be symlinks.
This was added in version 3 of this interface (available from flatpak 1.6.0 and later).
A list of file descriptor for files inside the sandbox that will be exposed to the new sandbox, readonly. The file descriptors must be opened with O_PATH and O_NOFOLLOW and cannot be symlinks.
This was added in version 3 of this interface (available from flatpak 1.6.0 and later).
Flags affecting the created sandbox. The following flags values are supported:
Share the display access (X11, wayland) with the caller.
Share the sound access (pulseaudio) with the caller.
Share the gpu access with the caller.
Allow sandbox access to (filtered) session bus.
Allow sandbox access to accessibility bus.
This was added in version 3 of this interface (available from flatpak 1.6.0 and later).
IN ay cwd_path
:the working directory for the new process
IN aay argv
:the argv for the new process, starting with the executable to launch
IN a{uh} fds
:an array of file descriptors to pass to the new process
IN a{ss} envs
:an array of variable/value pairs for the environment of the new process
IN u flags
:flags
IN a{sv} options
:Vardict with optional further information
OUT u pid
:the PID of the new process
SpawnSignal (IN u pid, IN u signal, IN b to_process_group);
This method lets you send a Unix signal to a process
that was started with Spawn().
The pid
argument here should be the PID that is returned
by the Spawn() call: it is not necessarily valid in the caller's
PID namespace.
IN u pid
:the PID inside the container to signal
IN u signal
:the signal to send (see signal(7))
IN b to_process_group
:whether to send the signal to the process group
CreateUpdateMonitor (IN a{sv} options, OUT o handle);
Creates an update monitor object that will emit signals when an update for the caller becomes available, and can be used to install it.
The handle will be of the form /org/freedesktop/portal/Flatpak/update_monitor/SENDER/TOKEN, where SENDER is the caller's unique name, with the initial ':' removed and all '.' replaced by '_', and TOKEN is a unique token that the caller can optionally provide with the 'handle_token' key in the options vardict.
Currently, no other options are accepted.
This was added in version 2 of this interface (available from flatpak 1.5.0 and later).
IN a{sv} options
:Vardict with optional further information
OUT o handle
:Object path for the org.freedesktop.portal.Flatpak.UpdateMonitor object
SpawnStarted (u pid, u relpid);
This is only non-zero if the expose PIDs flag (32) was passed to Spawn(), and it may still be zero if the process exits before its relative PID could be read.
Emitted when a process started by Spawn() has fully started. In other words, Spawn() returns once the sandbox has been started, and this signal is emitted once the process inside itself is started.
Only emitted by version 4 of this interface (available from flatpak 1.8.0 and later) and if the notify start flag (64) was passed to Spawn().
u pid
:the PID of the process that has been started
u relpid
:the PID of the process relative to the current namespace.
SpawnExited (u pid, u exit_status);
Emitted when a process started by Spawn()
exits.
Use g_spawn_check_exit_status(), or the macros such as
WIFEXITED documented in
waitpid(2),
to interpret the exit_status
.
This signal is not emitted for processes that were not launched directly by Spawn(), for example if a process launched by Spawn() runs foreground or background child processes.
u pid
:the PID of the process that has ended
u exit_status
:the wait status (see waitpid(2))
supports readable u
Flags marking what optional features are available. The following flags values are supported:
Supports the expose sandbox pids flag of Spawn.
This was added in version 3 of this interface (available from flatpak 1.6.0 and later).
org.freedesktop.portal.Flatpak.UpdateMonitor
Update (IN s parent_window, IN a{sv} options);
see Common Conventions
options
: Vardict with optional further information
Asks to install an update of the calling app. During the installation, "Progress" signals will be emitted to communicate the status and progress.
Note that updates are only allowed if the new version has the same permissions (or less) than the currently installed version. If the new version requires a new permission then the operation will fail with the error org.freedesktop.DBus.Error.NotSupported and updates has to be done with the system tools.
Currently, no options are accepted.
IN s parent_window
:Identifier for the application window,
IN a{sv} options
:UpdateAvailable (a{sv} update_info);
Gets emitted when a new update is available. This is only sent once with the same information, but can be sent many times if new updates appear.
The following information may be included in the
update_info
dictionary:
The commit of the currently running instance.
The commit that is currently installed. Restarting the application will cause this commit to be used.
The commit that is available as an update from the remote. Updating the application will deploy this commit.
a{sv} update_info
:More information about the available update
Progress (a{sv} info);
Gets emitted to indicate progress of the installation. It's undefined exactly how often this is sent, but it will be emitted at least once at the end with non-zero status field. For each successful operation in the update we're also guaranteed to send one (and only one) signal with progress 100.
The following fields may be included in the info:
The number of operations that the update consists of.
The position of the currently active operation.
The progress of the currently active operation, as a number between 0 and 100.
The overall status of the update.
0: Running |
1: Empty. No update to install |
2: Done |
3: Failed |
The error name, sent when status is Failed
The error message, sent when status is Failed
a{sv} info
:More information about the update progress
GObject ├── FlatpakRef │ ├── FlatpakBundleRef │ ├── FlatpakInstalledRef │ ├── FlatpakRelatedRef │ ╰── FlatpakRemoteRef ├── FlatpakInstallation ├── FlatpakInstance ├── FlatpakRemote ├── FlatpakTransaction ├── FlatpakTransactionOperation ╰── FlatpakTransactionProgress