summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2016-05-12 21:23:36 +0200
committerAlexander Larsson <alexl@redhat.com>2016-05-12 21:23:36 +0200
commit5407b8efc657b654da7c66d5c69c35448eb43061 (patch)
tree0aee5808fe0a91422416c19a3b448e48a045a30b /common
parent3964504438e5f6e0354ea6145f0e0022244ae3fc (diff)
downloadxdg-app-5407b8efc657b654da7c66d5c69c35448eb43061.tar.gz
system-helper: Support uninstall
Diffstat (limited to 'common')
-rw-r--r--common/flatpak-dir.c23
-rw-r--r--common/flatpak-dir.h4
2 files changed, 22 insertions, 5 deletions
diff --git a/common/flatpak-dir.c b/common/flatpak-dir.c
index 2ba6769..06899dd 100644
--- a/common/flatpak-dir.c
+++ b/common/flatpak-dir.c
@@ -232,7 +232,7 @@ flatpak_dir_get_system_helper (FlatpakDir *self)
}
gboolean
-flatpak_dir_use_child_repo (FlatpakDir *self)
+flatpak_dir_use_system_helper (FlatpakDir *self)
{
FlatpakSystemHelper *system_helper;
@@ -1085,7 +1085,7 @@ flatpak_dir_update_appstream (FlatpakDir *self,
if (!flatpak_dir_ensure_repo (self, cancellable, error))
return FALSE;
- if (flatpak_dir_use_child_repo (self))
+ if (flatpak_dir_use_system_helper (self))
{
g_autoptr(OstreeRepo) child_repo = NULL;
g_auto(GLnxLockFile) child_repo_lock = GLNX_LOCK_FILE_INIT;
@@ -2945,7 +2945,7 @@ flatpak_dir_install (FlatpakDir *self,
GCancellable *cancellable,
GError **error)
{
- if (flatpak_dir_use_child_repo (self))
+ if (flatpak_dir_use_system_helper (self))
{
g_autoptr(OstreeRepo) child_repo = NULL;
g_auto(GLnxLockFile) child_repo_lock = GLNX_LOCK_FILE_INIT;
@@ -3018,7 +3018,7 @@ flatpak_dir_update (FlatpakDir *self,
GCancellable *cancellable,
GError **error)
{
- if (flatpak_dir_use_child_repo (self))
+ if (flatpak_dir_use_system_helper (self))
{
g_autoptr(OstreeRepo) child_repo = NULL;
g_auto(GLnxLockFile) child_repo_lock = GLNX_LOCK_FILE_INIT;
@@ -3116,6 +3116,21 @@ flatpak_dir_uninstall (FlatpakDir *self,
return FALSE;
name = parts[1];
+ if (flatpak_dir_use_system_helper (self))
+ {
+ FlatpakSystemHelper *system_helper;
+
+ system_helper = flatpak_dir_get_system_helper (self);
+ g_assert (system_helper != NULL);
+
+ if (!flatpak_system_helper_call_uninstall_sync (system_helper,
+ flags, ref,
+ cancellable, error))
+ return FALSE;
+
+ return TRUE;
+ }
+
if (!flatpak_dir_lock (self, &lock,
cancellable, error))
return FALSE;
diff --git a/common/flatpak-dir.h b/common/flatpak-dir.h
index 3d6b2b8..9a102be 100644
--- a/common/flatpak-dir.h
+++ b/common/flatpak-dir.h
@@ -45,13 +45,15 @@ typedef enum {
FLATPAK_HELPER_DEPLOY_FLAGS_UPDATE = 1 << 0,
} FlatpakHelperDeployFlags;
+#define FLATPAK_HELPER_DEPLOY_FLAGS_ALL (FLATPAK_HELPER_DEPLOY_FLAGS_UPDATE)
+
typedef enum {
FLATPAK_HELPER_UNINSTALL_FLAGS_NONE = 0,
FLATPAK_HELPER_UNINSTALL_FLAGS_KEEP_REF = 1 << 0,
FLATPAK_HELPER_UNINSTALL_FLAGS_FORCE_REMOVE = 1 << 1,
} FlatpakHelperUninstallFlags;
-#define FLATPAK_HELPER_DEPLOY_FLAGS_ALL (FLATPAK_HELPER_DEPLOY_FLAGS_UPDATE)
+#define FLATPAK_HELPER_UNINSTALL_FLAGS_ALL (FLATPAK_HELPER_UNINSTALL_FLAGS_KEEP_REF | FLATPAK_HELPER_UNINSTALL_FLAGS_FORCE_REMOVE)
GQuark flatpak_dir_error_quark (void);