1 |
compnerd 08/04/22 02:54:55 |
2 |
|
3 |
Added: dbus-glib-0.73-namespaces.patch |
4 |
Log: |
5 |
add namespace support |
6 |
(Portage version: 2.1.5_rc2) |
7 |
|
8 |
Revision Changes Path |
9 |
1.1 dev-libs/dbus-glib/files/dbus-glib-0.73-namespaces.patch |
10 |
|
11 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-libs/dbus-glib/files/dbus-glib-0.73-namespaces.patch?rev=1.1&view=markup |
12 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-libs/dbus-glib/files/dbus-glib-0.73-namespaces.patch?rev=1.1&content-type=text/plain |
13 |
|
14 |
Index: dbus-glib-0.73-namespaces.patch |
15 |
=================================================================== |
16 |
--- dbus/dbus-gparser.c 2006-09-27 08:27:24.000000000 -0400 |
17 |
+++ dbus/dbus-gparser.c 2008-03-13 08:54:14.000000000 -0400 |
18 |
@@ -128,13 +128,17 @@ locate_attributes (const char *element_ |
19 |
|
20 |
if (!found) |
21 |
{ |
22 |
- g_set_error (error, |
23 |
- G_MARKUP_ERROR, |
24 |
- G_MARKUP_ERROR_PARSE, |
25 |
- _("Attribute \"%s\" is invalid on <%s> element in this context"), |
26 |
- attribute_names[i], element_name); |
27 |
- retval = FALSE; |
28 |
- goto out; |
29 |
+ /* We want to passthrough namespaced XML nodes that we don't know anything about. */ |
30 |
+ if (strchr (attribute_names[i], ':') == NULL) |
31 |
+ { |
32 |
+ g_set_error (error, |
33 |
+ G_MARKUP_ERROR, |
34 |
+ G_MARKUP_ERROR_PARSE, |
35 |
+ _("Attribute \"%s\" is invalid on <%s> element in this context"), |
36 |
+ attribute_names[i], element_name); |
37 |
+ retval = FALSE; |
38 |
+ goto out; |
39 |
+ } |
40 |
} |
41 |
|
42 |
++i; |
43 |
@@ -177,6 +181,7 @@ struct Parser |
44 |
PropertyInfo *property; |
45 |
ArgInfo *arg; |
46 |
gboolean in_annotation; |
47 |
+ guint unknown_namespaced_depth; |
48 |
}; |
49 |
|
50 |
Parser* |
51 |
@@ -791,10 +796,14 @@ parser_start_element (Parser *parse |
52 |
} |
53 |
else |
54 |
{ |
55 |
- g_set_error (error, G_MARKUP_ERROR, |
56 |
- G_MARKUP_ERROR_PARSE, |
57 |
- _("Element <%s> not recognized"), |
58 |
- element_name); |
59 |
+ if (strchr (element_name, ':') != NULL) |
60 |
+ /* Passthrough XML-namespaced nodes */ |
61 |
+ parser->unknown_namespaced_depth += 1; |
62 |
+ else if (parser->unknown_namespaced_depth == 0) |
63 |
+ g_set_error (error, G_MARKUP_ERROR, |
64 |
+ G_MARKUP_ERROR_PARSE, |
65 |
+ _("Element <%s> not recognized"), |
66 |
+ element_name); |
67 |
} |
68 |
|
69 |
return TRUE; |
70 |
@@ -844,6 +853,15 @@ parser_end_element (Parser *parser, |
71 |
if (parser->node_stack == NULL) |
72 |
parser->result = top; /* We are done, store the result */ |
73 |
} |
74 |
+ else if (strchr (element_name, ':') != NULL) |
75 |
+ { |
76 |
+ /* Passthrough XML-namespaced nodes */ |
77 |
+ parser->unknown_namespaced_depth -= 1; |
78 |
+ } |
79 |
+ else if (parser->unknown_namespaced_depth > 0) |
80 |
+ { |
81 |
+ /* pass through unknown elements underneath a namespace */ |
82 |
+ } |
83 |
else |
84 |
g_assert_not_reached (); /* should have had an error on start_element */ |
85 |
|
86 |
--- dbus/dbus-glib-tool.c 2008-03-13 08:31:21.000000000 -0400 |
87 |
+++ dbus/dbus-glib-tool.c 2008-03-13 08:32:15.000000000 -0400 |
88 |
@@ -414,7 +414,7 @@ main (int argc, char **argv) |
89 |
&error); |
90 |
if (node == NULL) |
91 |
{ |
92 |
- lose_gerror (_("Unable to load \"%s\""), error); |
93 |
+ lose (_("Unable to load \"%s\": %s"), filename, error->message); |
94 |
} |
95 |
else |
96 |
{ |
97 |
|
98 |
|
99 |
|
100 |
-- |
101 |
gentoo-commits@l.g.o mailing list |