On Sat, Apr 28, 2018 at 01:06:50PM +0200, Antoine Jacoutot wrote:
> On Sat, Apr 28, 2018 at 12:39:54PM +0200, Landry Breuil wrote:
> > Hi,
> > 
> > saw this during a pkg_add w/ kdelibs4 installed:
> > 
> > Unknown media type in type 'all/all'
> > Unknown media type in type 'all/allfiles'
> > 
> > shared-mime-info is choking on types installed by kdelibs4, which had
> > been removed in kde5:
> > https://github.com/KDE/kcoreaddons/commit/36ff1bf60c9b12c28ed4d7566abceac10cab345e
> > 
> > the internet seems to go crazy about it and kde4 & freedesktop ppl are
> > throwing the issue at each other on various places / distro bug reports:
> > 
> > https://bugs.kde.org/show_bug.cgi?id=303627
> > https://bugs.launchpad.net/ubuntu/+source/shared-mime-info/+bug/289592
> > https://bugs.gentoo.org/261446
> > https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=469833
> > https://bugs.freedesktop.org/show_bug.cgi?id=16816
> > 
> > bastien nocera recently hacked shared-mime-info to not complain about it 
> > anymore, cf
> > https://cgit.freedesktop.org/xdg/shared-mime-info/commit/?id=fc149b7615deecf3c3af73bcc5ee98a4b716fbac
> > and
> > https://cgit.freedesktop.org/xdg/shared-mime-info/commit/?id=553aa73de2c6a5bb221bcd9153c2425cd236c703
> > 
> > so my understanding is that an update to this version should silence
> > those errors. Some ppl are just voting for removing the mimetypes from
> > the old kde4 file, and some other are saying that it'll break kde4 apps.
> > 
> > This appeases my OCD, what are other's opinions ? Fix shared-mime-info,
> > or kdelibs4 ?
> > 
> > Landry
> 
> Why not just merge the 2 upstream commits you mentioned?

Also works, no more warning with this...

Landry
Index: Makefile
===================================================================
RCS file: /cvs/ports/misc/shared-mime-info/Makefile,v
retrieving revision 1.57
diff -u -r1.57 Makefile
--- Makefile    3 Nov 2017 10:32:53 -0000       1.57
+++ Makefile    28 Apr 2018 13:27:53 -0000
@@ -3,7 +3,7 @@
 COMMENT=               shared mime database for desktops
 
 DISTNAME=              shared-mime-info-1.9
-REVISION=              0
+REVISION=              1
 CATEGORIES=            misc
 
 HOMEPAGE=              
http://www.freedesktop.org/wiki/Software/shared-mime-info
Index: patches/patch-update-mime-database_c
===================================================================
RCS file: 
/cvs/ports/misc/shared-mime-info/patches/patch-update-mime-database_c,v
retrieving revision 1.4
diff -u -r1.4 patch-update-mime-database_c
--- patches/patch-update-mime-database_c        22 Dec 2017 10:23:20 -0000      
1.4
+++ patches/patch-update-mime-database_c        28 Apr 2018 13:27:53 -0000
@@ -1,19 +1,42 @@
 $OpenBSD: patch-update-mime-database_c,v 1.4 2017/12/22 10:23:20 jasper Exp $
 
+https://bugs.freedesktop.org/show_bug.cgi?id=16816
+https://cgit.freedesktop.org/xdg/shared-mime-info/commit/?id=553aa73de2c6a5bb221bcd9153c2425cd236c703
+https://cgit.freedesktop.org/xdg/shared-mime-info/commit/?id=fc149b7615deecf3c3af73bcc5ee98a4b716fbac
+
 https://bugs.freedesktop.org/show_bug.cgi?id=104368
 
 Index: update-mime-database.c
 --- update-mime-database.c.orig
 +++ update-mime-database.c
-@@ -3674,6 +3674,11 @@ int main(int argc, char **argv)
-               return EXIT_FAILURE;
+@@ -49,6 +49,9 @@
+  * delete. It is also used to warn about invalid MIME types.
+  */
+ const char *media_types[] = {
++      "all",
++      "uri",
++      "print",
+       "text",
+       "application",
+       "image",
+@@ -265,7 +268,7 @@ static Type *get_type(const char *name, GError **error
+                       return type;
        }
  
-+      if (pledge("stdio rpath wpath cpath getpw", NULL) == -1) {
-+              g_warning(_("pledge"));
+-      g_warning("Unknown media type in type '%s'", name);
++      g_message("Unknown media type in type '%s'", name);
+ 
+       return type;
+ }
+@@ -3671,6 +3674,11 @@ int main(int argc, char **argv)
+       if (optind != argc - 1)
+       {
+               usage(argv[0]);
 +              return EXIT_FAILURE;
 +      }
 +
-       LIBXML_TEST_VERSION;
++      if (pledge("stdio rpath wpath cpath getpw", NULL) == -1) {
++              g_warning(_("pledge"));
+               return EXIT_FAILURE;
+       }
  
-       mime_dir = argv[optind];

Reply via email to