[Pkg-utopia-commits] r242 - packages/unstable/gnome-volume-manager/debian/patches

Sjoerd Simons sjoerd@costa.debian.org
Wed, 22 Jun 2005 09:22:14 +0000


Author: sjoerd
Date: 2005-06-22 09:22:13 +0000 (Wed, 22 Jun 2005)
New Revision: 242

Modified:
   packages/unstable/gnome-volume-manager/debian/patches/00_set_defaults.patch
   packages/unstable/gnome-volume-manager/debian/patches/03_browse_fixup.patch
   packages/unstable/gnome-volume-manager/debian/patches/11_dbus_reconnect_on_bus_exit.patch
   packages/unstable/gnome-volume-manager/debian/patches/30_26_kernel_hint.patch
Log:
Adapted to new gvm upstream by martin

Modified: packages/unstable/gnome-volume-manager/debian/patches/00_set_defaults.patch
===================================================================
--- packages/unstable/gnome-volume-manager/debian/patches/00_set_defaults.patch	2005-06-22 08:06:14 UTC (rev 241)
+++ packages/unstable/gnome-volume-manager/debian/patches/00_set_defaults.patch	2005-06-22 09:22:13 UTC (rev 242)
@@ -1,6 +1,6 @@
-diff -ruN gnome-volume-manager-1.2.1-old/gnome-volume-manager.schemas.in gnome-volume-manager-1.2.1/gnome-volume-manager.schemas.in
---- gnome-volume-manager-1.2.1-old/gnome-volume-manager.schemas.in	2005-03-30 23:05:15.000000000 +0200
-+++ gnome-volume-manager-1.2.1/gnome-volume-manager.schemas.in	2005-04-29 12:30:46.000000000 +0200
+diff -ruN gnome-volume-manager-1.3.1-old/gnome-volume-manager.schemas.in gnome-volume-manager-1.3.1/gnome-volume-manager.schemas.in
+--- gnome-volume-manager-1.3.1-old/gnome-volume-manager.schemas.in	2005-03-31 18:27:06.000000000 +0200
++++ gnome-volume-manager-1.3.1/gnome-volume-manager.schemas.in	2005-04-13 14:06:19.798155728 +0200
 @@ -29,7 +29,7 @@
          <key>/schemas/desktop/gnome/volume_manager/autobrowse</key>
          <applyto>/desktop/gnome/volume_manager/autobrowse</applyto>

Modified: packages/unstable/gnome-volume-manager/debian/patches/03_browse_fixup.patch
===================================================================
--- packages/unstable/gnome-volume-manager/debian/patches/03_browse_fixup.patch	2005-06-22 08:06:14 UTC (rev 241)
+++ packages/unstable/gnome-volume-manager/debian/patches/03_browse_fixup.patch	2005-06-22 09:22:13 UTC (rev 242)
@@ -1,7 +1,7 @@
-diff -ruN gnome-volume-manager-1.1.3-old/src/manager.c gnome-volume-manager-1.1.3/src/manager.c
---- gnome-volume-manager-1.1.3-old/src/manager.c	2005-02-01 07:01:05.000000000 +0100
-+++ gnome-volume-manager-1.1.3/src/manager.c	2005-02-08 13:13:08.139265849 +0100
-@@ -256,31 +256,32 @@
+diff -ruN gnome-volume-manager-1.3.1-old/src/manager.c gnome-volume-manager-1.3.1/src/manager.c
+--- gnome-volume-manager-1.3.1-old/src/manager.c	2005-03-31 18:27:07.000000000 +0200
++++ gnome-volume-manager-1.3.1/src/manager.c	2005-04-13 14:08:36.049442384 +0200
+@@ -257,31 +257,32 @@
  /*
   * gvm_check_dvd - is this a Video DVD?  If so, do something about it.
   *
@@ -42,7 +42,7 @@
  }
  
  /*
-@@ -288,7 +289,8 @@
+@@ -289,7 +290,8 @@
   * unit from a digital camera (e.g., a compact flash card).  If it is, then
   * ask the user if he wants to import the photos.
   *
@@ -52,7 +52,7 @@
   *
   * FIXME: Should probably not prompt the user and just do it automatically.
   *        This now makes sense, as gphoto added an import mode.
-@@ -306,7 +308,6 @@
+@@ -308,7 +310,6 @@
  	if (!g_file_test (dcim_path, G_FILE_TEST_IS_DIR))
  		goto out;
  
@@ -60,8 +60,8 @@
  	dbg ("Photos detected: %s\n", dcim_path);
  
  	/* add the "content.photos" capability to this device */
-@@ -314,6 +315,7 @@
- 		warn ("failed to set content.photos on %s\n", device);
+@@ -322,6 +323,7 @@
+ 	}
  
  	if (config.autophoto) {
 +		retval=TRUE;

Modified: packages/unstable/gnome-volume-manager/debian/patches/11_dbus_reconnect_on_bus_exit.patch
===================================================================
--- packages/unstable/gnome-volume-manager/debian/patches/11_dbus_reconnect_on_bus_exit.patch	2005-06-22 08:06:14 UTC (rev 241)
+++ packages/unstable/gnome-volume-manager/debian/patches/11_dbus_reconnect_on_bus_exit.patch	2005-06-22 09:22:13 UTC (rev 242)
@@ -1,53 +1,55 @@
-Files gnome-volume-manager-1.2.0-old/src/.swp and gnome-volume-manager-1.2.0/src/.swp differ
-diff -ruN gnome-volume-manager-1.2.0-old/src/manager.c gnome-volume-manager-1.2.0/src/manager.c
---- gnome-volume-manager-1.2.0-old/src/manager.c	2005-04-11 21:17:39.000000000 +0200
-+++ gnome-volume-manager-1.2.0/src/manager.c	2005-04-11 21:40:57.000000000 +0200
-@@ -51,6 +51,7 @@
+--- gnome-volume-manager-1.3.1.old/src/manager.c	
++++ gnome-volume-manager-1.3.1/src/manager.c
+@@ -50,7 +50,8 @@
+ #define NAUTILUS_COMMAND	 BIN_NAUTILUS" -n --no-desktop %m"
  
  static struct gvm_configuration config;
- static LibHalContext *hal_ctx;
-+static DBusConnection *dbus_ctx;
+-static LibHalContext *hal_ctx;
++static LibHalContext *hal_ctx = NULL;
++static DBusConnection *dbus_connection = NULL;
  
  /** List of UDI's for volumes mounted by g-v-m that we need to apply policy to*/
  static GSList *mounted_volumes_policy_queue = NULL;
-@@ -58,6 +59,9 @@
- /** List of UDI's of all volumes mounted during the lifetime of the program */
- static GSList *all_mounted_volumes = NULL;
- 
-+static LibHalFunctions * gvm_return_hal_functions ();
-+static LibHalContext * gvm_do_hal_init (LibHalFunctions *functions);
-+
- /*
-  * gvm_load_config - synchronize gconf => config structure
-  */
-@@ -899,6 +903,59 @@
+@@ -969,6 +970,73 @@
  {
  }
  
-+/** Invoked by GLib in response to a D-BUS disconnect event.
++static LibHalContext * gvm_do_hal_init ();
++
++/** Invoked by gvm_do_filter_dbus_msg in response to a D-BUS disconnect event.
 + *
 + * @param  data                 Context pointer
++ * @return true if it should be tried again, false if success or failure.
 + */
 +static gboolean
 +gvm_reconnect_to_hal (gpointer data __attribute__((__unused__)))
 +{
-+	static unsigned int retries = 0;
++       static unsigned int retries = 0;
++       DBusError error;
 +
-+	g_message ("Trying a reconnect ...");
-+	hal_ctx = gvm_do_hal_init (gvm_return_hal_functions ());
-+	if (hal_ctx != NULL) {
-+		g_message ("Reconnected OK.");
-+		retries = 0;
-+		return FALSE;
-+	}
++       dbg ("Trying a reconnect ...\n");
++       hal_ctx = gvm_do_hal_init ();
++       if (hal_ctx != NULL) {
++               dbg ("Reconnected OK.\n");
++               retries = 0;
++               return FALSE;
++       } else if (dbus_connection){
++               /* shut down dbus connection to try it again */
++               dbus_connection_unref (dbus_connection);
++               dbus_connection = NULL;
++       }
 +
-+	/* Retry later if it failed. */
-+	if (retries++ < 100)
-+		return TRUE;
++       /* Retry later if it failed. */
++       if (retries++ < 100)
++               return TRUE;
 +
-+	/* Too many retries; clean up and bail. */
-+	gtk_main_quit ();
-+	return FALSE;
++       /* Too many retries; clean up and bail. */
++       warn("gvm_reconnect_to_hal: no reconnection after 100 retries, exiting\n");
++       libhal_ctx_shutdown (hal_ctx, &error);
++       libhal_ctx_free (hal_ctx);
++       hal_ctx = NULL;
++       gtk_main_quit ();
++       return FALSE;
 +}
 +
 +/** Invoked by D-BUS to filter messages.
@@ -61,89 +63,54 @@
 +                        DBusMessage *message,
 +                        void *user_data __attribute__((__unused__)))
 +{
-+	if (dbus_message_is_signal (message,
-+	                            DBUS_INTERFACE_ORG_FREEDESKTOP_LOCAL,
-+	                            "Disconnected")) {
-+		g_timeout_add(500, gvm_reconnect_to_hal, NULL);
-+		if (hal_ctx) {
-+		  hal_shutdown (hal_ctx);
-+		}
-+		hal_ctx = NULL;
-+		dbus_connection_unref (dbus_ctx);
-+		dbus_ctx = NULL;
-+		return DBUS_HANDLER_RESULT_HANDLED;
-+	}
-+	else
-+		return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
++       DBusError error;
++       
++       if (dbus_message_is_signal (message,
++                                   DBUS_INTERFACE_LOCAL,
++                                   "Disconnected")) {
++               dbg("gvm_do_filter_dbus_msg: received Disconnected message\n");
++               g_timeout_add(500, gvm_reconnect_to_hal, NULL);
++               libhal_ctx_shutdown (hal_ctx, &error);
++               libhal_ctx_free (hal_ctx);
++               hal_ctx = NULL;
++               dbus_connection_unref (dbus_connection);
++               dbus_connection = NULL;
++               return DBUS_HANDLER_RESULT_HANDLED;
++       }
++       else
++               return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
 +}
 +
- /** Invoked by libhal for integration with our mainloop. 
+ /** Integrate a dbus mainloop. 
   *
   *  @param  ctx                 LibHal context
-@@ -908,7 +965,12 @@
- hal_mainloop_integration (LibHalContext *ctx __attribute__((__unused__)),
- 			  DBusConnection * dbus_connection)
+@@ -980,14 +1048,15 @@
+ hal_mainloop_integration (LibHalContext *ctx, 
+ 			   DBusError *error)
  {
-+	dbus_connection_set_exit_on_disconnect (dbus_connection, FALSE);
- 	dbus_connection_setup_with_g_main (dbus_connection, NULL);
+-	DBusConnection *dbus_connection;
+-
+ 	dbus_connection = dbus_bus_get (DBUS_BUS_SYSTEM, error);
+ 
+ 	if (dbus_error_is_set (error))
+ 		return FALSE;
 +
-+	dbus_ctx = dbus_connection;
-+	dbus_connection_add_filter (dbus_connection, gvm_do_filter_dbus_msg,
-+	                            NULL, NULL);
- }
++        dbus_connection_set_exit_on_disconnect (dbus_connection, FALSE);
+ 	
+         dbus_connection_setup_with_g_main (dbus_connection, NULL);
++        dbus_connection_add_filter (dbus_connection, gvm_do_filter_dbus_msg, NULL, NULL);
  
- /** Internal HAL initialization function
-@@ -1029,7 +1091,12 @@
- 	char *device_file;
+ 	libhal_ctx_set_dbus_connection (ctx, dbus_connection);
+ 	
+@@ -1154,6 +1223,11 @@
  	char *udi;
+ 	DBusError error;
  
--	dbg ("unmounting all volumes that we saw mounted in our life\n");
-+  if (ctx == NULL) {
-+    dbg("No hal connection! can't unmount volumes");
-+    return;
-+  } else {
-+	  dbg ("unmounting all volumes that we saw mounted in our life\n");
-+  }
- 
- 	for (i = all_mounted_volumes; i != NULL; i = g_slist_next (i)) {
- 
-@@ -1101,17 +1168,23 @@
- 	gtk_main_quit ();
- }
- 
-+static LibHalFunctions *
-+gvm_return_hal_functions ()
-+{
-+	static LibHalFunctions hf = { hal_mainloop_integration,
-+	                              hal_device_added,
-+	                              hal_device_removed,
-+	                              hal_device_new_capability,
-+	                              hal_device_lost_capability,
-+	                              hal_property_modified,
-+	                              hal_device_condition };
-+	return &hf;
-+}
++        if (ctx == NULL) {
++            warn("unmount_all: No hal connection! can't unmount volumes\n");
++            return;
++        }
 +
- int
- main (int argc, char *argv[])
- {
- 	GnomeClient *client;
--	LibHalFunctions hal_functions = { hal_mainloop_integration,
--					  hal_device_added,
--					  hal_device_removed,
--					  hal_device_new_capability,
--					  hal_device_lost_capability,
--					  hal_property_modified,
--					  hal_device_condition };
- 
- 	gnome_program_init (PACKAGE, VERSION, LIBGNOMEUI_MODULE,
- 			    argc, argv, GNOME_PARAM_NONE);
-@@ -1132,7 +1205,7 @@
- 	gtk_signal_connect (GTK_OBJECT (client), "die",
- 			    GTK_SIGNAL_FUNC (gvm_die), NULL);
- 
--	hal_ctx = gvm_do_hal_init (&hal_functions);
-+	hal_ctx = gvm_do_hal_init (gvm_return_hal_functions ());
- 	if (!hal_ctx)
- 		return 1;
- 
+ 	dbg ("unmounting all volumes that we saw mounted in our life\n");
+ 	dbus_error_init (&error);
+ 	for (i = all_mounted_volumes; i != NULL; i = g_slist_next (i)) {

Modified: packages/unstable/gnome-volume-manager/debian/patches/30_26_kernel_hint.patch
===================================================================
--- packages/unstable/gnome-volume-manager/debian/patches/30_26_kernel_hint.patch	2005-06-22 08:06:14 UTC (rev 241)
+++ packages/unstable/gnome-volume-manager/debian/patches/30_26_kernel_hint.patch	2005-06-22 09:22:13 UTC (rev 242)
@@ -1,13 +1,13 @@
-diff -ruN gnome-volume-manager-1.1.3-old/src/properties.c gnome-volume-manager-1.1.3/src/properties.c
---- gnome-volume-manager-1.1.3-old/src/properties.c	2005-01-23 23:11:02.000000000 +0100
-+++ gnome-volume-manager-1.1.3/src/properties.c	2005-02-08 13:27:04.838032975 +0100
-@@ -376,7 +376,8 @@
- 		gtk_message_dialog_format_secondary_text (GTK_DIALOG (dialog),
+diff -ruN gnome-volume-manager-1.3.1-old/src/properties.c gnome-volume-manager-1.3.1/src/properties.c
+--- gnome-volume-manager-1.3.1-old/src/properties.c	2005-03-31 18:27:07.000000000 +0200
++++ gnome-volume-manager-1.3.1/src/properties.c	2005-04-13 14:54:00.994187816 +0200
+@@ -396,7 +396,8 @@
+ 		gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
  							  _("The \"hald\" service is required but not currently "
  							    "running. Enable the service and rerun this applet, "
 -							    "or contact your system administrator."));
 +							    "or contact your system administrator. Note: You "
-+							    "need Linux kernel 2.6 for volume management to work."));
++                                                            "need Linux kernel 2.6 for volume management to work."));
  
  		gtk_dialog_run (GTK_DIALOG (dialog));
  		gtk_widget_destroy (dialog);