summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2014-09-04 20:35:38 +0100
committerRichard Hughes <richard@hughsie.com>2014-09-04 20:35:38 +0100
commit6c8efb0d71856157a7f7ec09c3819200777e0250 (patch)
tree8952d088871cd12f9e3d80336e6292b2feb29ab8 /client
parentb7329155c4bb1e70d6df0c5f6c0e60684e2cab42 (diff)
trivial: Add the missing offline-cancel pkcon action
Diffstat (limited to 'client')
-rw-r--r--client/pk-console.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/client/pk-console.c b/client/pk-console.c
index 1756d4449..15fd029a6 100644
--- a/client/pk-console.c
+++ b/client/pk-console.c
@@ -1499,6 +1499,7 @@ pk_console_get_summary (PkConsoleCtx *ctx)
#ifdef PK_HAS_OFFLINE_UPDATES
g_string_append_printf (string, " %s\n", "offline-get-prepared");
g_string_append_printf (string, " %s\n", "offline-trigger");
+ g_string_append_printf (string, " %s\n", "offline-cancel");
g_string_append_printf (string, " %s\n", "offline-status");
#endif
return g_string_free (string, FALSE);
@@ -1556,15 +1557,6 @@ pk_console_offline_get_prepared (GError **error)
}
/**
- * pk_console_offline_trigger:
- **/
-static gboolean
-pk_console_offline_trigger (GError **error)
-{
- return pk_offline_trigger (PK_OFFLINE_ACTION_REBOOT, NULL, error);
-}
-
-/**
* pk_console_offline_status:
**/
static gboolean
@@ -2320,7 +2312,14 @@ main (int argc, char *argv[])
} else if (strcmp (mode, "offline-trigger") == 0) {
run_mainloop = FALSE;
- ret = pk_console_offline_trigger (&error);
+ ret = pk_offline_trigger (PK_OFFLINE_ACTION_REBOOT, NULL, &error);
+ if (!ret)
+ ctx->retval = error->code;
+
+ } else if (strcmp (mode, "offline-cancel") == 0) {
+
+ run_mainloop = FALSE;
+ ret = pk_offline_cancel (NULL, &error);
if (!ret)
ctx->retval = error->code;