summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2017-12-12 10:46:00 +0100
committerAlexander Larsson <alexl@redhat.com>2017-12-12 10:46:00 +0100
commit36fac4b66202f8753423cfdd45d714d99c48eeac (patch)
treed87640ee83b0ea5e1560965ad31352e3f1fb5565
parentb854b0cf9bbb5c77324709542a35526db8434d19 (diff)
downloadflatpak-reinstall.tar.gz
fixup! install: Add --reinstallreinstall
-rw-r--r--system-helper/flatpak-system-helper.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/system-helper/flatpak-system-helper.c b/system-helper/flatpak-system-helper.c
index aba9a4d0..2ccdfa73 100644
--- a/system-helper/flatpak-system-helper.c
+++ b/system-helper/flatpak-system-helper.c
@@ -191,18 +191,23 @@ handle_deploy (FlatpakSystemHelper *object,
g_autofree char *real_origin = NULL;
if (!is_update)
{
- /* Can't install already installed app */
- g_dbus_method_invocation_return_error (invocation, FLATPAK_ERROR, FLATPAK_ERROR_ALREADY_INSTALLED,
- "%s is already installed", arg_ref);
- return TRUE;
+ if (!reinstall)
+ {
+ /* Can't install already installed app */
+ g_dbus_method_invocation_return_error (invocation, FLATPAK_ERROR, FLATPAK_ERROR_ALREADY_INSTALLED,
+ "%s is already installed", arg_ref);
+ return TRUE;
+ }
}
-
- real_origin = flatpak_dir_get_origin (system, arg_ref, NULL, NULL);
- if (g_strcmp0 (real_origin, arg_origin) != 0)
+ else
{
- g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS,
- "Wrong origin %s for update", arg_origin);
- return TRUE;
+ real_origin = flatpak_dir_get_origin (system, arg_ref, NULL, NULL);
+ if (g_strcmp0 (real_origin, arg_origin) != 0)
+ {
+ g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS,
+ "Wrong origin %s for update", arg_origin);
+ return TRUE;
+ }
}
}
else if (!deploy_dir && is_update)