rpms/gnome-vfs2/devel gnome-vfs2.spec, 1.180, 1.181 xdgmime.patch, 1.1, 1.2

Matthias Clasen (mclasen) fedora-extras-commits at redhat.com
Thu Jul 24 14:45:22 UTC 2008


Author: mclasen

Update of /cvs/extras/rpms/gnome-vfs2/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv17516

Modified Files:
	gnome-vfs2.spec xdgmime.patch 
Log Message:
fix up patch



Index: gnome-vfs2.spec
===================================================================
RCS file: /cvs/extras/rpms/gnome-vfs2/devel/gnome-vfs2.spec,v
retrieving revision 1.180
retrieving revision 1.181
diff -u -r1.180 -r1.181
--- gnome-vfs2.spec	24 Jul 2008 04:44:49 -0000	1.180
+++ gnome-vfs2.spec	24 Jul 2008 14:44:36 -0000	1.181
@@ -134,7 +134,7 @@
 
 %patch300 -p1 -b .ignore-certain-mount-points
 
-%patch402 -p0 -b .xdgmime
+%patch402 -p1 -b .xdgmime
 
 # for patch 10
 autoheader

xdgmime.patch:

View full diff with command:
/usr/bin/cvs -f diff  -kk -u -N -r 1.1 -r 1.2 xdgmime.patch
Index: xdgmime.patch
===================================================================
RCS file: /cvs/extras/rpms/gnome-vfs2/devel/xdgmime.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- xdgmime.patch	24 Jul 2008 04:44:49 -0000	1.1
+++ xdgmime.patch	24 Jul 2008 14:44:36 -0000	1.2
@@ -1,7 +1,66 @@
-Index: libgnomevfs/xdgmimecache.c
-===================================================================
---- libgnomevfs/xdgmimecache.c	(revision 5479)
-+++ libgnomevfs/xdgmimecache.c	(working copy)
+diff -up gnome-vfs-2.22.0/libgnomevfs/gnome-vfs-mime.c.xdgmime gnome-vfs-2.22.0/libgnomevfs/gnome-vfs-mime.c
+--- gnome-vfs-2.22.0/libgnomevfs/gnome-vfs-mime.c.xdgmime	2008-03-10 15:12:45.000000000 -0400
++++ gnome-vfs-2.22.0/libgnomevfs/gnome-vfs-mime.c	2008-07-24 10:35:59.000000000 -0400
+@@ -236,6 +236,7 @@ _gnome_vfs_read_mime_from_buffer (GnomeV
+ 	int max_extents;
+ 	GnomeVFSResult result = GNOME_VFS_OK;
+ 	const char *mime_type;
++	int prio;
+ 
+ 	G_LOCK (gnome_vfs_mime_mutex);
+ 	max_extents = xdg_mime_get_max_buffer_extents ();
+@@ -250,7 +251,7 @@ _gnome_vfs_read_mime_from_buffer (GnomeV
+ 	}
+ 	G_LOCK (gnome_vfs_mime_mutex);
+ 
+-	mime_type = xdg_mime_get_mime_type_for_data (buffer->buffer, buffer->buffer_length);
++	mime_type = xdg_mime_get_mime_type_for_data (buffer->buffer, buffer->buffer_length, &prio);
+ 
+ 	G_UNLOCK (gnome_vfs_mime_mutex);
+ 
+diff -up gnome-vfs-2.22.0/libgnomevfs/xdgmimealias.c.xdgmime gnome-vfs-2.22.0/libgnomevfs/xdgmimealias.c
+--- gnome-vfs-2.22.0/libgnomevfs/xdgmimealias.c.xdgmime	2008-03-10 15:12:45.000000000 -0400
++++ gnome-vfs-2.22.0/libgnomevfs/xdgmimealias.c	2008-07-24 10:42:39.000000000 -0400
+@@ -26,7 +26,7 @@
+  */
+ 
+ #ifdef HAVE_CONFIG_H
+-#include <config.h>
++#include "config.h"
+ #endif
+ 
+ #include "xdgmimealias.h"
+@@ -105,7 +105,7 @@ _xdg_mime_alias_list_lookup (XdgAliasLis
+   if (list->n_aliases > 0)
+     {
+       key.alias = (char *)alias;
+-      key.mime_type = 0;
++      key.mime_type = NULL;
+ 
+       entry = bsearch (&key, list->aliases, list->n_aliases,
+ 		       sizeof (XdgAlias), alias_entry_cmp);
+diff -up gnome-vfs-2.22.0/libgnomevfs/xdgmimealias.h.xdgmime gnome-vfs-2.22.0/libgnomevfs/xdgmimealias.h
+--- gnome-vfs-2.22.0/libgnomevfs/xdgmimealias.h.xdgmime	2008-03-10 15:12:45.000000000 -0400
++++ gnome-vfs-2.22.0/libgnomevfs/xdgmimealias.h	2008-07-24 10:42:39.000000000 -0400
+@@ -33,10 +33,11 @@
+ typedef struct XdgAliasList XdgAliasList;
+ 
+ #ifdef XDG_PREFIX
+-#define _xdg_mime_alias_read_from_file        XDG_ENTRY(alias_read_from_file)
+-#define _xdg_mime_alias_list_new              XDG_ENTRY(alias_list_new)
+-#define _xdg_mime_alias_list_free             XDG_ENTRY(alias_list_free)
+-#define _xdg_mime_alias_list_lookup           XDG_ENTRY(alias_list_lookup)
++#define _xdg_mime_alias_read_from_file        XDG_RESERVED_ENTRY(alias_read_from_file)
++#define _xdg_mime_alias_list_new              XDG_RESERVED_ENTRY(alias_list_new)
++#define _xdg_mime_alias_list_free             XDG_RESERVED_ENTRY(alias_list_free)
++#define _xdg_mime_alias_list_lookup           XDG_RESERVED_ENTRY(alias_list_lookup)
++#define _xdg_mime_alias_list_dump             XDG_RESERVED_ENTRY(alias_list_dump)
+ #endif
+ 
+ void          _xdg_mime_alias_read_from_file (XdgAliasList *list,
+diff -up gnome-vfs-2.22.0/libgnomevfs/xdgmimecache.c.xdgmime gnome-vfs-2.22.0/libgnomevfs/xdgmimecache.c
+--- gnome-vfs-2.22.0/libgnomevfs/xdgmimecache.c.xdgmime	2008-03-10 15:12:45.000000000 -0400
++++ gnome-vfs-2.22.0/libgnomevfs/xdgmimecache.c	2008-07-24 10:42:40.000000000 -0400
 @@ -25,7 +25,7 @@
   */
  
@@ -29,7 +88,16 @@
  
  struct _XdgMimeCache
  {
-@@ -344,6 +346,11 @@
+@@ -297,7 +299,7 @@ cache_magic_lookup_data (XdgMimeCache *c
+ 	  for (n = 0; n < n_mime_types; n++)
+ 	    {
+ 	      if (mime_types[n] && 
+-		  xdg_mime_mime_type_equal (mime_types[n], non_match))
++		  _xdg_mime_mime_type_equal (mime_types[n], non_match))
+ 		mime_types[n] = NULL;
+ 	    }
+ 	}
+@@ -344,6 +346,11 @@ cache_alias_lookup (const char *alias)
    return NULL;
  }
  
@@ -41,7 +109,7 @@
  static int
  cache_glob_lookup_literal (const char *file_name,
  			   const char *mime_types[],
-@@ -365,7 +372,7 @@
+@@ -365,7 +372,7 @@ cache_glob_lookup_literal (const char *f
  	{
  	  mid = (min + max) / 2;
  
@@ -50,7 +118,7 @@
  	  ptr = cache->buffer + offset;
  	  cmp = strcmp (ptr, file_name);
  	  
-@@ -375,7 +382,7 @@
+@@ -375,7 +382,7 @@ cache_glob_lookup_literal (const char *f
  	    max = mid - 1;
  	  else
  	    {
@@ -59,7 +127,7 @@
  	      mime_types[0] = (const char *)(cache->buffer + offset);
  	      
  	      return 1;
-@@ -388,7 +395,7 @@
+@@ -388,7 +395,7 @@ cache_glob_lookup_literal (const char *f
  
  static int
  cache_glob_lookup_fnmatch (const char *file_name,
@@ -68,7 +136,7 @@
  			   int         n_mime_types)
  {
    const char *mime_type;
-@@ -406,14 +413,19 @@
+@@ -406,14 +413,19 @@ cache_glob_lookup_fnmatch (const char *f
  
        for (j = 0; j < n_entries && n < n_mime_types; j++)
  	{
@@ -91,7 +159,7 @@
  	}
  
        if (n > 0)
-@@ -424,85 +436,86 @@
+@@ -424,85 +436,86 @@ cache_glob_lookup_fnmatch (const char *f
  }
  
  static int
@@ -187,7 +255,7 @@
  		}
 -
 -	      return n;
- 	    }
+-	    }
 -	  else
 -	    {
 -	      n_children = GET_UINT32 (cache->buffer, offset + 16 * mid + 8);
@@ -198,7 +266,7 @@
 -						    suffix, ignore_case,
 -						    mime_types,
 -						    n_mime_types);
--	    }
+ 	    }
 +	  return n;
  	}
      }
@@ -219,7 +287,7 @@
  {
    int i, n;
  
-@@ -516,7 +529,8 @@
+@@ -516,7 +529,8 @@ cache_glob_lookup_suffix (const char *su
  
        n = cache_glob_node_lookup_suffix (cache, 
  					 n_entries, offset, 
@@ -229,7 +297,7 @@
  					 mime_types,
  					 n_mime_types);
        if (n > 0)
-@@ -526,41 +540,12 @@
+@@ -526,41 +540,12 @@ cache_glob_lookup_suffix (const char *su
    return 0;
  }
  
@@ -243,9 +311,7 @@
 -  for (i = 0; _caches[i]; i++)
 -    {
 -      XdgMimeCache *cache = _caches[i];
-+  const MimeWeight *aa = (const MimeWeight *)a;
-+  const MimeWeight *bb = (const MimeWeight *)b;
- 
+-
 -      xdg_uint32_t list_offset = GET_UINT32 (cache->buffer, 16);
 -      xdg_uint32_t n_entries = GET_UINT32 (cache->buffer, list_offset);
 -      xdg_uint32_t offset = GET_UINT32 (cache->buffer, list_offset + 4);
@@ -265,7 +331,9 @@
 -		  k++;
 -		}
 -	    }
--
++  const MimeWeight *aa = (const MimeWeight *)a;
++  const MimeWeight *bb = (const MimeWeight *)b;
+ 
 -	  offset += 16;
 -	}
 -    }
[...1764 lines suppressed...]
  int          _xdg_mime_mime_type_subclass          (const char *mime,
  						    const char *base);
 -const char  *_xdg_mime_unalias_mime_type	   (const char *mime);
@@ -1603,10 +1557,9 @@
  
  
  #ifdef __cplusplus
-Index: libgnomevfs/xdgmimeint.c
-===================================================================
---- libgnomevfs/xdgmimeint.c	(revision 5479)
-+++ libgnomevfs/xdgmimeint.c	(working copy)
+diff -up gnome-vfs-2.22.0/libgnomevfs/xdgmimeint.c.xdgmime gnome-vfs-2.22.0/libgnomevfs/xdgmimeint.c
+--- gnome-vfs-2.22.0/libgnomevfs/xdgmimeint.c.xdgmime	2008-03-10 15:12:45.000000000 -0400
++++ gnome-vfs-2.22.0/libgnomevfs/xdgmimeint.c	2008-07-24 10:42:40.000000000 -0400
 @@ -26,7 +26,7 @@
   */
  
@@ -1616,7 +1569,7 @@
  #endif
  
  #include "xdgmimeint.h"
-@@ -152,3 +152,40 @@
+@@ -152,3 +152,40 @@ _xdg_get_base_name (const char *file_nam
    else
      return base_name + 1;
  }
@@ -1657,11 +1610,10 @@
 +    }
 +}
 +
-Index: libgnomevfs/xdgmimeint.h
-===================================================================
---- libgnomevfs/xdgmimeint.h	(revision 5479)
-+++ libgnomevfs/xdgmimeint.h	(working copy)
-@@ -46,11 +46,13 @@
+diff -up gnome-vfs-2.22.0/libgnomevfs/xdgmimeint.h.xdgmime gnome-vfs-2.22.0/libgnomevfs/xdgmimeint.h
+--- gnome-vfs-2.22.0/libgnomevfs/xdgmimeint.h.xdgmime	2008-03-10 15:12:45.000000000 -0400
++++ gnome-vfs-2.22.0/libgnomevfs/xdgmimeint.h	2008-07-24 10:42:40.000000000 -0400
+@@ -46,11 +46,13 @@ typedef unsigned short xdg_uint16_t;
  typedef unsigned int   xdg_uint32_t;
  
  #ifdef XDG_PREFIX
@@ -1680,7 +1632,7 @@
  #endif
  
  #define SWAP_BE16_TO_LE16(val) (xdg_uint16_t)(((xdg_uint16_t)(val) << 8)|((xdg_uint16_t)(val) >> 8))
-@@ -68,6 +70,8 @@
+@@ -68,6 +70,8 @@ extern const char *const _xdg_utf8_skip;
  xdg_unichar_t  _xdg_utf8_to_ucs4  (const char    *source);
  xdg_unichar_t  _xdg_ucs4_to_lower (xdg_unichar_t  source);
  int            _xdg_utf8_validate (const char    *source);
@@ -1689,3 +1641,148 @@
  const char    *_xdg_get_base_name (const char    *file_name);
  
  #endif /* __XDG_MIME_INT_H__ */
+diff -up gnome-vfs-2.22.0/libgnomevfs/xdgmimemagic.c.xdgmime gnome-vfs-2.22.0/libgnomevfs/xdgmimemagic.c
+--- gnome-vfs-2.22.0/libgnomevfs/xdgmimemagic.c.xdgmime	2008-03-10 15:12:45.000000000 -0400
++++ gnome-vfs-2.22.0/libgnomevfs/xdgmimemagic.c	2008-07-24 10:42:40.000000000 -0400
+@@ -26,7 +26,7 @@
+  */
+ 
+ #ifdef HAVE_CONFIG_H
+-#include <config.h>
++#include "config.h"
+ #endif
+ 
+ #include <assert.h>
+@@ -47,6 +47,10 @@
+ #define	TRUE	(!FALSE)
+ #endif
+ 
++#if !defined getc_unlocked && !defined HAVE_GETC_UNLOCKED
++# define getc_unlocked(fp) getc (fp)
++#endif
++
+ typedef struct XdgMimeMagicMatch XdgMimeMagicMatch;
+ typedef struct XdgMimeMagicMatchlet XdgMimeMagicMatchlet;
+ 
+@@ -472,9 +476,7 @@ _xdg_mime_magic_parse_magic_line (FILE  
+       /* We clean up the matchlet, byte swapping if needed */
+       if (matchlet->word_size > 1)
+ 	{
+-#if LITTLE_ENDIAN
+ 	  int i;
+-#endif
+ 	  if (matchlet->value_length % matchlet->word_size != 0)
+ 	    {
+ 	      _xdg_mime_magic_matchlet_free (matchlet);
+@@ -654,34 +656,24 @@ const char *
+ _xdg_mime_magic_lookup_data (XdgMimeMagic *mime_magic,
+ 			     const void   *data,
+ 			     size_t        len,
++			     int           *result_prio,
+                              const char   *mime_types[],
+                              int           n_mime_types)
+ {
+   XdgMimeMagicMatch *match;
+   const char *mime_type;
+   int n;
+-  int priority;
+-  int had_match;
++  int prio;
+ 
++  prio = 0;
+   mime_type = NULL;
+-  priority = 0;
+-  had_match = 0;
+   for (match = mime_magic->match_list; match; match = match->next)
+     {
+       if (_xdg_mime_magic_match_compare_to_data (match, data, len))
+ 	{
+-	  if (!had_match || match->priority > priority ||
+-	      (mime_type != NULL && _xdg_mime_mime_type_subclass (match->mime_type, mime_type)))
+-	    {
+-	      mime_type = match->mime_type;
+-	      priority = match->priority;
+-	    }
+-	  else if (had_match && match->priority == priority)
+-	    /* multiple unrelated patterns with the same priority matched,
+-	     * so we can't tell what type this is. */
+-	    mime_type = NULL;
+-
+-	  had_match = 1;
++	  prio = match->priority;
++	  mime_type = match->mime_type;
++	  break;
+ 	}
+       else 
+ 	{
+@@ -702,6 +694,9 @@ _xdg_mime_magic_lookup_data (XdgMimeMagi
+ 	    mime_type = mime_types[n];
+ 	}
+     }
++  
++  if (result_prio)
++    *result_prio = prio;
+ 
+   return mime_type;
+ }
+diff -up gnome-vfs-2.22.0/libgnomevfs/xdgmimemagic.h.xdgmime gnome-vfs-2.22.0/libgnomevfs/xdgmimemagic.h
+--- gnome-vfs-2.22.0/libgnomevfs/xdgmimemagic.h.xdgmime	2008-03-10 15:12:45.000000000 -0400
++++ gnome-vfs-2.22.0/libgnomevfs/xdgmimemagic.h	2008-07-24 10:42:40.000000000 -0400
+@@ -33,12 +33,12 @@
+ typedef struct XdgMimeMagic XdgMimeMagic;
+ 
+ #ifdef XDG_PREFIX
+-#define _xdg_mime_glob_read_from_file             XDG_ENTRY(glob_read_from_file)
+-#define _xdg_mime_magic_new                       XDG_ENTRY(magic_new)
+-#define _xdg_mime_magic_read_from_file            XDG_ENTRY(magic_read_from_file)
+-#define _xdg_mime_magic_free                      XDG_ENTRY(magic_free)
+-#define _xdg_mime_magic_get_buffer_extents        XDG_ENTRY(magic_get_buffer_extents)
+-#define _xdg_mime_magic_lookup_data               XDG_ENTRY(magic_lookup_data)
++#define _xdg_mime_glob_read_from_file             XDG_RESERVED_ENTRY(glob_read_from_file)
++#define _xdg_mime_magic_new                       XDG_RESERVED_ENTRY(magic_new)
++#define _xdg_mime_magic_read_from_file            XDG_RESERVED_ENTRY(magic_read_from_file)
++#define _xdg_mime_magic_free                      XDG_RESERVED_ENTRY(magic_free)
++#define _xdg_mime_magic_get_buffer_extents        XDG_RESERVED_ENTRY(magic_get_buffer_extents)
++#define _xdg_mime_magic_lookup_data               XDG_RESERVED_ENTRY(magic_lookup_data)
+ #endif
+ 
+ 
+@@ -50,6 +50,7 @@ int           _xdg_mime_magic_get_buffer
+ const char   *_xdg_mime_magic_lookup_data        (XdgMimeMagic *mime_magic,
+ 						  const void   *data,
+ 						  size_t        len,
++						  int          *result_prio,
+ 						  const char   *mime_types[],
+ 						  int           n_mime_types);
+ 
+diff -up gnome-vfs-2.22.0/libgnomevfs/xdgmimeparent.c.xdgmime gnome-vfs-2.22.0/libgnomevfs/xdgmimeparent.c
+--- gnome-vfs-2.22.0/libgnomevfs/xdgmimeparent.c.xdgmime	2008-03-10 15:12:45.000000000 -0400
++++ gnome-vfs-2.22.0/libgnomevfs/xdgmimeparent.c	2008-07-24 10:42:40.000000000 -0400
+@@ -26,7 +26,7 @@
+  */
+ 
+ #ifdef HAVE_CONFIG_H
+-#include <config.h>
++#include "config.h"
+ #endif
+ 
+ #include "xdgmimeparent.h"
+diff -up gnome-vfs-2.22.0/libgnomevfs/xdgmimeparent.h.xdgmime gnome-vfs-2.22.0/libgnomevfs/xdgmimeparent.h
+--- gnome-vfs-2.22.0/libgnomevfs/xdgmimeparent.h.xdgmime	2008-03-10 15:12:45.000000000 -0400
++++ gnome-vfs-2.22.0/libgnomevfs/xdgmimeparent.h	2008-07-24 10:42:40.000000000 -0400
+@@ -33,10 +33,11 @@
+ typedef struct XdgParentList XdgParentList;
+ 
+ #ifdef XDG_PREFIX
+-#define _xdg_mime_parent_read_from_file        XDG_ENTRY(parent_read_from_file)
+-#define _xdg_mime_parent_list_new              XDG_ENTRY(parent_list_new)
+-#define _xdg_mime_parent_list_free             XDG_ENTRY(parent_list_free)
+-#define _xdg_mime_parent_list_lookup           XDG_ENTRY(parent_list_lookup)
++#define _xdg_mime_parent_read_from_file        XDG_RESERVED_ENTRY(parent_read_from_file)
++#define _xdg_mime_parent_list_new              XDG_RESERVED_ENTRY(parent_list_new)
++#define _xdg_mime_parent_list_free             XDG_RESERVED_ENTRY(parent_list_free)
++#define _xdg_mime_parent_list_lookup           XDG_RESERVED_ENTRY(parent_list_lookup)
++#define _xdg_mime_parent_list_dump             XDG_RESERVED_ENTRY(parent_list_dump)
+ #endif
+ 
+ void          _xdg_mime_parent_read_from_file (XdgParentList *list,




More information about the fedora-extras-commits mailing list