rpms/gnome-packagekit/devel gpk-dont-get-updates-when-set-to-none.patch, NONE, 1.1 gnome-packagekit.spec, 1.51, 1.52

Richard Hughes rhughes at fedoraproject.org
Fri Oct 10 17:18:06 UTC 2008


Author: rhughes

Update of /cvs/pkgs/rpms/gnome-packagekit/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv5762

Modified Files:
	gnome-packagekit.spec 
Added Files:
	gpk-dont-get-updates-when-set-to-none.patch 
Log Message:
* Fri Oct 10 2008 Richard Hughes  <rhughes at redhat.com> - 0.3.6-4
- Add a bugfix from upstream so we don't try to check for updates
  when we've set to never. Fixes RH#461825.


gpk-dont-get-updates-when-set-to-none.patch:

--- NEW FILE gpk-dont-get-updates-when-set-to-none.patch ---
commit 0f4e50d52c95164a1d987c42ca73cc386e51f951
Author: Richard Hughes <richard at hughsie.com>
Date:   Fri Oct 10 18:08:03 2008 +0100

    fix the bug where GetUpdates is unconditionally run at startup, regardless of the policy. Provide an option in GConf for power users who want this. Fixes RH#461825

diff --git a/data/gnome-packagekit.schemas.in b/data/gnome-packagekit.schemas.in
index a0200e0..e4de627 100644
--- a/data/gnome-packagekit.schemas.in
+++ b/data/gnome-packagekit.schemas.in
@@ -206,6 +206,21 @@
     </schema>
 
     <schema>
+      <key>/schemas/apps/gnome-packagekit/force_get_updates_login</key>
+      <applyto>/apps/gnome-packagekit/force_get_updates_login</applyto>
+      <owner>gnome-packagekit</owner>
+      <type>bool</type>
+      <default>false</default>
+      <locale name="C">
+        <short>If we should get the update list when the session starts</short>
+        <long>
+          If we should get the update list when the session starts, even if we are not scheduled to.
+          This ensures the user has up to date and valid data in the tray at startup.
+        </long>
+      </locale>
+    </schema>
+
+    <schema>
       <key>/schemas/apps/gnome-packagekit/frequency_get_updates</key>
       <applyto>/apps/gnome-packagekit/frequency_get_updates</applyto>
       <owner>gnome-packagekit</owner>
diff --git a/src/gpk-auto-refresh.c b/src/gpk-auto-refresh.c
index 9bacc3b..bd925bc 100644
--- a/src/gpk-auto-refresh.c
+++ b/src/gpk-auto-refresh.c
@@ -74,7 +74,7 @@ struct GpkAutoRefreshPrivate
 	gboolean		 on_battery;
 	gboolean		 network_active;
 	gboolean		 session_delay;
-	gboolean		 sent_get_updates;
+	gboolean		 force_get_updates_login;
 	EggDbusMonitor		*monitor_gs;
 	EggDbusMonitor		*monitor_gpm;
 	GConfClient		*gconf_client;
@@ -346,6 +346,8 @@ gpk_auto_refresh_maybe_get_upgrades (GpkAutoRefresh *arefresh)
 static gboolean
 gpk_auto_refresh_change_state (GpkAutoRefresh *arefresh)
 {
+	gboolean force;
+
 	g_return_val_if_fail (GPK_IS_AUTO_REFRESH (arefresh), FALSE);
 
 	/* we shouldn't do this early in the session startup */
@@ -360,11 +362,16 @@ gpk_auto_refresh_change_state (GpkAutoRefresh *arefresh)
 		return FALSE;
 	}
 
-	/* we do this to get an icon at startup */
-	if (!arefresh->priv->sent_get_updates) {
-		gpk_auto_refresh_signal_get_updates (arefresh);
-		arefresh->priv->sent_get_updates = TRUE;
-		return TRUE;
+	/* only force a check if the user REALLY, REALLY wants to break
+	 * set policy and have an update at startup */
+	if (!arefresh->priv->force_get_updates_login) {
+		arefresh->priv->force_get_updates_login = TRUE;
+		force = gconf_client_get_bool (arefresh->priv->gconf_client, GPK_CONF_FORCE_GET_UPDATES_LOGIN, NULL);
+		if (force) {
+			egg_debug ("forcing get update due to GConf");
+			gpk_auto_refresh_signal_get_updates (arefresh);
+			return TRUE;
+		}
 	}
 
 	/* try to do both */
@@ -577,7 +584,7 @@ gpk_auto_refresh_init (GpkAutoRefresh *arefresh)
 	arefresh->priv->session_idle = FALSE;
 	arefresh->priv->network_active = FALSE;
 	arefresh->priv->session_delay = FALSE;
-	arefresh->priv->sent_get_updates = FALSE;
+	arefresh->priv->force_get_updates_login = FALSE;
 
 	arefresh->priv->proxy_gs = NULL;
 	arefresh->priv->proxy_gpm = NULL;
diff --git a/src/gpk-common.h b/src/gpk-common.h
index 2586fe0..2c2be24 100644
--- a/src/gpk-common.h
+++ b/src/gpk-common.h
@@ -46,6 +46,7 @@ G_BEGIN_DECLS
 #define GPK_CONF_NOTIFY_UPDATE_COMPLETE_RESTART	"/apps/gnome-packagekit/notify_update_complete_restart"
 #define GPK_CONF_AUTOCOMPLETE			"/apps/gnome-packagekit/autocomplete"
 #define GPK_CONF_SESSION_STARTUP_TIMEOUT	"/apps/gnome-packagekit/session_startup_timeout"
+#define GPK_CONF_FORCE_GET_UPDATES_LOGIN	"/apps/gnome-packagekit/force_get_updates_login"
 #define GPK_CONF_FREQUENCY_GET_UPDATES		"/apps/gnome-packagekit/frequency_get_updates"
 #define GPK_CONF_FREQUENCY_GET_UPGRADES		"/apps/gnome-packagekit/frequency_get_upgrades"
 #define GPK_CONF_FREQUENCY_REFRESH_CACHE	"/apps/gnome-packagekit/frequency_refresh_cache"


Index: gnome-packagekit.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gnome-packagekit/devel/gnome-packagekit.spec,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -r1.51 -r1.52
--- gnome-packagekit.spec	9 Oct 2008 01:27:08 -0000	1.51
+++ gnome-packagekit.spec	10 Oct 2008 17:17:36 -0000	1.52
@@ -4,7 +4,7 @@
 Summary:   GNOME PackageKit Client
 Name:      gnome-packagekit
 Version:   0.3.6
-Release:   3%{?dist}
+Release:   4%{?dist}
 License:   GPLv2+
 Group:     Applications/System
 URL:       http://www.packagekit.org
@@ -14,8 +14,8 @@
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Patch0:    gnome-packagekit-enable-kde.patch
 
-# Upstream: 0f01d00cb0e03262766a2f60327adad91466a0b6
-# Patch1:    pk-use-different-gpk-clients.patch
+# Upstream: 0f4e50d52c95164a1d987c42ca73cc386e51f951
+Patch1:    gpk-dont-get-updates-when-set-to-none.patch
 
 Requires:  gtk2 >= 2.12.0
 Requires:  gnome-icon-theme
@@ -64,7 +64,7 @@
 %prep
 %setup -q
 %patch0 -p1
-#%patch1 -p1
+%patch1 -p1
 
 %build
 %configure --disable-scrollkeeper --disable-schemas-install
@@ -165,6 +165,10 @@
 %{_datadir}/applications/gpk-*.desktop
 
 %changelog
+* Fri Oct 10 2008 Richard Hughes  <rhughes at redhat.com> - 0.3.6-4
+- Add a bugfix from upstream so we don't try to check for updates
+  when we've set to never. Fixes RH#461825.
+
 * Wed Oct  8 2008 Matthias Clasen  <mclasen at redhat.com> - 0.3.6-3
 - Another space-saving hack
 




More information about the scm-commits mailing list