FlatpakTransaction

FlatpakTransaction — Transaction information

Functions

Properties

FlatpakInstallation * installation Read / Write / Construct Only

Signals

Types and Values

Object Hierarchy

    GObject
    ╰── FlatpakTransaction

Implemented Interfaces

FlatpakTransaction implements GInitable.

Description

FlatpakTransaction is an object representing an install/update 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.

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.

Functions

flatpak_transaction_new_for_installation ()

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().

Parameters

installation

a FlatpakInstallation

 

cancellable

a GCancellable.

[nullable]

error

return location for a GError

 

Returns

a FlatpakTransaction, or NULL on failure.

[transfer full]


flatpak_transaction_add_install ()

gboolean
flatpak_transaction_add_install (FlatpakTransaction *self,
                                 const char *remote,
                                 const char *ref,
                                 const char **subpaths,
                                 GError **error);

flatpak_transaction_add_install_bundle ()

gboolean
flatpak_transaction_add_install_bundle
                               (FlatpakTransaction *self,
                                GFile *file,
                                GBytes *gpg_data,
                                GError **error);

flatpak_transaction_add_update ()

gboolean
flatpak_transaction_add_update (FlatpakTransaction *self,
                                const char *ref,
                                const char **subpaths,
                                const char *commit,
                                GError **error);

flatpak_transaction_is_empty ()

gboolean
flatpak_transaction_is_empty (FlatpakTransaction *self);

flatpak_transaction_run ()

gboolean
flatpak_transaction_run (FlatpakTransaction *self,
                         GCancellable *cancellable,
                         GError **error);

flatpak_transaction_set_disable_dependencies ()

void
flatpak_transaction_set_disable_dependencies
                               (FlatpakTransaction *self,
                                gboolean disable_dependencies);

flatpak_transaction_set_disable_prune ()

void
flatpak_transaction_set_disable_prune (FlatpakTransaction *self,
                                       gboolean disable_prune);

flatpak_transaction_set_disable_related ()

void
flatpak_transaction_set_disable_related
                               (FlatpakTransaction *self,
                                gboolean disable_related);

flatpak_transaction_set_disable_static_deltas ()

void
flatpak_transaction_set_disable_static_deltas
                               (FlatpakTransaction *self,
                                gboolean disable_static_deltas);

flatpak_transaction_set_no_deploy ()

void
flatpak_transaction_set_no_deploy (FlatpakTransaction *self,
                                   gboolean no_deploy);

flatpak_transaction_set_no_pull ()

void
flatpak_transaction_set_no_pull (FlatpakTransaction *self,
                                 gboolean no_pull);

flatpak_transaction_set_reinstall ()

void
flatpak_transaction_set_reinstall (FlatpakTransaction *self,
                                   gboolean reinstall);

Types and Values

FlatpakTransaction

typedef struct _FlatpakTransaction FlatpakTransaction;

enum FlatpakTransactionOperationType

The type of a transaction, used in FlatpakTransaction::new-operation

Members

FLATPAK_TRANSACTION_OPERATION_INSTALL

Install a ref from a remote

 

FLATPAK_TRANSACTION_OPERATION_UPDATE

Update an installed ref

 

FLATPAK_TRANSACTION_OPERATION_INSTALL_BUNDLE

Install a bundle from a file

 

FLATPAK_TRANSACTION_OPERATION_UNINSTALL

Uninstall a ref

 

enum FlatpakTransactionErrorDetails

The details for FlatpakTransaction::operation-error

Members

FLATPAK_TRANSACTION_ERROR_DETAILS_NON_FATAL

The operation failure was not fatal

 

enum FlatpakTransactionResult

Members

FLATPAK_TRANSACTION_RESULT_NO_CHANGE

The update caused no changes

 

Property Details

The “installation” property

  “installation”             FlatpakInstallation *

The installation instance.

Flags: Read / Write / Construct Only

Signal Details

The “choose-remote-for-ref” signal

gint
user_function (FlatpakTransaction *object,
               gchar              *for_ref,
               gchar              *runtime_ref,
               GStrv               remotes,
               gpointer            user_data)

Parameters

object

A FlatpakTransaction

 

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.

 

Returns

the index of the remote to use, or -1 to not pick one (and fail)

Flags: Run Last


The “end-of-lifed” signal

void
user_function (FlatpakTransaction *object,
               gchar              *ref,
               gchar              *reason,
               gchar              *rebase,
               gpointer            user_data)

Parameters

object

A FlatpakTransaction

 

ref

The ref we are installing

 

reason

The eol reason, or NULL

 

rebase

The new name, if rebased, or NULL

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “new-operation” signal

void
user_function (FlatpakTransaction         *object,
               gchar                      *ref,
               gchar                      *remote,
               gchar                      *bundle,
               gint                        operation_type,
               FlatpakTransactionProgress *progress,
               gpointer                    user_data)

Parameters

object

A FlatpakTransaction

 

ref

The ref the operation will be working on

 

remote

The ref the operation will be working on

 

bundle

The bundle path (or NULL)

 

operation_type

A FlatpakTransactionOperationType specifying operation type

 

progress

A FlatpakTransactionProgress

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “operation-done” signal

void
user_function (FlatpakTransaction *object,
               gchar              *ref,
               gchar              *remote,
               gint                operation_type,
               gchar              *commit,
               gpointer            user_data)

Parameters

object

A FlatpakTransaction

 

ref

The ref the operation was working on

 

remote

The remote

 

operation_type

A FlatpakTransactionOperationType specifying operation type

 

commit

The new commit checksum

 

result

A FlatpakTransactionResult giving details about the result

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “operation-error” signal

gboolean
user_function (FlatpakTransaction *object,
               gchar              *ref,
               gchar              *remote,
               gint                operation_type,
               GError             *error,
               gint                details,
               gpointer            user_data)

Parameters

object

A FlatpakTransaction

 

ref

The ref the operation was working on

 

remote

The remote

 

operation_type

A FlatpakTransactionOperationType specifying operation type

 

error

A GError

 

details

A FlatpakTransactionErrorDetails with Details about the error

 

user_data

user data set when the signal handler was connected.

 

Returns

the TRUE to contine transaction, FALSE to stop

Flags: Run Last