[Pkg-utopia-commits] r2246 - in /packages/unstable/dbus-glib/debian: changelog patches/02-ignore-namespaced-nodes-and-attributes.patch

biebl at users.alioth.debian.org biebl at users.alioth.debian.org
Mon Apr 28 22:55:07 UTC 2008


Author: biebl
Date: Mon Apr 28 22:55:07 2008
New Revision: 2246

URL: http://svn.debian.org/wsvn/pkg-utopia/?sc=1&rev=2246
Log:
* debian/patches/02-ignore-namespaced-nodes-and-attributes.patch
  - Ignore namespaced extensions to introspection XML. (Closes: #478265)
    Patch pulled from upstream git.

Added:
    packages/unstable/dbus-glib/debian/patches/02-ignore-namespaced-nodes-and-attributes.patch
Modified:
    packages/unstable/dbus-glib/debian/changelog

Modified: packages/unstable/dbus-glib/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-utopia/packages/unstable/dbus-glib/debian/changelog?rev=2246&op=diff
==============================================================================
--- packages/unstable/dbus-glib/debian/changelog (original)
+++ packages/unstable/dbus-glib/debian/changelog Mon Apr 28 22:55:07 2008
@@ -3,8 +3,11 @@
   * debian/control
     - Add myself to Uploaders.
     - Add Vcs-* fields.
-
- -- Michael Biebl <biebl at debian.org>  Tue, 29 Apr 2008 00:37:53 +0200
+  * debian/patches/02-ignore-namespaced-nodes-and-attributes.patch
+    - Ignore namespaced extensions to introspection XML. (Closes: #478265)
+      Patch pulled from upstream git.
+
+ -- Michael Biebl <biebl at debian.org>  Tue, 29 Apr 2008 00:40:51 +0200
 
 dbus-glib (0.74-3) unstable; urgency=low
 

Added: packages/unstable/dbus-glib/debian/patches/02-ignore-namespaced-nodes-and-attributes.patch
URL: http://svn.debian.org/wsvn/pkg-utopia/packages/unstable/dbus-glib/debian/patches/02-ignore-namespaced-nodes-and-attributes.patch?rev=2246&op=file
==============================================================================
--- packages/unstable/dbus-glib/debian/patches/02-ignore-namespaced-nodes-and-attributes.patch (added)
+++ packages/unstable/dbus-glib/debian/patches/02-ignore-namespaced-nodes-and-attributes.patch Mon Apr 28 22:55:07 2008
@@ -1,0 +1,97 @@
+From bd53ac9f7ef9a6c2c9d1d12af382b1a8a10e9dba Mon Sep 17 00:00:00 2001
+From: Rob Taylor <rob.taylor at codethink.co.uk>
+Date: Mon, 17  Mar  2008  14:10:43  +0000
+Subject: allow namespaced extentions to introspection XML
+
+This allows us to stick namespaced documentation stuff into the introspection
+XML and have dbus-glib not puke on it.
+
+Patch credit goes to Colin Walters.
+---
+diff --git a/dbus/dbus-glib-tool.c b/dbus/dbus-glib-tool.c
+index e2c6a2c..55434de 100644
+--- a/dbus/dbus-glib-tool.c
++++ b/dbus/dbus-glib-tool.c
+@@ -414,7 +414,7 @@ main (int argc, char **argv)
+                                          &error);
+       if (node == NULL)
+         {
+-	  lose_gerror (_("Unable to load \"%s\""), error);
++	  lose (_("Unable to load \"%s\": %s"), filename, error->message);
+         }
+       else
+ 	{
+diff --git a/dbus/dbus-gparser.c b/dbus/dbus-gparser.c
+index f296f96..2520b5b 100644
+--- a/dbus/dbus-gparser.c
++++ b/dbus/dbus-gparser.c
+@@ -128,13 +128,17 @@ locate_attributes (const char  *element_name,
+ 
+       if (!found)
+         {
+-          g_set_error (error,
+-                       G_MARKUP_ERROR,
+-                       G_MARKUP_ERROR_PARSE,
+-                       _("Attribute \"%s\" is invalid on <%s> element in this context"),
+-                       attribute_names[i], element_name);
+-          retval = FALSE;
+-          goto out;
++          /* We want to passthrough namespaced XML nodes that we don't know anything about. */
++          if (strchr (attribute_names[i], ':') == NULL)
++            {
++              g_set_error (error,
++                           G_MARKUP_ERROR,
++                           G_MARKUP_ERROR_PARSE,
++                           _("Attribute \"%s\" is invalid on <%s> element in this context"),
++                           attribute_names[i], element_name);
++              retval = FALSE;
++              goto out;
++            }
+         }
+ 
+       ++i;
+@@ -177,6 +181,7 @@ struct Parser
+   PropertyInfo *property;
+   ArgInfo *arg;
+   gboolean in_annotation;
++  guint unknown_namespaced_depth;
+ };
+ 
+ Parser*
+@@ -791,10 +796,14 @@ parser_start_element (Parser      *parser,
+     }
+   else
+     {
+-      g_set_error (error, G_MARKUP_ERROR,
+-                   G_MARKUP_ERROR_PARSE,
+-                   _("Element <%s> not recognized"),
+-                   element_name);
++      if (strchr (element_name, ':') != NULL)
++        /* Passthrough XML-namespaced nodes */
++        parser->unknown_namespaced_depth += 1;
++      else if (parser->unknown_namespaced_depth == 0)
++        g_set_error (error, G_MARKUP_ERROR,
++                     G_MARKUP_ERROR_PARSE,
++                     _("Element <%s> not recognized"),
++                     element_name);
+     }
+   
+   return TRUE;
+@@ -844,6 +853,15 @@ parser_end_element (Parser      *parser,
+       if (parser->node_stack == NULL)
+         parser->result = top; /* We are done, store the result */      
+     }
++  else if (strchr (element_name, ':') != NULL)
++    {
++      /* Passthrough XML-namespaced nodes */
++      parser->unknown_namespaced_depth -= 1;
++    }
++  else if (parser->unknown_namespaced_depth > 0)
++    {
++		/* pass through unknown elements underneath a namespace */
++    }
+   else
+     g_assert_not_reached (); /* should have had an error on start_element */
+   
+--
+cgit v0.7.2-37-g538c




More information about the Pkg-utopia-commits mailing list