Accepting request 174784 from home:matwey:branches:devel:languages:python

- Add split_debug.patch: reason why do we want to do so is to use
  python-construct in embedded applications like rpmlint-mini

OBS-URL: https://build.opensuse.org/request/show/174784
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-construct?expand=0&rev=3
This commit is contained in:
Matwey Kornilov 2013-05-08 07:42:14 +00:00 committed by Git OBS Bridge
parent ed83aea323
commit d9aeca6d4e
3 changed files with 49 additions and 1 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed May 8 07:40:30 UTC 2013 - matwey.kornilov@gmail.com
- Add split_debug.patch: reason why do we want to do so is to use
python-construct in embedded applications like rpmlint-mini
-------------------------------------------------------------------
Tue Apr 30 11:30:15 UTC 2013 - speilicke@suse.com

View File

@ -23,6 +23,8 @@ Summary: A powerful declarative parser/builder for binary data
Url: http://construct.readthedocs.org
Group: Development/Languages/Python
Source: http://pypi.python.org/packages/source/c/construct/construct-%{version}.tar.gz
# PATCH-FEATURE-OPENSUSE split_debug.patch matwey.kornilov@gmail.com -- make debug.py non-loadable
Patch0: split_debug.patch
BuildRequires: python-devel
BuildRequires: python-six
Requires: python-six
@ -43,6 +45,7 @@ and in the other direction, convert ("build") objects into binary data.
%prep
%setup -q -n construct-%{version}
%patch0 -p1
%build
python setup.py build
@ -55,4 +58,3 @@ python setup.py install --prefix=%{_prefix} --root=%{buildroot}
%doc LICENSE README.rst
%{python_sitelib}/*
%changelog

40
split_debug.patch Normal file
View File

@ -0,0 +1,40 @@
Index: construct-2.5.0/construct/__init__.py
===================================================================
--- construct-2.5.0.orig/construct/__init__.py 2013-01-13 17:06:31.000000000 +0400
+++ construct-2.5.0/construct/__init__.py 2013-05-06 13:46:33.634105595 +0400
@@ -35,7 +35,6 @@
SNInt8, SeqOfOne, String, SymmetricMapping, UBInt16, UBInt32, UBInt64, UBInt8, ULInt16, ULInt32, ULInt64,
ULInt8, UNInt16, UNInt32, UNInt64, UNInt8)
from construct.lib.expr import this
-from construct.debug import Probe, Debugger
from construct.version import version, version_string as __version__
@@ -61,14 +60,14 @@
'AdaptationError', 'Adapter', 'Alias', 'Aligned', 'AlignedStruct', 'Anchor', 'Array', 'ArrayError',
'BFloat32', 'BFloat64', 'Bit', 'BitField', 'BitIntegerAdapter', 'BitIntegerError', 'BitStreamReader',
'BitStreamWriter', 'BitStruct', 'Bitwise', 'Buffered', 'CString', 'CStringAdapter', 'ConstAdapter',
- 'ConstError', 'Construct', 'ConstructError', 'Container', 'Debugger', 'Embedded', 'EmbeddedBitStruct',
+ 'ConstError', 'Construct', 'ConstructError', 'Container', 'Embedded', 'EmbeddedBitStruct',
'Enum', 'ExprAdapter', 'Field', 'FieldError', 'Flag', 'FlagsAdapter', 'FlagsContainer', 'FlagsEnum',
'FormatField', 'GreedyRange', 'HexDumpAdapter', 'HexString', 'If', 'IfThenElse', 'IndexingAdapter',
'LFloat32', 'LFloat64', 'LazyBound', 'LazyContainer', 'LengthValueAdapter', 'ListContainer', 'Magic',
'MappingAdapter', 'MappingError', 'MetaArray', 'MetaField', 'NFloat32', 'NFloat64', 'Nibble', 'NoneOf',
'Octet', 'OnDemand', 'OnDemandPointer', 'OneOf', 'OpenRange', 'Optional', 'OptionalGreedyRange',
'OverwriteError', 'Packer', 'PaddedStringAdapter', 'Padding', 'PaddingAdapter', 'PaddingError',
- 'PascalString', 'Pass', 'Peek', 'Pointer', 'PrefixedArray', 'Probe', 'Range', 'RangeError', 'Reconfig',
+ 'PascalString', 'Pass', 'Peek', 'Pointer', 'PrefixedArray', 'Range', 'RangeError', 'Reconfig',
'Rename', 'RepeatUntil', 'Restream', 'SBInt16', 'SBInt32', 'SBInt64', 'SBInt8', 'SLInt16', 'SLInt32',
'SLInt64', 'SLInt8', 'SNInt16', 'SNInt32', 'SNInt64', 'SNInt8', 'Select', 'SelectError', 'SeqOfOne',
'Sequence', 'SizeofError', 'SlicingAdapter', 'StaticField', 'String', 'StringAdapter', 'Struct',
@@ -77,3 +76,10 @@
'ULInt8', 'UNInt16', 'UNInt32', 'UNInt64', 'UNInt8', 'Union', 'ValidationError', 'Validator', 'Value',
'this', 'Bits', 'Byte', 'Bytes', 'Const', 'Tunnel', 'Embed',
]
+
+try:
+ from construct.debug import Probe, Debugger
+ __all__ = __all__ + ['Debugger', 'Probe']
+except ImportError:
+ pass
+