Gentoo Archives: gentoo-commits

From: "Victor Ostorga (vostorga)" <vostorga@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in x11-misc/pcmanfm/files: pcmanfm-0.5.1-shared-mime-info-0.70.patch
Date: Sun, 25 Oct 2009 03:12:05
Message-Id: E1N1tWU-0004sC-CD@stork.gentoo.org
1 vostorga 09/10/25 03:12:02
2
3 Added: pcmanfm-0.5.1-shared-mime-info-0.70.patch
4 Log:
5 Allowing pcmanfm to work against shared-mime-info-0.70 , patch thanks to Samuli Suominen <ssuominen@g.o> bug 288820
6 (Portage version: 2.1.6.13/cvs/Linux i686)
7
8 Revision Changes Path
9 1.1 x11-misc/pcmanfm/files/pcmanfm-0.5.1-shared-mime-info-0.70.patch
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-misc/pcmanfm/files/pcmanfm-0.5.1-shared-mime-info-0.70.patch?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-misc/pcmanfm/files/pcmanfm-0.5.1-shared-mime-info-0.70.patch?rev=1.1&content-type=text/plain
13
14 Index: pcmanfm-0.5.1-shared-mime-info-0.70.patch
15 ===================================================================
16 diff -ur pcmanfm-0.5.1.orig/src/mime-type/mime-cache.c pcmanfm-0.5.1/src/mime-type/mime-cache.c
17 --- pcmanfm-0.5.1.orig/src/mime-type/mime-cache.c 2009-04-20 20:41:30.000000000 +0300
18 +++ pcmanfm-0.5.1/src/mime-type/mime-cache.c 2009-10-24 20:39:51.000000000 +0300
19 @@ -40,7 +40,13 @@
20 #include <fnmatch.h>
21
22 #define LIB_MAJOR_VERSION 1
23 -#define LIB_MAX_MINOR_VERSION 1
24 +/* FIXME: since mime-cache 1.2, weight is splitted into three parts
25 + * only lower 8 bit contains weight, and higher bits are flags and case-sensitivity.
26 + * anyway, since we don't support weight at all, it'll be fixed later.
27 + * We claimed that we support 1.2 to cheat pcmanfm as a temporary quick dirty fix
28 + * for the broken file manager, but this should be correctly done in the future.
29 + * Weight and case-sensitivity are not handled now. */
30 +#define LIB_MAX_MINOR_VERSION 2
31 #define LIB_MIN_MINOR_VERSION 0
32
33 /* handle byte order here */
34 @@ -57,7 +63,6 @@
35 #define GLOB_LIST 20
36 #define MAGIC_LIST 24
37 #define NAMESPACE_LIST 28
38 -#define HEADER_SIZE 32
39
40 MimeCache* mime_cache_new( const char* file_path )
41 {
42 @@ -111,7 +116,7 @@
43 if ( fd < 0 )
44 return FALSE;
45
46 - if( fstat ( fd, &statbuf ) < 0 || statbuf.st_size < HEADER_SIZE )
47 + if( fstat ( fd, &statbuf ) < 0 )
48 {
49 close( fd );
50 return FALSE;
51 @@ -346,7 +351,6 @@
52 const char* node =nodes + i * 12;
53 guint32 ch = VAL32(node, 0);
54 _suffix_pos = suffix;
55 -
56 if( G_LIKELY( ch ) )
57 {
58 if( ch == uchar )
59 @@ -391,14 +395,12 @@
60
61 if( G_UNLIKELY( ! filename || ! *filename || 0 == n ) )
62 return NULL;
63 -
64 if( cache->has_reverse_suffix ) /* since mime.cache ver: 1.1 */
65 {
66 const char *suffix, *leaf_node, *_suffix_pos = (const char*)-1;
67 fn_len = strlen( filename );
68 suffix = g_utf8_find_prev_char( filename, filename + fn_len );
69 leaf_node = lookup_reverse_suffix_nodes( cache->buffer, root, n, filename, suffix, &_suffix_pos );
70 -
71 if( leaf_node )
72 {
73 mime_type = cache->buffer + VAL32( leaf_node, 4 );