[gnome-packagekit/f14/master] - Switch to using UPower rather than DeviceKit-power - Fix a silly crash in the update viewer. - Res

Richard Hughes rhughes at fedoraproject.org
Thu Sep 2 10:40:34 UTC 2010


commit 6ab3178d29fa34260e07191608fc12f8c3489d7a
Author: Richard Hughes <richard at hughsie.com>
Date:   Thu Sep 2 11:40:54 2010 +0100

    - Switch to using UPower rather than DeviceKit-power
    - Fix a silly crash in the update viewer.
    - Resolves #629390

 fix-update-viewer-crash.patch |   19 +++++++
 gnome-packagekit.spec         |   14 +++++-
 switch-to-upower.patch        |  112 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 144 insertions(+), 1 deletions(-)
---
diff --git a/fix-update-viewer-crash.patch b/fix-update-viewer-crash.patch
new file mode 100644
index 0000000..91d07a5
--- /dev/null
+++ b/fix-update-viewer-crash.patch
@@ -0,0 +1,19 @@
+commit 7a9fde9bc14334c9ee2598f5dc9ea3477d317ad2
+Author: Richard Hughes <richard at hughsie.com>
+Date:   Thu Apr 29 09:10:52 2010 +0100
+
+    Fix an update viewer crash if the GetUpdates call produced any messages
+
+diff --git a/src/gpk-update-viewer.c b/src/gpk-update-viewer.c
+index 29c308d..98d1a9c 100644
+--- a/src/gpk-update-viewer.c
++++ b/src/gpk-update-viewer.c
+@@ -2598,7 +2598,7 @@ gpk_update_viewer_get_updates_cb (PkClient *client, GAsyncResult *res, GpkUpdate
+ 	/* do we have any important messages we need to show? */
+ 	array_messages = pk_results_get_message_array (results);
+ 	for (i=0; i<array_messages->len; i++) {
+-		message = g_ptr_array_index (array, i);
++		message = g_ptr_array_index (array_messages, i);
+ 		g_object_get (message,
+ 			      "type", &message_type,
+ 			      NULL);
diff --git a/gnome-packagekit.spec b/gnome-packagekit.spec
index 7595cd6..90c3705 100644
--- a/gnome-packagekit.spec
+++ b/gnome-packagekit.spec
@@ -3,12 +3,16 @@
 Summary:   Session applications to manage packages
 Name:      gnome-packagekit
 Version:   2.31.91
-Release:   1%{?dist}
+Release:   2%{?dist}
 License:   GPLv2+
 Group:     Applications/System
 URL:       http://www.packagekit.org
 Source0:   http://download.gnome.org/sources/gnome-packagekit/2.31/%{name}-%{version}.tar.gz
 
+# Already upstream
+Patch0:    switch-to-upower.patch
+Patch1:    fix-update-viewer-crash.patch
+
 Requires:  gnome-icon-theme
 Requires:  dbus-x11 >= 1.1.2
 Requires:  PackageKit >= 0.5.0
@@ -66,8 +70,11 @@ Extra GNOME applications for using PackageKit that are not normally needed.
 
 %prep
 %setup -q
+%patch0 -p1 -b .upower
+%patch1 -p1 -b .crash
 
 %build
+autoreconf
 %configure --disable-scrollkeeper --disable-schemas-install
 make %{?_smp_mflags}
 
@@ -195,6 +202,11 @@ update-mime-database %{_datadir}/mime &> /dev/null || :
 %{_datadir}/applications/gpk-service-pack.desktop
 
 %changelog
+* Thu Sep 01 2010 Richard Hughes <rhughes at redhat.com> - 2.31.91-2
+- Switch to using UPower rather than DeviceKit-power
+- Fix a silly crash in the update viewer.
+- Resolves #629390
+
 * Tue Aug 31 2010 Richard Hughes <rhughes at redhat.com> - 2.31.91-1
 - New upstream version.
 - Mostly translation updates.
diff --git a/switch-to-upower.patch b/switch-to-upower.patch
new file mode 100644
index 0000000..e7ae429
--- /dev/null
+++ b/switch-to-upower.patch
@@ -0,0 +1,112 @@
+commit f79e790aaacfb812fee124da0f74a081cfc2cff2
+Author: Richard Hughes <richard at hughsie.com>
+Date:   Wed Apr 28 19:09:49 2010 +0100
+
+    Convert to using libupower-glib, rather than devkit-power-gobject
+
+diff --git a/configure.ac b/configure.ac
+index 87b6cb2..e216f81 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -112,7 +112,7 @@ LIBNOTIFY_REQUIRED=0.4.3
+ UNIQUE_REQUIRED=1.0.0
+ GNOME_MENUS_REQUIRED=2.24.1
+ GIO_REQUIRED=2.18.0
+-DEVKIT_POWER_REQUIRED=007
++UPOWER_REQUIRED=0.9.0
+ CANBERRA_REQUIRED=0.10
+ 
+ dnl ---------------------------------------------------------------------------
+@@ -138,8 +138,8 @@ PKG_CHECK_MODULES(GNOME_MENUS, \
+  libgnome-menu >= $GNOME_MENUS_REQUIRED)
+ PKG_CHECK_MODULES(UNIQUE, \
+  unique-1.0 >= $UNIQUE_REQUIRED)
+-PKG_CHECK_MODULES(DEVKIT, [
+- devkit-power-gobject >= $DEVKIT_POWER_REQUIRED])
++PKG_CHECK_MODULES(UPOWER, [
++ upower-glib >= $UPOWER_REQUIRED])
+ PKG_CHECK_MODULES(CANBERRA, libcanberra-gtk >= $CANBERRA_REQUIRED)
+ PKG_CHECK_MODULES(X11, x11)
+ 
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 9590594..3c4507d 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -14,10 +14,10 @@ INCLUDES =						\
+ 	$(GTK_CFLAGS)					\
+ 	$(GUDEV_CFLAGS)					\
+ 	$(GNOME_MENUS_CFLAGS)				\
+-	-DI_KNOW_THE_DEVICEKIT_POWER_API_IS_SUBJECT_TO_CHANGE \
++	-DI_KNOW_THE_UPOWER_API_IS_SUBJECT_TO_CHANGE	\
+ 	-DI_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE	\
+ 	-DG_UDEV_API_IS_SUBJECT_TO_CHANGE		\
+-	$(DEVKIT_CFLAGS)				\
++	$(UPOWER_CFLAGS)				\
+ 	$(CANBERRA_CFLAGS)				\
+ 	-DBINDIR=\"$(bindir)\"			 	\
+ 	-DDATADIR=\"$(datadir)\"			\
+@@ -103,7 +103,7 @@ shared_LIBS =						\
+ 	$(PACKAGEKIT_LIBS)				\
+ 	$(UNIQUE_LIBS)					\
+ 	$(GNOME_MENUS_LIBS)				\
+-	$(DEVKIT_LIBS)					\
++	$(UPOWER_LIBS)					\
+ 	$(CANBERRA_LIBS)				\
+ 	$(X11_LIBS)					\
+ 	$(NULL)
+diff --git a/src/gpk-auto-refresh.c b/src/gpk-auto-refresh.c
+index bf7f710..06d4218 100644
+--- a/src/gpk-auto-refresh.c
++++ b/src/gpk-auto-refresh.c
+@@ -35,7 +35,7 @@
+ #include <glib/gi18n.h>
+ #include <gconf/gconf-client.h>
+ #include <packagekit-glib2/packagekit.h>
+-#include <devkit-power-gobject/devicekit-power.h>
++#include <libupower-glib/upower.h>
+ 
+ #include "egg-debug.h"
+ #include "egg-string.h"
+@@ -66,7 +66,7 @@ struct GpkAutoRefreshPrivate
+ 	gboolean		 force_get_updates_login;
+ 	guint			 force_get_updates_login_timeout_id;
+ 	guint			 timeout_id;
+-	DkpClient		*client;
++	UpClient		*client;
+ 	GConfClient		*gconf_client;
+ 	GpkSession		*session;
+ 	PkControl		*control;
+@@ -509,14 +509,14 @@ gpk_auto_refresh_timeout_cb (gpointer user_data)
+  * gpk_auto_refresh_client_changed_cb:
+  **/
+ static void
+-gpk_auto_refresh_client_changed_cb (DkpClient *client, GpkAutoRefresh *arefresh)
++gpk_auto_refresh_client_changed_cb (UpClient *client, GpkAutoRefresh *arefresh)
+ {
+ 	gboolean on_battery;
+ 
+ 	g_return_if_fail (GPK_IS_AUTO_REFRESH (arefresh));
+ 
+ 	/* get the on-battery state */
+-	on_battery = dkp_client_on_battery (arefresh->priv->client);
++	on_battery = up_client_get_on_battery (arefresh->priv->client);
+ 	if (on_battery == arefresh->priv->on_battery) {
+ 		egg_debug ("same state as before, ignoring");
+ 		return;
+@@ -590,13 +590,13 @@ gpk_auto_refresh_init (GpkAutoRefresh *arefresh)
+ 	/* get network state */
+ 	pk_control_get_properties_async (arefresh->priv->control, NULL, (GAsyncReadyCallback) gpk_auto_refresh_get_properties_cb, arefresh);
+ 
+-	/* use a DkpClient */
+-	arefresh->priv->client = dkp_client_new ();
++	/* use a UpClient */
++	arefresh->priv->client = up_client_new ();
+ 	g_signal_connect (arefresh->priv->client, "changed",
+ 			  G_CALLBACK (gpk_auto_refresh_client_changed_cb), arefresh);
+ 
+ 	/* get the battery state */
+-	arefresh->priv->on_battery = dkp_client_on_battery (arefresh->priv->client);
++	arefresh->priv->on_battery = up_client_get_on_battery (arefresh->priv->client);
+ 	egg_debug ("setting on battery %i", arefresh->priv->on_battery);
+ 
+ 	/* use gnome-session for the idle detection */


More information about the scm-commits mailing list