$OpenBSD: patch-src_update-desktop-database_c,v 1.10 2013/09/25 19:24:34 ajacoutot Exp $

XXX remove when kde3 is gone;
Quiet warnings about deprecated/discouraged and invalid MIME types.

Under OpenBSD, desktop files are installed using INSTALL_DATA which is
defined in ports/infrastructure/mk/bsd.port.mk as:
    ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE}
SHAREMODE is defined under /usr/share/mk/bsd.own.mk as "444".
That means desktop files are installed with mode 444 which is wrong
because fd.o environments use these files to create menu structures,
links to applications... and a user should be able to edit the link icon
or menu he just created.

--- src/update-desktop-database.c.orig	Mon Jan  7 08:59:20 2013
+++ src/update-desktop-database.c	Wed Sep 25 21:20:43 2013
@@ -149,15 +149,9 @@ process_desktop_file (const char  *desktop_file,
         case MU_VALID:
           break;
         case MU_DISCOURAGED:
-          udd_print (_("Warning in file \"%s\": usage of MIME type \"%s\" is "
-                       "discouraged (%s)\n"),
-                     desktop_file, mime_types[i], valid_error);
           g_free (valid_error);
           break;
         case MU_INVALID:
-          udd_print (_("Error in file \"%s\": \"%s\" is an invalid MIME type "
-                       "(%s)\n"),
-                     desktop_file, mime_types[i], valid_error);
           g_free (valid_error);
           /* not a break: we continue to the next mime type */
           continue;
@@ -227,6 +221,10 @@ process_desktop_files (const char  *desktop_dir,
         }
 
       name = g_strdup_printf ("%s%s", prefix, filename);
+
+      if (chmod(full_path, 0644) != 0)
+          printf("Cannot give 644 perms to: %s", full_path);
+
       process_desktop_file (full_path, name, &process_error);
       g_free (name);
 
