[Pkg-mono-svn-commits] rev 2431 - in gtk-sharp2/trunk/debian: . patches

Sebastian Dröge slomo-guest at costa.debian.org
Fri Apr 14 10:49:06 UTC 2006


Author: slomo-guest
Date: 2006-04-14 10:49:05 +0000 (Fri, 14 Apr 2006)
New Revision: 2431

Added:
   gtk-sharp2/trunk/debian/patches/03_gnomevfs-mimetype-pinvokes.dpatch
   gtk-sharp2/trunk/debian/patches/04_list-to-array-marshalling.dpatch
Modified:
   gtk-sharp2/trunk/debian/changelog
   gtk-sharp2/trunk/debian/control
   gtk-sharp2/trunk/debian/patches/00list
Log:
* add two patches from svn to gtk-sharp2


Modified: gtk-sharp2/trunk/debian/changelog
===================================================================
--- gtk-sharp2/trunk/debian/changelog	2006-04-14 10:43:39 UTC (rev 2430)
+++ gtk-sharp2/trunk/debian/changelog	2006-04-14 10:49:05 UTC (rev 2431)
@@ -1,3 +1,17 @@
+gtk-sharp2 (2.8.2-2) unstable; urgency=low
+
+  * Sebastian 'slomo' Dröge:
+    + Add myself to Uploaders
+    + debian/patches/03_gnomevfs-mimetype-pinvokes.dpatch: (SVN rev 58615)
+      - Fix the GnomeVFS MimeType P/Invokes to conform to the
+        const/non-const conventions as specified in the gnomevfs headers.
+        This fixes a possible double free().
+    + debian/patches/04_list-to-array-marshalling.dpatch: (SVN rev 58609)
+      - Fix the ListToArray marshalling to respect the owners of the Opaque
+        elements.
+
+ -- Debian Mono Group <pkg-mono-group at lists.alioth.debian.org>  Fri, 14 Apr 2006 12:48:02 +0200
+
 gtk-sharp2 (2.8.2-1) unstable; urgency=low
 
   * New upstream release

Modified: gtk-sharp2/trunk/debian/control
===================================================================
--- gtk-sharp2/trunk/debian/control	2006-04-14 10:43:39 UTC (rev 2430)
+++ gtk-sharp2/trunk/debian/control	2006-04-14 10:49:05 UTC (rev 2431)
@@ -2,7 +2,7 @@
 Section: libs
 Priority: optional
 Maintainer: Debian Mono Group <pkg-mono-group at lists.alioth.debian.org>
-Uploaders: Dave Beckett <dajobe at debian.org>, Mirco Bauer <meebey at meebey.net>
+Uploaders: Dave Beckett <dajobe at debian.org>, Mirco Bauer <meebey at meebey.net>, Sebastian Dröge <slomo at ubuntu.com>
 Build-Depends: debhelper (>= 4.1.87), cli-common (>= 0.2.0), mono-mcs (>= 1.0) | c-sharp-compiler, mono-gac (>= 1.0), monodoc-base (>= 1.0), libmono-dev, libtool, libglib2.0-dev (>= 2.8.0), libgtk2.0-dev (>= 2.8.0), libpango1.0-dev, libatk1.0-dev, libfreetype6-dev, libxml2-dev, libglade2-dev (>= 2.3.6), librsvg2-dev (>= 2.0.1), libgail-dev, libgtkhtml3.8-dev (>= 3.8.0), libgnomeui-dev (>= 2.10.0), libgnomecanvas2-dev (>= 2.10.0), libgnomeprint2.2-dev (>= 2.10.0) , libgnomeprintui2.2-dev (>= 2.10.0), libart-2.0-dev (>= 2.3.16), libvte-dev (>= 0.11.10), libpanel-applet2-dev (>= 2.10.0), libmono0 (>= 1.0), mono-utils (>= 1.0-2), dpatch
 Standards-Version: 3.6.2.1
 

Modified: gtk-sharp2/trunk/debian/patches/00list
===================================================================
--- gtk-sharp2/trunk/debian/patches/00list	2006-04-14 10:43:39 UTC (rev 2430)
+++ gtk-sharp2/trunk/debian/patches/00list	2006-04-14 10:49:05 UTC (rev 2431)
@@ -1,2 +1,4 @@
 01_glue-locations.dpatch
 02_workaround-340904.dpatch
+03_gnomevfs-mimetype-pinvokes.dpatch
+04_list-to-array-marshalling.dpatch

Added: gtk-sharp2/trunk/debian/patches/03_gnomevfs-mimetype-pinvokes.dpatch
===================================================================
--- gtk-sharp2/trunk/debian/patches/03_gnomevfs-mimetype-pinvokes.dpatch	2006-04-14 10:43:39 UTC (rev 2430)
+++ gtk-sharp2/trunk/debian/patches/03_gnomevfs-mimetype-pinvokes.dpatch	2006-04-14 10:49:05 UTC (rev 2431)
@@ -0,0 +1,175 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+
+ at DPATCH@
+
+--- gtk-sharp/gnomevfs/MimeType.cs	2004/11/05 17:40:03	35707
++++ gtk-sharp/gnomevfs/MimeType.cs	2006/03/27 19:43:53	58615
+@@ -27,100 +27,131 @@
+ 		private string mimetype;
+ 
+ 		[DllImport ("gnomevfs-2")]
+-		static extern string gnome_vfs_get_mime_type (string uri);
++		static extern IntPtr gnome_vfs_get_mime_type (IntPtr uri);
+ 		
+ 		public MimeType (Uri uri)
+ 		{
+-			mimetype = gnome_vfs_get_mime_type (uri.ToString ());
++			IntPtr uri_native = GLib.Marshaller.StringToPtrGStrdup (uri.ToString ());
++			mimetype = GLib.Marshaller.PtrToStringGFree (gnome_vfs_get_mime_type (uri_native));
++			GLib.Marshaller.Free (uri_native);
+ 		}
+ 
+ 		[DllImport ("gnomevfs-2")]
+-		static extern bool gnome_vfs_mime_type_is_known (string mime_type);
++		static extern bool gnome_vfs_mime_type_is_known (IntPtr mime_type);
+ 
+ 		public MimeType (string mimetype)
+ 		{
+-			if (!gnome_vfs_mime_type_is_known (mimetype))
++			IntPtr mimetype_native = GLib.Marshaller.StringToPtrGStrdup (mimetype);
++			if (!gnome_vfs_mime_type_is_known (mimetype_native))
+ 				throw new ArgumentException ("Unknown mimetype");
+ 			this.mimetype = mimetype;
++			GLib.Marshaller.Free (mimetype_native);
+ 		}
+ 		
+ 		[DllImport ("gnomevfs-2")]
+-		static extern string gnome_vfs_get_mime_type_for_data (ref byte data, int size);
++		static extern IntPtr gnome_vfs_get_mime_type_for_data (ref byte data, int size);
+ 		
+ 		public MimeType (byte[] buffer, int size)
+ 		{
+-			mimetype = gnome_vfs_get_mime_type_for_data (ref buffer[0], size);
++			mimetype = GLib.Marshaller.Utf8PtrToString (gnome_vfs_get_mime_type_for_data (ref buffer[0], size));
+ 		}
+ 		
+ 		[DllImport ("gnomevfs-2")]
+-		static extern MimeActionType gnome_vfs_mime_get_default_action_type (string mime_type);
++		static extern MimeActionType gnome_vfs_mime_get_default_action_type (IntPtr mime_type);
+ 		
+ 		[DllImport ("gnomevfs-2")]
+-		static extern Result gnome_vfs_mime_set_default_action_type (string mime_type, MimeActionType action_type);
++		static extern Result gnome_vfs_mime_set_default_action_type (IntPtr mime_type, MimeActionType action_type);
+ 
+ 		public MimeActionType DefaultActionType {
+ 			get {
+-				return gnome_vfs_mime_get_default_action_type (mimetype);
++				IntPtr mimetype_native = GLib.Marshaller.StringToPtrGStrdup (mimetype);
++				MimeActionType result = gnome_vfs_mime_get_default_action_type (mimetype_native);
++				GLib.Marshaller.Free (mimetype_native);
++				return result;
+ 			}
+ 			set {
+-				Result result = gnome_vfs_mime_set_default_action_type (mimetype, value);
++				IntPtr mimetype_native = GLib.Marshaller.StringToPtrGStrdup (mimetype);
++				Result result = gnome_vfs_mime_set_default_action_type (mimetype_native, value);
++				GLib.Marshaller.Free (mimetype_native);
+ 				Vfs.ThrowException (result);
+ 			}
+ 		}
+ 		
+ 		[DllImport ("gnomevfs-2")]
+-		static extern MimeAction gnome_vfs_mime_get_default_action (string mime_type);
++		static extern MimeAction gnome_vfs_mime_get_default_action (IntPtr mime_type);
+ 
+ 		public MimeAction DefaultAction {
+ 			get {
+-				return gnome_vfs_mime_get_default_action (mimetype);
++				IntPtr mimetype_native = GLib.Marshaller.StringToPtrGStrdup (mimetype);
++				MimeAction result = gnome_vfs_mime_get_default_action (mimetype_native);
++				GLib.Marshaller.Free (mimetype_native);
++				return result;
+ 			}
+ 		}
+ 		
+ 		[DllImport ("gnomevfs-2")]
+-		static extern string gnome_vfs_mime_get_description (string mime_type);
++		static extern IntPtr gnome_vfs_mime_get_description (IntPtr mime_type);
+ 
+ 		[DllImport ("gnomevfs-2")]
+-		static extern Result gnome_vfs_mime_set_description (string mime_type, string description);
++		static extern Result gnome_vfs_mime_set_description (IntPtr mime_type, IntPtr description);
+ 
+ 		public string Description {
+ 			get {
+-				return gnome_vfs_mime_get_description (mimetype);
++				IntPtr mimetype_native = GLib.Marshaller.StringToPtrGStrdup (mimetype);
++				string result = GLib.Marshaller.Utf8PtrToString (gnome_vfs_mime_get_description (mimetype_native));
++				GLib.Marshaller.Free (mimetype_native);
++				return result;
+ 			}
+ 			set {
+-				Result result = gnome_vfs_mime_set_description (mimetype, value);
++				IntPtr mimetype_native = GLib.Marshaller.StringToPtrGStrdup (mimetype);
++				IntPtr desc_native = GLib.Marshaller.StringToPtrGStrdup (value);
++				Result result = gnome_vfs_mime_set_description (mimetype_native, desc_native);
++				GLib.Marshaller.Free (mimetype_native);
++				GLib.Marshaller.Free (desc_native);
+ 				Vfs.ThrowException (result);
+ 			}
+ 		}
+ 		
+ 		[DllImport ("gnomevfs-2")]
+-		static extern string gnome_vfs_mime_get_icon (string mime_type);
++		static extern IntPtr gnome_vfs_mime_get_icon (IntPtr mime_type);
+ 		
+ 		[DllImport ("gnomevfs-2")]
+-		static extern Result gnome_vfs_mime_set_icon (string mime_type, string filename);
++		static extern Result gnome_vfs_mime_set_icon (IntPtr mime_type, IntPtr filename);
+ 		
+ 		public string Icon {
+ 			get {
+-				return gnome_vfs_mime_get_icon (mimetype);
++				IntPtr mimetype_native = GLib.Marshaller.StringToPtrGStrdup (mimetype);
++				string result = GLib.Marshaller.Utf8PtrToString (gnome_vfs_mime_get_icon (mimetype_native));
++				GLib.Marshaller.Free (mimetype_native);
++				return result;
+ 			}
+ 			set {
+-				Result result = gnome_vfs_mime_set_icon (mimetype, value);
++				IntPtr mimetype_native = GLib.Marshaller.StringToPtrGStrdup (mimetype);
++				IntPtr icon_native = GLib.Marshaller.StringToPtrGStrdup (value);
++				Result result = gnome_vfs_mime_set_icon (mimetype_native, icon_native);
++				GLib.Marshaller.Free (mimetype_native);
++				GLib.Marshaller.Free (icon_native);
+ 				Vfs.ThrowException (result);
+ 			}
+ 		}
+ 
+ 		[DllImport ("gnomevfs-2")]
+-		static extern bool gnome_vfs_mime_can_be_executable (string mime_type);
++		static extern bool gnome_vfs_mime_can_be_executable (IntPtr mime_type);
+ 
+ 		[DllImport ("gnomevfs-2")]
+-		static extern Result gnome_vfs_mime_set_can_be_executable (string mime_type, bool value);
++		static extern Result gnome_vfs_mime_set_can_be_executable (IntPtr mime_type, bool value);
+ 		
+ 		public bool CanBeExecutable {
+ 			get {
+-				return gnome_vfs_mime_can_be_executable (mimetype);
++				IntPtr mimetype_native = GLib.Marshaller.StringToPtrGStrdup (mimetype);
++				bool result = gnome_vfs_mime_can_be_executable (mimetype_native);
++				GLib.Marshaller.Free (mimetype_native);
++				return result;
+ 			}
+ 			set {
+-				Result result = gnome_vfs_mime_set_can_be_executable (mimetype, value);
++				IntPtr mimetype_native = GLib.Marshaller.StringToPtrGStrdup (mimetype);
++				Result result = gnome_vfs_mime_set_can_be_executable (mimetype_native, value);
++				GLib.Marshaller.Free (mimetype_native);
+ 				Vfs.ThrowException (result);
+ 			}
+ 		}
+@@ -138,7 +169,10 @@
+ 		
+ 		public static string GetMimeTypeForUri (string uri)
+ 		{
+-			return gnome_vfs_get_mime_type (uri);
++			IntPtr uri_native = GLib.Marshaller.StringToPtrGStrdup (uri.ToString ());
++			string mimetype = GLib.Marshaller.PtrToStringGFree (gnome_vfs_get_mime_type (uri_native));
++			GLib.Marshaller.Free (uri_native);
++			return mimetype;
+ 		}
+ 	}
+ }
+


Property changes on: gtk-sharp2/trunk/debian/patches/03_gnomevfs-mimetype-pinvokes.dpatch
___________________________________________________________________
Name: svn:executable
   + *

Added: gtk-sharp2/trunk/debian/patches/04_list-to-array-marshalling.dpatch
===================================================================
--- gtk-sharp2/trunk/debian/patches/04_list-to-array-marshalling.dpatch	2006-04-14 10:43:39 UTC (rev 2430)
+++ gtk-sharp2/trunk/debian/patches/04_list-to-array-marshalling.dpatch	2006-04-14 10:49:05 UTC (rev 2431)
@@ -0,0 +1,50 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+
+ at DPATCH@
+
+--- gtk-sharp/glib/Marshaller.cs	2006/01/14 14:07:27	55575
++++ gtk-sharp/glib/Marshaller.cs	2006/03/27 18:35:08	58609
+@@ -286,6 +286,10 @@
+ 			Array result = Array.CreateInstance (type, list.Count);
+ 			if (list.Count > 0)
+ 				list.CopyTo (result, 0);
++
++			if (type.IsSubclassOf (typeof (GLib.Opaque)))
++				list.elements_owned = false;
++
+ 			return result;
+ 		}
+ 	}
+
+--- gtk-sharp/glib/ListBase.cs	2005/06/23 22:28:06	46457
++++ gtk-sharp/glib/ListBase.cs	2006/03/27 18:35:08	58609
+@@ -31,7 +31,7 @@
+ 		private IntPtr list_ptr = IntPtr.Zero;
+ 		private int length = -1;
+ 		private bool managed = false;
+-		private bool elements_owned = false;
++		internal bool elements_owned = false;
+ 		protected System.Type element_type = null;
+ 
+                 abstract internal IntPtr NthData (uint index);
+@@ -134,6 +134,8 @@
+ 					ret = data;
+ 				else if (element_type.IsSubclassOf (typeof (GLib.Object)))
+ 					ret = GLib.Object.GetObject (data, false);
++				else if (element_type.IsSubclassOf (typeof (GLib.Opaque)))
++					ret = GLib.Opaque.GetOpaque (data, element_type, elements_owned);
+ 				else if (element_type == typeof (int))
+ 					ret = (int) data;
+ 				else if (element_type.IsValueType)
+@@ -159,7 +161,9 @@
+ 				for (uint i = 0; i < Count; i++)
+ 					if (typeof (GLib.Object).IsAssignableFrom (element_type))
+ 						g_object_unref (NthData (i));
+-					else
++					else if (typeof (GLib.Opaque).IsAssignableFrom (element_type))
++						GLib.Opaque.GetOpaque (NthData (i), element_type, true).Dispose ();
++					else 
+ 						g_free (NthData (i));
+ 
+ 			if (managed)
+


Property changes on: gtk-sharp2/trunk/debian/patches/04_list-to-array-marshalling.dpatch
___________________________________________________________________
Name: svn:executable
   + *




More information about the Pkg-mono-svn-commits mailing list