Disable static deltas for system-helper updates

Due to an issue with ostree (https://github.com/ostreedev/ostree/pull/362)
applying non-from-scratch deltas fail when using parent_repo such as
in the system-helper case. We fix this temporarily by disabling the
use of deltas for that case.
tingping/wmclass
Alexander Larsson 2016-06-23 12:16:02 +02:00
parent 2966b25ba0
commit 9915e3740b
3 changed files with 21 additions and 13 deletions

View File

@ -1147,6 +1147,7 @@ flatpak_dir_update_appstream (FlatpakDir *self,
if (!flatpak_dir_pull (self, remote, branch, NULL,
child_repo, OSTREE_REPO_PULL_FLAGS_MIRROR,
/* TODO: forcing no-deltas due to issue #144 */ TRUE,
progress, cancellable, error))
return FALSE;
@ -1175,7 +1176,7 @@ flatpak_dir_update_appstream (FlatpakDir *self,
return TRUE;
}
if (!flatpak_dir_pull (self, remote, branch, NULL, NULL, OSTREE_REPO_PULL_FLAGS_NONE, progress,
if (!flatpak_dir_pull (self, remote, branch, NULL, NULL, OSTREE_REPO_PULL_FLAGS_NONE, FALSE, progress,
cancellable, error))
return FALSE;
@ -1206,6 +1207,7 @@ repo_pull_one_dir (OstreeRepo *self,
const char *dir_to_pull,
char **refs_to_fetch,
OstreeRepoPullFlags flags,
gboolean force_disable_deltas,
OstreeAsyncProgress *progress,
GCancellable *cancellable,
GError **error)
@ -1218,10 +1220,13 @@ repo_pull_one_dir (OstreeRepo *self,
{
g_variant_builder_add (&builder, "{s@v}", "subdir",
g_variant_new_variant (g_variant_new_string (dir_to_pull)));
g_variant_builder_add (&builder, "{s@v}", "disable-static-deltas",
g_variant_new_variant (g_variant_new_boolean (TRUE)));
force_disable_deltas = TRUE;
}
if (force_disable_deltas)
g_variant_builder_add (&builder, "{s@v}", "disable-static-deltas",
g_variant_new_variant (g_variant_new_boolean (TRUE)));
g_variant_builder_add (&builder, "{s@v}", "flags",
g_variant_new_variant (g_variant_new_int32 (flags)));
if (refs_to_fetch)
@ -1240,6 +1245,7 @@ flatpak_dir_pull (FlatpakDir *self,
const char **subpaths,
OstreeRepo *repo,
OstreeRepoPullFlags flags,
gboolean force_disable_deltas,
OstreeAsyncProgress *progress,
GCancellable *cancellable,
GError **error)
@ -1283,10 +1289,10 @@ flatpak_dir_pull (FlatpakDir *self,
if (subpaths == NULL || subpaths[0] == NULL)
{
if (!ostree_repo_pull (repo, repository,
(char **) refs, flags,
progress,
cancellable, error))
if (!repo_pull_one_dir (repo, repository, NULL,
(char **) refs, flags, force_disable_deltas,
progress,
cancellable, error))
{
g_prefix_error (error, "While pulling %s from remote %s: ", ref, repository);
goto out;
@ -1298,7 +1304,7 @@ flatpak_dir_pull (FlatpakDir *self,
if (!repo_pull_one_dir (repo, repository,
"/metadata",
(char **) refs, flags,
(char **) refs, flags, force_disable_deltas,
progress,
cancellable, error))
{
@ -1312,7 +1318,7 @@ flatpak_dir_pull (FlatpakDir *self,
g_autofree char *subpath = g_build_filename ("/files", subpaths[i], NULL);
if (!repo_pull_one_dir (repo, repository,
subpath,
(char **) refs, flags,
(char **) refs, flags, force_disable_deltas,
progress,
cancellable, error))
{
@ -3085,7 +3091,7 @@ flatpak_dir_install (FlatpakDir *self,
return FALSE;
if (!flatpak_dir_pull (self, remote_name, ref, subpaths,
child_repo, OSTREE_REPO_PULL_FLAGS_MIRROR,
child_repo, OSTREE_REPO_PULL_FLAGS_MIRROR, FALSE,
progress, cancellable, error))
return FALSE;
@ -3111,7 +3117,7 @@ flatpak_dir_install (FlatpakDir *self,
if (!no_pull)
{
if (!flatpak_dir_pull (self, remote_name, ref, opt_subpaths, NULL, OSTREE_REPO_PULL_FLAGS_NONE, progress,
if (!flatpak_dir_pull (self, remote_name, ref, opt_subpaths, NULL, OSTREE_REPO_PULL_FLAGS_NONE, FALSE, progress,
cancellable, error))
return FALSE;
}
@ -3328,6 +3334,7 @@ flatpak_dir_update (FlatpakDir *self,
if (!flatpak_dir_pull (self, remote_name, ref, subpaths,
child_repo, OSTREE_REPO_PULL_FLAGS_MIRROR,
/* TODO: forcing no-deltas due to issue #144 */ TRUE,
progress, cancellable, error))
return FALSE;
@ -3361,7 +3368,7 @@ flatpak_dir_update (FlatpakDir *self,
if (!no_pull)
{
if (!flatpak_dir_pull (self, remote_name, ref, subpaths,
NULL, OSTREE_REPO_PULL_FLAGS_NONE, progress,
NULL, OSTREE_REPO_PULL_FLAGS_NONE, FALSE, progress,
cancellable, error))
return FALSE;
}

View File

@ -211,6 +211,7 @@ gboolean flatpak_dir_pull (FlatpakDir *self,
const char **subpaths,
OstreeRepo *repo,
OstreeRepoPullFlags flags,
gboolean force_disable_deltas,
OstreeAsyncProgress *progress,
GCancellable *cancellable,
GError **error);

View File

@ -243,7 +243,7 @@ handle_deploy (FlatpakSystemHelper *object,
g_main_context_push_thread_default (main_context);
if (!flatpak_dir_pull (system, arg_origin, arg_ref, (const char **)arg_subpaths, NULL,
OSTREE_REPO_PULL_FLAGS_UNTRUSTED, NULL,
OSTREE_REPO_PULL_FLAGS_UNTRUSTED, FALSE, NULL,
NULL, &error))
{
g_main_context_pop_thread_default (main_context);