View | Details | Raw Unified | Return to bug 180132
Collapse All | Expand All

(-)./Makefile (-1 / +2 lines)
Lines 3-8 Link Here
3
3
4
PORTNAME=	menu-cache
4
PORTNAME=	menu-cache
5
PORTVERSION=	0.4.1
5
PORTVERSION=	0.4.1
6
PORTREVISION=	1
6
CATEGORIES=	x11
7
CATEGORIES=	x11
7
MASTER_SITES=	SF/lxde/menu-cache/menu-cache%20${PORTVERSION}/
8
MASTER_SITES=	SF/lxde/menu-cache/menu-cache%20${PORTVERSION}/
8
9
Lines 10-16 Link Here
10
COMMENT=	The menu-cache portion of LXDE
11
COMMENT=	The menu-cache portion of LXDE
11
12
12
USES=		pkgconfig
13
USES=		pkgconfig
13
USE_GNOME=	gnomehack gtk20
14
USE_GNOME=	gnomehack glib20
14
USE_AUTOTOOLS=	libtool
15
USE_AUTOTOOLS=	libtool
15
USE_GMAKE=	yes
16
USE_GMAKE=	yes
16
USE_LDCONFIG=	yes
17
USE_LDCONFIG=	yes
(-)./files/patch-menu-cache-daemon-menu-cached.c (+46 lines)
Line 0 Link Here
1
--- menu-cache-daemon/menu-cached.c.orig	2012-11-14 09:07:36.000000000 +0100
2
+++ menu-cache-daemon/menu-cached.c	2013-07-01 00:02:26.000000000 +0200
3
@@ -121,7 +121,7 @@
4
 static gboolean read_all_used_files( FILE* f, int* n_files, char*** used_files )
5
 {
6
     char line[ 4096 ];
7
-    int i, n;
8
+    int i, n, x;
9
     char** files;
10
     int ver_maj, ver_min;
11
 
12
@@ -141,20 +141,31 @@
13
     if( ! fgets( line, G_N_ELEMENTS(line), f ) )
14
         return FALSE;
15
 
16
-    *n_files = n = atoi( line );
17
+    n = atoi( line );
18
     files = g_new0( char*, n + 1 );
19
 
20
-    for( i = 0; i < n; ++i )
21
+    for( i = 0, x = 0; i < n; ++i )
22
     {
23
         int len;
24
+        GFile *gfile;
25
         if( ! fgets( line, G_N_ELEMENTS(line), f ) )
26
             return FALSE;
27
 
28
         len = strlen( line );
29
         if( len <= 1 )
30
             return FALSE;
31
-        files[ i ] = g_strndup( line, len - 1 ); /* don't include \n */
32
+        files[ x ] = g_strndup( line, len - 1 ); /* don't include \n */
33
+        gfile = g_file_new_for_path(files[x]+1);
34
+        if (g_file_query_exists(gfile, NULL))
35
+            x++;
36
+        else
37
+        {
38
+            DEBUG("ignoring not existant file from menu-cache-gen: %s", files[x]);
39
+            g_free(files[x]);
40
+        }
41
+        g_object_unref(gfile);
42
     }
43
+    *n_files = x;
44
     *used_files = files;
45
     return TRUE;
46
 }

Return to bug 180132