Line 0
Link Here
|
|
|
1 |
From 668ac161beaeecb8c93f90dbdff806a77cc5ef36 Mon Sep 17 00:00:00 2001 |
2 |
From: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org> |
3 |
Date: Thu, 14 May 2015 14:35:19 +0300 |
4 |
Subject: [PATCH] update-mime-database.c: suppress 'Unknown media type in type' |
5 |
warnings ... |
6 |
|
7 |
... if program is run from rpm filetrigger. |
8 |
|
9 |
See-Also: https://bugzilla.altlinux.org/show_bug.cgi?id=22431 |
10 |
See-Also: https://bugs.freedesktop.org/show_bug.cgi?id=16816 |
11 |
--- |
12 |
update-mime-database.c | 11 +++++++++++ |
13 |
1 file changed, 11 insertions(+) |
14 |
|
15 |
--- a/update-mime-database.c |
16 |
+++ b/update-mime-database.c |
17 |
@@ -170,6 +170,16 @@ static Match *match_new(void); |
18 |
|
19 |
static TreeMagic *tree_magic_new(xmlNode *node, Type *type, GError **error); |
20 |
|
21 |
+static int rpm_filetrigger(void) |
22 |
+{ |
23 |
+ static int from_rpm_filetrigger = -1; |
24 |
+ |
25 |
+ if (from_rpm_filetrigger < 0) |
26 |
+ from_rpm_filetrigger = getenv("ALT_RPM_FILETRIGGER") ? 1: 0; |
27 |
+ |
28 |
+ return from_rpm_filetrigger; |
29 |
+} |
30 |
+ |
31 |
static void g_log_handler (const gchar *log_domain, |
32 |
GLogLevelFlags log_level, |
33 |
const gchar *message, |
34 |
@@ -264,6 +274,7 @@ static Type *get_type(const char *name, GError **error) |
35 |
return type; |
36 |
} |
37 |
|
38 |
+ if (!rpm_filetrigger()) |
39 |
g_warning("Unknown media type in type '%s'", name); |
40 |
|
41 |
return type; |