transaction: Extract commit when adding bundle

This way we know ahead of time what we're going to be installing.

Closes: #1787
Approved by: alexlarsson
This commit is contained in:
Alexander Larsson
2018-06-14 13:53:51 +02:00
committed by Atomic Bot
parent 6a73c26003
commit 6459a13b2a
4 changed files with 9 additions and 3 deletions

View File

@@ -526,6 +526,7 @@ char *flatpak_dir_ensure_bundle_remote (FlatpakDir *self,
GFile *file,
GBytes *extra_gpg_data,
char **out_ref,
char **out_commit,
char **out_metadata,
gboolean *out_created_remote,
GCancellable *cancellable,

View File

@@ -6740,6 +6740,7 @@ flatpak_dir_ensure_bundle_remote (FlatpakDir *self,
GFile *file,
GBytes *extra_gpg_data,
char **out_ref,
char **out_checksum,
char **out_metadata,
gboolean *out_created_remote,
GCancellable *cancellable,
@@ -6821,6 +6822,9 @@ flatpak_dir_ensure_bundle_remote (FlatpakDir *self,
if (out_ref)
*out_ref = g_steal_pointer (&ref);
if (out_checksum)
*out_checksum = g_steal_pointer (&to_checksum);
if (out_metadata)
*out_metadata = g_steal_pointer (&fp_metadata);

View File

@@ -1582,7 +1582,7 @@ flatpak_installation_install_bundle (FlatpakInstallation *self,
if (dir == NULL)
return NULL;
remote = flatpak_dir_ensure_bundle_remote (dir, file, NULL, &ref, NULL, NULL, cancellable, error);
remote = flatpak_dir_ensure_bundle_remote (dir, file, NULL, &ref, NULL, NULL, NULL, cancellable, error);
if (remote == NULL)
return NULL;

View File

@@ -1200,11 +1200,12 @@ flatpak_transaction_add_install_bundle (FlatpakTransaction *self,
FlatpakTransactionPrivate *priv = flatpak_transaction_get_instance_private (self);
g_autofree char *remote = NULL;
g_autofree char *ref = NULL;
g_autofree char *commit = NULL;
g_autofree char *metadata = NULL;
gboolean created_remote;
remote = flatpak_dir_ensure_bundle_remote (priv->dir, file, gpg_data,
&ref, &metadata, &created_remote,
&ref, &commit, &metadata, &created_remote,
NULL, error);
if (remote == NULL)
return FALSE;
@@ -1212,7 +1213,7 @@ flatpak_transaction_add_install_bundle (FlatpakTransaction *self,
if (!flatpak_dir_recreate_repo (priv->dir, NULL, error))
return FALSE;
return flatpak_transaction_add_ref (self, remote, ref, NULL, NULL, FLATPAK_TRANSACTION_OP_KIND_BUNDLE, file, metadata, error);
return flatpak_transaction_add_ref (self, remote, ref, NULL, commit, FLATPAK_TRANSACTION_OP_KIND_BUNDLE, file, metadata, error);
}
gboolean