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

(-)a/shared-mime-info-1.4-suppress-Unknown-media-type-if-from-filetrigger.patch (+41 lines)
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;
(-)a/shared-mime-info.filetrigger (+1 lines)
Lines 1-4 Link Here
1
#!/bin/sh -e
1
#!/bin/sh -e
2
2
3
export XDG_DATA_DIRS=/usr/share
3
export XDG_DATA_DIRS=/usr/share
4
export ALT_RPM_FILETRIGGER=1
4
grep -qs '^/usr/share/mime/packages/.*\.xml$' && update-mime-database -n /usr/share/mime ||:
5
grep -qs '^/usr/share/mime/packages/.*\.xml$' && update-mime-database -n /usr/share/mime ||:
(-)a/shared-mime-info.spec (+2 lines)
Lines 12-17 Url: http://www.freedesktop.org/wiki/Software/%name Link Here
12
Source: http://www.freedesktop.org/~hadess/%name-%version.tar.xz
12
Source: http://www.freedesktop.org/~hadess/%name-%version.tar.xz
13
Source2: %name.filetrigger
13
Source2: %name.filetrigger
14
Patch: %name-0.19-alt-cachedir-param.patch
14
Patch: %name-0.19-alt-cachedir-param.patch
15
Patch1: %name-1.4-suppress-Unknown-media-type-if-from-filetrigger.patch
15
16
16
Requires: rpm-build-xdg
17
Requires: rpm-build-xdg
17
18
Lines 51-56 format and merging them together. Link Here
51
%prep
52
%prep
52
%setup
53
%setup
53
%patch
54
%patch
55
%patch1 -p1
54
56
55
rm -f freedesktop.org.xml
57
rm -f freedesktop.org.xml
56
58

Return to bug 22431