rpms/gnome-packagekit/devel .cvsignore, 1.48, 1.49 gnome-packagekit-port-to-polkit1.patch, 1.1, 1.2 gnome-packagekit.spec, 1.89, 1.90 sources, 1.49, 1.50

Richard Hughes rhughes at fedoraproject.org
Thu Jun 25 09:42:44 UTC 2009


Author: rhughes

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

Modified Files:
	.cvsignore gnome-packagekit-port-to-polkit1.patch 
	gnome-packagekit.spec sources 
Log Message:
* Thu Jun 25 2009 Richard Hughes  <rhughes at redhat.com> - 2.27.3-0.3.20090625git
- Update to latest git master snapshot



Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/gnome-packagekit/devel/.cvsignore,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -p -r1.48 -r1.49
--- .cvsignore	16 Jun 2009 10:34:51 -0000	1.48
+++ .cvsignore	25 Jun 2009 09:42:13 -0000	1.49
@@ -1 +1 @@
-gnome-packagekit-2.27.3-20090616.tar.gz
+gnome-packagekit-2.27.3-20090625.tar.gz

gnome-packagekit-port-to-polkit1.patch:

Index: gnome-packagekit-port-to-polkit1.patch
===================================================================
RCS file: /cvs/pkgs/rpms/gnome-packagekit/devel/gnome-packagekit-port-to-polkit1.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- gnome-packagekit-port-to-polkit1.patch	16 Jun 2009 12:02:59 -0000	1.1
+++ gnome-packagekit-port-to-polkit1.patch	25 Jun 2009 09:42:13 -0000	1.2
@@ -1,5 +1,5 @@
 diff --git a/configure.ac b/configure.ac
-index 2b0fedd..ac96828 100644
+index 9f0eadb..e6d8132 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -88,7 +88,6 @@ DBUS_REQUIRED=1.1.2
@@ -50,7 +50,7 @@ index 2b8965e..e287290 100644
  	$(DEVKIT_LIBS)					\
  	$(CANBERRA_LIBS)				\
 diff --git a/src/gpk-application.c b/src/gpk-application.c
-index 2760d52..b6b2adf 100644
+index 501c55c..730c544 100644
 --- a/src/gpk-application.c
 +++ b/src/gpk-application.c
 @@ -28,7 +28,6 @@
@@ -62,7 +62,7 @@ index 2760d52..b6b2adf 100644
  
  #include "egg-debug.h"
 diff --git a/src/gpk-common.c b/src/gpk-common.c
-index e5561a9..16f73e2 100644
+index 101b752..6bda9de 100644
 --- a/src/gpk-common.c
 +++ b/src/gpk-common.c
 @@ -29,7 +29,6 @@
@@ -242,7 +242,7 @@ index 430edac..74231dc 100644
  
  	g_object_unref (G_OBJECT (proxy));
 diff --git a/src/gpk-dbus-task.c b/src/gpk-dbus-task.c
-index ce779b9..57ea3a5 100644
+index 15115d3..e90076f 100644
 --- a/src/gpk-dbus-task.c
 +++ b/src/gpk-dbus-task.c
 @@ -31,7 +31,6 @@
@@ -254,7 +254,7 @@ index ce779b9..57ea3a5 100644
  #include <packagekit-glib/packagekit.h>
  
 diff --git a/src/gpk-dbus.c b/src/gpk-dbus.c
-index 797fa40..c2c762b 100644
+index 797fa40..3991b23 100644
 --- a/src/gpk-dbus.c
 +++ b/src/gpk-dbus.c
 @@ -38,8 +38,6 @@
@@ -270,22 +270,22 @@ index 797fa40..c2c762b 100644
  	gint			 timeout_tmp;
  	GpkX11			*x11;
  	GPtrArray		*array;
-+	DBusGConnection		*connection;
-+	DBusGProxy		*proxy_pid;
++	DBusGProxy		*proxy_session_pid;
++	DBusGProxy		*proxy_system_pid;
  };
  
  G_DEFINE_TYPE (GpkDbus, gpk_dbus, G_TYPE_OBJECT)
-@@ -103,52 +103,67 @@ gpk_dbus_error_get_type (void)
+@@ -103,52 +103,117 @@ gpk_dbus_error_get_type (void)
  }
  
  /**
 - * gpk_dbus_get_exec_for_sender:
-+ * gpk_dbus_get_pid:
++ * gpk_dbus_get_pid_session:
   **/
 -static gchar *
 -gpk_dbus_get_exec_for_sender (const gchar *sender)
 +static guint
-+gpk_dbus_get_pid (GpkDbus *dbus, const gchar *sender)
++gpk_dbus_get_pid_session (GpkDbus *dbus, const gchar *sender)
  {
 -	pid_t pid;
 -	gchar exec[128];
@@ -306,27 +306,45 @@ index 797fa40..c2c762b 100644
 -	if (caller == NULL) {
 -		egg_warning ("cannot get caller from sender %s: %s", sender, dbus_error.message);
 -		dbus_error_free (&dbus_error);
--		goto out;
--	}
--
--	ret = polkit_caller_get_pid (caller, &pid);
-+	guint pid;
++	guint pid = G_MAXUINT;
 +	gboolean ret;
 +	GError *error = NULL;
 +
-+	g_return_val_if_fail (PK_IS_DBUS (dbus), G_MAXUINT);
-+	g_return_val_if_fail (dbus->priv->proxy_pid != NULL, G_MAXUINT);
-+	g_return_val_if_fail (sender != NULL, G_MAXUINT);
++	/* get pid from DBus (quite slow) */
++	ret = dbus_g_proxy_call (dbus->priv->proxy_session_pid, "GetConnectionUnixProcessID", &error,
++				 G_TYPE_STRING, sender,
++				 G_TYPE_INVALID,
++				 G_TYPE_UINT, &pid,
++				 G_TYPE_INVALID);
++	if (!ret) {
++		egg_debug ("failed to get pid from session: %s", error->message);
++		g_error_free (error);
+ 		goto out;
+ 	}
++out:
++	return pid;
++}
+ 
+-	ret = polkit_caller_get_pid (caller, &pid);
++/**
++ * gpk_dbus_get_pid_system:
++ **/
++static guint
++gpk_dbus_get_pid_system (GpkDbus *dbus, const gchar *sender)
++{
++	guint pid = G_MAXUINT;
++	gboolean ret;
++	GError *error = NULL;
 +
 +	/* get pid from DBus (quite slow) */
-+	ret = dbus_g_proxy_call (dbus->priv->proxy_pid, "GetConnectionUnixProcessID", &error,
++	ret = dbus_g_proxy_call (dbus->priv->proxy_system_pid, "GetConnectionUnixProcessID", &error,
 +				 G_TYPE_STRING, sender,
 +				 G_TYPE_INVALID,
 +				 G_TYPE_UINT, &pid,
 +				 G_TYPE_INVALID);
  	if (!ret) {
 -		egg_warning ("cannot get pid from sender %p", sender);
-+		egg_error ("failed to get pid: %s", error->message);
++		egg_debug ("failed to get pid from system: %s", error->message);
 +		g_error_free (error);
  		goto out;
  	}
@@ -334,10 +352,45 @@ index 797fa40..c2c762b 100644
 +	return pid;
 +}
 +
++/**
++ * gpk_dbus_get_pid:
++ **/
++static guint
++gpk_dbus_get_pid (GpkDbus *dbus, const gchar *sender)
++{
++	guint pid;
++
++	g_return_val_if_fail (PK_IS_DBUS (dbus), G_MAXUINT);
++	g_return_val_if_fail (dbus->priv->proxy_session_pid != NULL, G_MAXUINT);
++	g_return_val_if_fail (dbus->priv->proxy_system_pid != NULL, G_MAXUINT);
++	g_return_val_if_fail (sender != NULL, G_MAXUINT);
  
 -	retval = polkit_sysdeps_get_exe_for_pid (pid, exec, 128);
 -	if (retval == -1) {
 -		egg_warning ("cannot get exec for pid %i", pid);
++	/* check system bus first */
++	pid = gpk_dbus_get_pid_system (dbus, sender);
++	if (pid != G_MAXUINT)
+ 		goto out;
+-	}
+ 
+-	/* make a copy */
+-	sender_exe = g_strdup (exec);
++	/* and then session bus */
++	pid = gpk_dbus_get_pid_session (dbus, sender);
++	if (pid != G_MAXUINT)
++		goto out;
+ 
++	/* should be impossible */
++	egg_warning ("could not find pid!");
+ out:
+-	if (caller != NULL)
+-		polkit_caller_unref (caller);
+-	return sender_exe;
++	return pid;
++}
++
++
 +/**
 + * gpk_dbus_get_exec_for_sender:
 + **/
@@ -357,12 +410,9 @@ index 797fa40..c2c762b 100644
 +	pid = gpk_dbus_get_pid (dbus, sender);
 +	if (pid == G_MAXUINT) {
 +		egg_warning ("failed to get PID");
- 		goto out;
- 	}
- 
--	/* make a copy */
--	sender_exe = g_strdup (exec);
--
++		goto out;
++	}
++
 +	/* get command line from proc */
 +	filename = g_strdup_printf ("/proc/%i/cmdline", pid);
 +	ret = g_file_get_contents (filename, &cmdline, NULL, &error);
@@ -370,46 +420,62 @@ index 797fa40..c2c762b 100644
 +		egg_warning ("failed to get cmdline: %s", error->message);
 +		g_error_free (error);
 +	}
- out:
--	if (caller != NULL)
--		polkit_caller_unref (caller);
--	return sender_exe;
++out:
 +	g_free (filename);
 +	return cmdline;
  }
  
  /**
-@@ -288,7 +303,7 @@ gpk_dbus_create_task (GpkDbus *dbus, guint32 xid, const gchar *interaction, DBus
+@@ -288,8 +353,9 @@ gpk_dbus_create_task (GpkDbus *dbus, guint32 xid, const gchar *interaction, DBus
  
  	/* get the program name and set */
  	sender = dbus_g_method_get_sender (context);
 -	exec = gpk_dbus_get_exec_for_sender (sender);
+-	gpk_dbus_task_set_exec (task, exec);
 +	exec = gpk_dbus_get_exec_for_sender (dbus, sender);
- 	gpk_dbus_task_set_exec (task, exec);
++	if (exec != NULL)
++		gpk_dbus_task_set_exec (task, exec);
  
  	/* unref on delete */
-@@ -426,6 +441,11 @@ gpk_dbus_init (GpkDbus *dbus)
+ 	//g_signal_connect...
+@@ -421,11 +487,26 @@ gpk_dbus_class_init (GpkDbusClass *klass)
+ static void
+ gpk_dbus_init (GpkDbus *dbus)
+ {
++	DBusGConnection *connection;
++
+ 	dbus->priv = GPK_DBUS_GET_PRIVATE (dbus);
+ 	dbus->priv->timeout_tmp = -1;
  	dbus->priv->gconf_client = gconf_client_get_default ();
  	dbus->priv->array = g_ptr_array_new ();
  	dbus->priv->x11 = gpk_x11_new ();
-+	dbus->priv->connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, NULL);
-+	dbus->priv->proxy_pid = dbus_g_proxy_new_for_name_owner (dbus->priv->connection,
++
++	/* find out PIDs on the session bus */
++	connection = dbus_g_bus_get (DBUS_BUS_SESSION, NULL);
++	dbus->priv->proxy_session_pid = dbus_g_proxy_new_for_name_owner (connection,
++								 "org.freedesktop.DBus",
++								 "/org/freedesktop/DBus/Bus",
++								 "org.freedesktop.DBus", NULL);
++	/* find out PIDs on the system bus */
++	connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, NULL);
++	dbus->priv->proxy_system_pid = dbus_g_proxy_new_for_name_owner (connection,
 +								 "org.freedesktop.DBus",
 +								 "/org/freedesktop/DBus/Bus",
 +								 "org.freedesktop.DBus", NULL);
  }
  
  /**
-@@ -444,6 +464,7 @@ gpk_dbus_finalize (GObject *object)
+@@ -444,6 +525,8 @@ gpk_dbus_finalize (GObject *object)
  	g_ptr_array_free (dbus->priv->array, TRUE);
  	g_object_unref (dbus->priv->gconf_client);
  	g_object_unref (dbus->priv->x11);
-+	g_object_unref (dbus->priv->proxy_pid);
++	g_object_unref (dbus->priv->proxy_session_pid);
++	g_object_unref (dbus->priv->proxy_system_pid);
  
  	G_OBJECT_CLASS (gpk_dbus_parent_class)->finalize (object);
  }
 diff --git a/src/gpk-watch.c b/src/gpk-watch.c
-index cfbbac5..ae986f2 100644
+index 6a25c9d..cd5a1b1 100644
 --- a/src/gpk-watch.c
 +++ b/src/gpk-watch.c
 @@ -37,7 +37,6 @@
@@ -427,8 +493,8 @@ index cfbbac5..ae986f2 100644
 -	PolKitGnomeAction	*restart_action;
  	guint			 set_proxy_timeout;
  	gchar			*error_details;
- };
-@@ -794,15 +792,6 @@ gpk_watch_popup_menu_cb (GtkStatusIcon *status_icon, guint button, guint32 times
+ 	gboolean		 hide_warning;
+@@ -786,15 +784,6 @@ gpk_watch_popup_menu_cb (GtkStatusIcon *status_icon, guint button, guint32 times
  }
  
  /**
@@ -444,7 +510,7 @@ index cfbbac5..ae986f2 100644
   * gpk_watch_menu_show_messages_cb:
   **/
  static void
-@@ -1233,6 +1222,15 @@ gpk_watch_menu_log_out_cb (GtkMenuItem *item, gpointer data)
+@@ -1226,6 +1215,15 @@ gpk_watch_menu_log_out_cb (GtkMenuItem *item, gpointer data)
  }
  
  /**
@@ -460,7 +526,7 @@ index cfbbac5..ae986f2 100644
   * gpk_watch_activate_status_cb:
   * @button: Which buttons are pressed
   *
-@@ -1269,6 +1267,7 @@ gpk_watch_activate_status_cb (GtkStatusIcon *status_icon, GpkWatch *watch)
+@@ -1262,6 +1260,7 @@ gpk_watch_activate_status_cb (GtkStatusIcon *status_icon, GpkWatch *watch)
  
  	/* log out session */
  	if (watch->priv->restart == PK_RESTART_ENUM_SESSION) {
@@ -468,7 +534,7 @@ index cfbbac5..ae986f2 100644
  		widget = gtk_image_menu_item_new_with_mnemonic (_("_Log out"));
  		image = gtk_image_new_from_icon_name ("system-log-out", GTK_ICON_SIZE_MENU);
  		gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (widget), image);
-@@ -1280,7 +1279,12 @@ gpk_watch_activate_status_cb (GtkStatusIcon *status_icon, GpkWatch *watch)
+@@ -1273,7 +1272,12 @@ gpk_watch_activate_status_cb (GtkStatusIcon *status_icon, GpkWatch *watch)
  
  	/* restart computer */
  	if (watch->priv->restart == PK_RESTART_ENUM_SYSTEM) {
@@ -482,7 +548,7 @@ index cfbbac5..ae986f2 100644
  		gtk_menu_shell_append (GTK_MENU_SHELL (menu), widget);
  		show_hide = TRUE;
  	}
-@@ -1573,9 +1577,6 @@ gpk_watch_button_cancel_cb (GtkWidget *widget, GpkWatch *watch)
+@@ -1566,9 +1570,6 @@ gpk_watch_button_cancel_cb (GtkWidget *widget, GpkWatch *watch)
  static void
  gpk_watch_init (GpkWatch *watch)
  {
@@ -492,7 +558,7 @@ index cfbbac5..ae986f2 100644
  	watch->priv = GPK_WATCH_GET_PRIVATE (watch);
  	watch->priv->error_details = NULL;
  	watch->priv->notification_cached_messages = NULL;
-@@ -1639,23 +1640,6 @@ gpk_watch_init (GpkWatch *watch)
+@@ -1633,23 +1634,6 @@ gpk_watch_init (GpkWatch *watch)
  	if (pk_connection_valid (watch->priv->pconnection))
  		pk_connection_changed_cb (watch->priv->pconnection, TRUE, watch);
  
@@ -516,7 +582,7 @@ index cfbbac5..ae986f2 100644
  	/* watch proxy keys */
  	gconf_client_add_dir (watch->priv->gconf_client, GPK_WATCH_GCONF_PROXY_HTTP,
  			      GCONF_CLIENT_PRELOAD_NONE, NULL);
-@@ -1704,7 +1688,6 @@ gpk_watch_finalize (GObject *object)
+@@ -1698,7 +1682,6 @@ gpk_watch_finalize (GObject *object)
  	g_object_unref (watch->priv->control);
  	g_object_unref (watch->priv->pconnection);
  	g_object_unref (watch->priv->gconf_client);


Index: gnome-packagekit.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gnome-packagekit/devel/gnome-packagekit.spec,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -p -r1.89 -r1.90
--- gnome-packagekit.spec	16 Jun 2009 12:02:59 -0000	1.89
+++ gnome-packagekit.spec	25 Jun 2009 09:42:13 -0000	1.90
@@ -8,14 +8,14 @@
 %define devicekit_version		003
 %define devicekit_power_version		007
 %define libcanberra_version		0.10
-%define alphatag			20090616
+%define alphatag			20090625
 
 %{!?python_sitelib: %define python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
 
 Summary:   Session applications to manage packages
 Name:      gnome-packagekit
 Version:   2.27.3
-Release:   0.2.%{?alphatag}git%{?dist}
+Release:   0.3.%{?alphatag}git%{?dist}
 #Release:   1%{?dist}
 License:   GPLv2+
 Group:     Applications/System
@@ -228,6 +228,9 @@ update-mime-database %{_datadir}/mime &>
 %{_datadir}/applications/gpk-service-pack.desktop
 
 %changelog
+* Thu Jun 25 2009 Richard Hughes  <rhughes at redhat.com> - 2.27.3-0.3.20090625git
+- Update to latest git master snapshot
+
 * Tue Jun 16 2009 Richard Hughes  <rhughes at redhat.com> - 2.27.3-0.2.20090616git
 - Apply a patch to convert to the PolKit1 API.
 - Do autoreconf as the polkit patch is pretty invasive


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/gnome-packagekit/devel/sources,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -p -r1.49 -r1.50
--- sources	16 Jun 2009 10:34:52 -0000	1.49
+++ sources	25 Jun 2009 09:42:13 -0000	1.50
@@ -1 +1 @@
-03eca1c84502b83e8d64d84b94730636  gnome-packagekit-2.27.3-20090616.tar.gz
+dee4ce4f0087a7711e08bf0a79e35d34  gnome-packagekit-2.27.3-20090625.tar.gz




More information about the fedora-extras-commits mailing list