From dffc8f1b0d4077ef07ec17181ed6f17723ce2120 Mon Sep 17 00:00:00 2001
From: Kalev Lember <kalevlember@gmail.com>
Date: Thu, 14 May 2015 17:28:21 +0200
Subject: [PATCH] Revert "Make "reboot" the default action for no action file"
As a side effect, this commit inadvertently changed the default value
for the TriggerAction DBus property. This led to a fallout in the
gnome-shell shutdown dialog where the default then flipped to always
installing pending software updates on reboot / shutdown.
As for the issue that the original commit tried to address: it did so in
the wrong place. If there's a problem with the offline update process
hanging when no default is set, that should be addressed in
client/pk-offline-update.c to properly handle the UNSET state and not by
changing the default in the library.
This reverts commit 0a7b6d67b98cd06cabe03176c02db83f276dbe7b.
---
lib/packagekit-glib2/pk-offline.c | 2 +-
lib/packagekit-glib2/pk-test-private.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/packagekit-glib2/pk-offline.c b/lib/packagekit-glib2/pk-offline.c
index 60cd81f..5985ba8 100644
--- a/lib/packagekit-glib2/pk-offline.c
+++ b/lib/packagekit-glib2/pk-offline.c
@@ -240,7 +240,7 @@ pk_offline_get_action (GError **error)
/* is the trigger set? */
if (!g_file_test (PK_OFFLINE_TRIGGER_FILENAME, G_FILE_TEST_EXISTS) ||
!g_file_test (PK_OFFLINE_ACTION_FILENAME, G_FILE_TEST_EXISTS))
- return PK_OFFLINE_ACTION_REBOOT;
+ return PK_OFFLINE_ACTION_UNSET;
/* read data file */
if (!g_file_get_contents (PK_OFFLINE_ACTION_FILENAME,
diff --git a/lib/packagekit-glib2/pk-test-private.c b/lib/packagekit-glib2/pk-test-private.c
index 4a79c7c..1ac4331 100644
--- a/lib/packagekit-glib2/pk-test-private.c
+++ b/lib/packagekit-glib2/pk-test-private.c
@@ -652,7 +652,7 @@ pk_test_offline_func (void)
/* test no action set */
action = pk_offline_get_action (&error);
g_assert_no_error (error);
- g_assert_cmpint (action, ==, PK_OFFLINE_ACTION_REBOOT);
+ g_assert_cmpint (action, ==, PK_OFFLINE_ACTION_UNSET);
/* try to trigger without the fake updates set */
ret = pk_offline_auth_trigger (PK_OFFLINE_ACTION_REBOOT, &error);
--
2.4.0