From 91eda8919e06d6d7752a522e4161fb7d2611cbed Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Thu, 21 Apr 2016 20:19:01 +0200 Subject: common: Move duplicated code into xdg_app_dir_deploy_update --- lib/xdg-app-installation.c | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) (limited to 'lib') diff --git a/lib/xdg-app-installation.c b/lib/xdg-app-installation.c index c6ab372..26b0f87 100644 --- a/lib/xdg-app-installation.c +++ b/lib/xdg-app-installation.c @@ -1092,8 +1092,6 @@ xdg_app_installation_update (XdgAppInstallation *self, g_autoptr(OstreeAsyncProgress) ostree_progress = NULL; g_autofree char *remote_name = NULL; XdgAppInstalledRef *result = NULL; - gboolean was_updated = FALSE; - g_auto(GLnxLockFile) lock = GLNX_LOCK_FILE_INIT; g_auto(GStrv) subpaths = NULL; ref = xdg_app_compose_ref (kind == XDG_APP_REF_KIND_APP, name, branch, arch, error); @@ -1140,35 +1138,13 @@ xdg_app_installation_update (XdgAppInstallation *self, if ((flags & XDG_APP_UPDATE_FLAGS_NO_DEPLOY) == 0) { - if (!xdg_app_dir_lock (dir_clone, &lock, - cancellable, error)) + if (!xdg_app_dir_deploy_update (dir_clone, ref, NULL, + cancellable, error)) goto out; - - if (!xdg_app_dir_deploy_update (dir_clone, ref, NULL, &was_updated, cancellable, error)) - return FALSE; - - if (was_updated && kind == XDG_APP_REF_KIND_APP) - { - if (!xdg_app_dir_update_exports (dir_clone, name, cancellable, error)) - goto out; - } } result = get_ref (self, ref, cancellable); - glnx_release_lock_file (&lock); - - if (was_updated) - { - if (!xdg_app_dir_prune (dir_clone, cancellable, error)) - goto out; - - if (!xdg_app_dir_mark_changed (dir_clone, error)) - goto out; - } - - xdg_app_dir_cleanup_removed (dir_clone, cancellable, NULL); - out: if (main_context) g_main_context_pop_thread_default (main_context); -- cgit v1.2.1