[Python-modules-commits] r1978 - in /packages/pyyaml/trunk/debian: patches/ patches/pyyaml_3.04.patch rules

kitterma-guest at users.alioth.debian.org kitterma-guest at users.alioth.debian.org
Wed Apr 4 21:15:58 UTC 2007


Author: kitterma-guest
Date: Wed Apr  4 21:15:58 2007
New Revision: 1978

URL: http://svn.debian.org/wsvn/python-modules/?sc=1&rev=1978
Log:
pyyaml - added patch system and recommended patch set

Added:
    packages/pyyaml/trunk/debian/patches/
    packages/pyyaml/trunk/debian/patches/pyyaml_3.04.patch
Modified:
    packages/pyyaml/trunk/debian/rules

Added: packages/pyyaml/trunk/debian/patches/pyyaml_3.04.patch
URL: http://svn.debian.org/wsvn/python-modules/packages/pyyaml/trunk/debian/patches/pyyaml_3.04.patch?rev=1978&op=file
==============================================================================
--- packages/pyyaml/trunk/debian/patches/pyyaml_3.04.patch (added)
+++ packages/pyyaml/trunk/debian/patches/pyyaml_3.04.patch Wed Apr  4 21:15:58 2007
@@ -1,0 +1,116 @@
+--- pyyaml-3.04.orig/ext/_yaml.pyx
++++ pyyaml-3.04/ext/_yaml.pyx
+@@ -651,6 +651,11 @@
+ 
+     def check_node(self):
+         self._parse_next_event()
++        # Bug #87575 - changeset 233
++        if self.parsed_event.type == YAML_STREAM_START_EVENT: 
++            yaml_event_delete(&self.parsed_event) 
++            self._parse_next_event() 
++        # /changeset 233
+         if self.parsed_event.type != YAML_STREAM_END_EVENT:
+             return True
+         return False
+@@ -661,9 +666,7 @@
+             return self._compose_document()
+ 
+     cdef object _compose_document(self):
+-        if self.parsed_event.type == YAML_STREAM_START_EVENT:
+-            yaml_event_delete(&self.parsed_event)
+-            self._parse_next_event()
++        # Bug #87575 - changeset 233 code deleted
+         yaml_event_delete(&self.parsed_event)
+         node = self._compose_node(None, None)
+         self._parse_next_event()
+--- pyyaml-3.04.orig/lib/yaml/composer.py
++++ pyyaml-3.04/lib/yaml/composer.py
+@@ -14,6 +14,11 @@
+         self.anchors = {}
+ 
+     def check_node(self):
++        # Bug #87575 - changeset 233
++        # Drop the STREAM-START event. 
++        if self.check_event(StreamStartEvent): 
++            self.get_event()
++        # /changeset233
+         # If there are more documents available?
+         return not self.check_event(StreamEndEvent)
+ 
+@@ -24,10 +29,7 @@
+ 
+     def compose_document(self):
+ 
+-        # Drop the STREAM-START event.
+-        if self.check_event(StreamStartEvent):
+-            self.get_event()
+-
++        # Bug #87575 - changeset 233 - code deleted
+         # Drop the DOCUMENT-START event.
+         self.get_event()
+ 
+--- pyyaml-3.04.orig/lib/yaml/resolver.py
++++ pyyaml-3.04/lib/yaml/resolver.py
+@@ -32,6 +32,19 @@
+     add_implicit_resolver = classmethod(add_implicit_resolver)
+ 
+     def add_path_resolver(cls, tag, path, kind=None):
++        # Bug #87575 changeset 246: comment added
++        # Note: `add_path_resolver` is experimental.  The API could be changed. 
++        # `new_path` is a pattern that is matched against the path from the 
++        # root to the node that is being considered.  `node_path` elements are 
++        # tuples `(node_check, index_check)`.  `node_check` is a node class: 
++        # `ScalarNode`, `SequenceNode`, `MappingNode` or `None`.  `None` 
++        # matches any kind of a node.  `index_check` could be `None`, a boolean 
++        # value, a string value, or a number.  `None` and `False` match against 
++        # any _value_ of sequence and mapping nodes.  `True` matches against 
++        # any _key_ of a mapping node.  A string `index_check` matches against 
++        # a mapping value that corresponds to a scalar key which content is 
++        # equal to the `index_check` value.  An integer `index_check` matches 
++        # against a sequence value with the index equal to `index_check`.
+         if not 'yaml_path_resolvers' in cls.__dict__:
+             cls.yaml_path_resolvers = cls.yaml_path_resolvers.copy()
+         new_path = []
+@@ -113,13 +126,16 @@
+                 return
+         if index_check is True and current_index is not None:
+             return
+-        if index_check in [False, None] and current_index is None:
++        # Bug #87575 changeset 246 modifies one line:
++        if (index_check is False or index_check is None)    \
++                and current_index is None:
+             return
+         if isinstance(index_check, basestring):
+             if not (isinstance(current_index, ScalarNode)
+                     and index_check == current_index.value):
+                 return
+-        elif isinstance(index_check, int):
++        # Bug #87575 changeset 246 modifies one line:
++        elif isinstance(index_check, int) and not isinstance(index_check, bool):
+             if index_check != current_index:
+                 return
+         return True
+--- pyyaml-3.04.orig/lib/yaml/constructor.py
++++ pyyaml-3.04/lib/yaml/constructor.py
+@@ -300,9 +300,10 @@
+                 (?P<hour>[0-9][0-9]?)
+                 :(?P<minute>[0-9][0-9])
+                 :(?P<second>[0-9][0-9])
+-                (?:(?P<fraction>\.[0-9]*))?
++                (?:\.(?P<fraction>[0-9]*))?
+                 (?:[ \t]*(?P<tz>Z|(?P<tz_sign>[-+])(?P<tz_hour>[0-9][0-9]?)
+                 (?::(?P<tz_minute>[0-9][0-9]))?))?)?$''', re.X)
++                # Bug #87575 changeset 234 line 302 changed
+ 
+     def construct_yaml_timestamp(self, node):
+         value = self.construct_scalar(node)
+@@ -318,7 +319,8 @@
+         second = int(values['second'])
+         fraction = 0
+         if values['fraction']:
+-            fraction = int(float(values['fraction'])*1000000)
++            # Bug #87575 changeset 234 line changed:
++            fraction = int(values['fraction'][:6].ljust(6, '0'))
+         delta = None
+         if values['tz_sign']:
+             tz_hour = int(values['tz_hour'])

Modified: packages/pyyaml/trunk/debian/rules
URL: http://svn.debian.org/wsvn/python-modules/packages/pyyaml/trunk/debian/rules?rev=1978&op=diff
==============================================================================
--- packages/pyyaml/trunk/debian/rules (original)
+++ packages/pyyaml/trunk/debian/rules Wed Apr  4 21:15:58 2007
@@ -5,3 +5,4 @@
 
 include /usr/share/cdbs/1/rules/debhelper.mk
 include /usr/share/cdbs/1/class/python-distutils.mk
+include /usr/share/cdbs/1/rules/simple-patchsys.mk




More information about the Python-modules-commits mailing list