summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2018-07-05 11:50:19 +0200
committerAtomic Bot <atomic-devel@projectatomic.io>2018-07-07 15:38:46 +0000
commit1ecca029a8bb9bd4c053dc75f34566c143759e56 (patch)
treef9e44889b2837049599210d32646a71707c487c7
parente959fd3db0685281a90078e64344f7d32d347050 (diff)
downloadflatpak-1ecca029a8bb9bd4c053dc75f34566c143759e56.tar.gz
transaction: Add flatpak_transaction_set_default_arch
This will be used as the default when installing something that doesn't specify a ref, such as a flatpakref file. Closes: #1868 Approved by: alexlarsson
-rw-r--r--common/flatpak-transaction.c11
-rw-r--r--common/flatpak-transaction.h3
-rw-r--r--doc/reference/flatpak-sections.txt1
3 files changed, 15 insertions, 0 deletions
diff --git a/common/flatpak-transaction.c b/common/flatpak-transaction.c
index 1349830b..803cae77 100644
--- a/common/flatpak-transaction.c
+++ b/common/flatpak-transaction.c
@@ -98,6 +98,7 @@ struct _FlatpakTransactionPrivate {
gboolean disable_related;
gboolean reinstall;
gboolean force_uninstall;
+ char *default_arch;
};
enum {
@@ -486,6 +487,7 @@ flatpak_transaction_finalize (GObject *object)
g_clear_object (&priv->installation);
+ g_free (priv->default_arch);
g_hash_table_unref (priv->last_op_for_ref);
g_hash_table_unref (priv->remote_states);
g_list_free_full (priv->ops, (GDestroyNotify)g_object_unref);
@@ -818,6 +820,15 @@ flatpak_transaction_set_force_uninstall (FlatpakTransaction *self,
priv->force_uninstall = force_uninstall;
}
+void
+flatpak_transaction_set_default_arch (FlatpakTransaction *self,
+ const char *default_arch)
+{
+ FlatpakTransactionPrivate *priv = flatpak_transaction_get_instance_private (self);
+ g_free (priv->default_arch);
+ priv->default_arch = g_strdup (default_arch);
+}
+
static FlatpakTransactionOperation *
flatpak_transaction_get_last_op_for_ref (FlatpakTransaction *self,
const char *ref)
diff --git a/common/flatpak-transaction.h b/common/flatpak-transaction.h
index 48805ac4..45a59784 100644
--- a/common/flatpak-transaction.h
+++ b/common/flatpak-transaction.h
@@ -160,6 +160,9 @@ FLATPAK_EXTERN
void flatpak_transaction_set_force_uninstall (FlatpakTransaction *self,
gboolean force_uninstall);
FLATPAK_EXTERN
+void flatpak_transaction_set_default_arch (FlatpakTransaction *self,
+ const char *arch);
+FLATPAK_EXTERN
void flatpak_transaction_add_dependency_source (FlatpakTransaction *self,
FlatpakInstallation *installation);
FLATPAK_EXTERN
diff --git a/doc/reference/flatpak-sections.txt b/doc/reference/flatpak-sections.txt
index 8e2c888c..cae4050e 100644
--- a/doc/reference/flatpak-sections.txt
+++ b/doc/reference/flatpak-sections.txt
@@ -237,6 +237,7 @@ flatpak_transaction_set_no_deploy
flatpak_transaction_set_no_pull
flatpak_transaction_set_reinstall
flatpak_transaction_set_force_uninstall
+flatpak_transaction_set_default_arch
<SUBSECTION Standard>
FlatpakTransactionClass
FLATPAK_IS_TRANSACTION