Hello community, here is the log from the commit of package python-pybeam for openSUSE:Factory checked in at 2018-03-26 11:56:12 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-pybeam (Old) and /work/SRC/openSUSE:Factory/.python-pybeam.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pybeam" Mon Mar 26 11:56:12 2018 rev:10 rq:588582 version:0.4.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-pybeam/python-pybeam.changes 2017-09-07 22:09:54.794889450 +0200 +++ /work/SRC/openSUSE:Factory/.python-pybeam.new/python-pybeam.changes 2018-03-26 11:56:13.777608584 +0200 @@ -1,0 +2,6 @@ +Mon Mar 19 11:25:48 UTC 2018 - [email protected] + +- Version 0.4.1: + - Add support for AtU8 chuck (fix Erlang 20.0 beam file format) + +------------------------------------------------------------------- Old: ---- pybeam-0.4.tar.gz New: ---- LICENSE pybeam-0.4.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pybeam.spec ++++++ --- /var/tmp/diff_new_pack.wQQsBG/_old 2018-03-26 11:56:14.789572075 +0200 +++ /var/tmp/diff_new_pack.wQQsBG/_new 2018-03-26 11:56:14.817571064 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-pybeam # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,16 +18,19 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-pybeam -Version: 0.4 +Version: 0.4.1 Release: 0 Summary: Python module to parse Erlang BEAM files License: MIT Group: Development/Languages/Python Url: http://github.com/matwey/pybeam Source: https://files.pythonhosted.org/packages/source/p/pybeam/pybeam-%{version}.tar.gz +Source1: LICENSE +BuildRequires: %{python_module construct < 2.9} BuildRequires: %{python_module construct >= 2.8} BuildRequires: %{python_module devel} BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module six} BuildRequires: python-rpm-macros Requires: python-construct Requires: python-six >= 1.4.0 @@ -42,6 +45,7 @@ %prep %setup -q -n pybeam-%{version} +cp %{S:1} . %build %python_build @@ -51,6 +55,7 @@ %files %{python_files} %defattr(-,root,root,-) +%doc LICENSE %{python_sitelib}/* %changelog ++++++ LICENSE ++++++ The MIT License (MIT) Copyright (c) 2013 Matwey V. Kornilov <[email protected]> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ++++++ pybeam-0.4.tar.gz -> pybeam-0.4.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pybeam-0.4/PKG-INFO new/pybeam-0.4.1/PKG-INFO --- old/pybeam-0.4/PKG-INFO 2017-01-20 20:30:35.000000000 +0100 +++ new/pybeam-0.4.1/PKG-INFO 2018-03-19 12:22:35.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.0 Name: pybeam -Version: 0.4 +Version: 0.4.1 Summary: Python module to parse Erlang BEAM files Home-page: http://github.com/matwey/pybeam Author: Matwey V. Kornilov diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pybeam-0.4/README.md new/pybeam-0.4.1/README.md --- old/pybeam-0.4/README.md 1970-01-01 01:00:00.000000000 +0100 +++ new/pybeam-0.4.1/README.md 2018-03-19 12:22:19.000000000 +0100 @@ -0,0 +1,25 @@ +pybeam +====== +[](https://travis-ci.org/matwey/pybeam) +[](https://badge.fury.io/py/pybeam) + +Python module to parse Erlang BEAM files. + +This is not ready yet, so pull-requests are welcome. + +Quick start: +```python +import pybeam +p=pybeam.BeamFile("/usr/lib64/erlang/lib/appmon-2.1.14.1/ebin/appmon.beam") +print p.imports +print p.exports +print p.atoms +``` + +Both python 2.7 and python 3.3 are supported. Python 3.2 are known not to work. + +## References +* [Erlang BEAM file format](http://www.erlang.se/~bjorn/beam_file_format.html) +* [Erlang external term format](http://erlang.org/doc/apps/erts/erl_ext_dist.html) +* [BEAM file format](http://synrc.com/publications/cat/Functional%20Languages/Erlang/BEAM.pdf) + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pybeam-0.4/pybeam/beam_construct.py new/pybeam-0.4.1/pybeam/beam_construct.py --- old/pybeam-0.4/pybeam/beam_construct.py 2017-01-18 19:11:21.000000000 +0100 +++ new/pybeam-0.4.1/pybeam/beam_construct.py 2018-03-19 12:22:19.000000000 +0100 @@ -22,11 +22,12 @@ # from construct import * -from pybeam.eetf_construct import term, external_term -import codecs +from pybeam.eetf_construct import external_term chunk_atom = PrefixedArray(Int32ub, PascalString(lengthfield = Int8ub, encoding="latin1")) +chunk_atu8 = PrefixedArray(Int32ub, PascalString(lengthfield = Int8ub, encoding="utf8")) + chunk_attr = external_term chunk_cinf = external_term @@ -66,6 +67,7 @@ { # "Abst" : chunk_abst, b"Atom" : chunk_atom, + b"AtU8" : chunk_atu8, b"Attr" : chunk_attr, b"CInf" : chunk_cinf, b"Code" : chunk_code, @@ -81,8 +83,8 @@ default = Bytes(lambda ctx: ctx.size) ), # Aligned(4, ..) - Padding(lambda ctx: (4 - ctx.size % 4) % 4, pattern = b'\00'), - ) + Padding(lambda ctx: (4 - ctx.size % 4) % 4, pattern = b'\00'), + ) beam = Struct( "for1" / Const(b'FOR1'), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pybeam-0.4/pybeam/beam_file.py new/pybeam-0.4.1/pybeam/beam_file.py --- old/pybeam-0.4/pybeam/beam_file.py 2017-01-18 19:11:40.000000000 +0100 +++ new/pybeam-0.4.1/pybeam/beam_file.py 2018-03-19 12:22:19.000000000 +0100 @@ -36,6 +36,10 @@ @property def atoms(self): + try: + return self.selectChunkByName(b"AtU8").payload + except KeyError: + pass return self.selectChunkByName(b"Atom").payload @property diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pybeam-0.4/pybeam/eetf_construct.py new/pybeam-0.4.1/pybeam/eetf_construct.py --- old/pybeam-0.4/pybeam/eetf_construct.py 2017-01-18 19:11:21.000000000 +0100 +++ new/pybeam-0.4.1/pybeam/eetf_construct.py 2018-03-19 12:22:19.000000000 +0100 @@ -31,14 +31,14 @@ class TupleAdapter(Adapter): def _decode(self, obj, ctx): -# we got a list from construct and want to see a tuple + # we got a list from construct and want to see a tuple return tuple(obj) - def _encode(self, obj, ctv): + def _encode(self, obj, ctx): return list(obj) class ListAdapter(Adapter): def _decode(self, obj, ctx): - if type(obj[2]) == type(list()) and obj[2] == []: + if isinstance(obj[2], list) and obj[2] == []: return obj[1] obj[1].append(obj[2]) return obj[1] @@ -157,8 +157,8 @@ "oldindex" / term_, "olduniq" / term_, "free" / Array(this.num_free, term_)), - encoder = lambda obj,ctx: (len(obj.free), obj.pid, obj.module, obj.oldindex, olj.olduniq, obj.free) , - decoder = lambda obj,ctx: Fun(None, None, None, obj[2], obj[3], obj[4], obj[1], obj[5])) + encoder = lambda obj,ctx: (len(obj.free), obj.pid, obj.module, obj.oldindex, obj.olduniq, obj.free) , + decoder = lambda obj,ctx: Fun(None, None, None, obj[2], obj[3], obj[4], obj[1], obj[5])) # new fun to be implemented later new_fun = fun export = ExprAdapter(Sequence("module" / LazyBound(lambda ctx: term), @@ -177,7 +177,7 @@ key_value = ExprAdapter(Sequence(term_,term_), encoder = lambda obj,ctx: obj, decoder = lambda obj,ctx: tuple(obj)) -map = MapAdapter(PrefixedArray(Int32ub, key_value)) +map_ = MapAdapter(PrefixedArray(Int32ub, key_value)) term = ExprAdapter(Sequence("tag" / Int8ub, Switch(this.tag, { @@ -199,7 +199,7 @@ 111: large_big, 114: new_reference, 115: small_atom, - 116: map, + 116: map_, 117: fun, 112: new_fun, 113: export, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pybeam-0.4/pybeam/erlang_types.py new/pybeam-0.4.1/pybeam/erlang_types.py --- old/pybeam-0.4/pybeam/erlang_types.py 2016-10-02 16:34:52.000000000 +0200 +++ new/pybeam-0.4.1/pybeam/erlang_types.py 2018-03-19 12:22:19.000000000 +0100 @@ -22,38 +22,38 @@ from six import iterbytes -class AtomCacheReference: +class AtomCacheReference(object): def __init__(self, index): self.index = index def __eq__(self,other): return self.index == other.index -class Reference: - def __init__(self, node, id, creation): +class Reference(object): + def __init__(self, node, id_, creation): self.node = node - self.id = id + self.id = id_ self.creation = creation def __eq__(self,other): return self.node == other.node and self.id == other.id and self.creation == other.creation -class Port: - def __init__(self, node, id, creation): +class Port(object): + def __init__(self, node, id_, creation): self.node = node - self.id = id + self.id = id_ self.creation = creation def __eq__(self,other): return self.node == other.node and self.id == other.id and self.creation == other.creation -class Pid: - def __init__(self, node, id, serial, creation): +class Pid(object): + def __init__(self, node, id_, serial, creation): self.node = node - self.id = id + self.id = id_ self.serial = serial self.creation = creation def __eq__(self,other): return self.node == other.node and self.id == other.id and self.creation == other.creation and self.serial == other.serial -class String: +class String(object): def __init__(self, value): self.value = value def __eq__(self, other): @@ -63,26 +63,33 @@ def __len__(self): return len(self.value) -class Binary: +class Binary(object): def __init__(self, value): self.value = value def __eq__(self, other): return self.value == other.value -class Fun: +class Fun(object): def __init__(self, arity, uniq, index, module, oldindex, olduniq, pid, free): self.arity = arity self.uniq = uniq self.index = index self.module = module self.oldindex = oldindex - self.olduniq = uniq + self.olduniq = olduniq self.pid = pid self.free = free def __eq__(self, other): - return self.arity == other.arity and self.uniq == other.uniq and self.index == other.index and self.module == other.module and self.oldindex == other.oldindex and self.olduniq == other.uniq and self.pid == other.pid and self.free == other.free + return (self.arity == other.arity + and self.uniq == other.uniq + and self.index == other.index + and self.module == other.module + and self.oldindex == other.oldindex + and self.olduniq == other.olduniq + and self.pid == other.pid + and self.free == other.free) -class MFA: +class MFA(object): def __init__(self, module, function, arity): self.module = module self.function = function @@ -90,7 +97,7 @@ def __eq__(self, other): return self.module == other.module and self.function == other.function and self.arity == other.arity -class BitBinary: +class BitBinary(object): def __init__(self, value, bits): self.value = value self.bits = bits diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pybeam-0.4/pybeam.egg-info/PKG-INFO new/pybeam-0.4.1/pybeam.egg-info/PKG-INFO --- old/pybeam-0.4/pybeam.egg-info/PKG-INFO 2017-01-20 20:30:34.000000000 +0100 +++ new/pybeam-0.4.1/pybeam.egg-info/PKG-INFO 2018-03-19 12:22:35.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.0 Name: pybeam -Version: 0.4 +Version: 0.4.1 Summary: Python module to parse Erlang BEAM files Home-page: http://github.com/matwey/pybeam Author: Matwey V. Kornilov diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pybeam-0.4/pybeam.egg-info/SOURCES.txt new/pybeam-0.4.1/pybeam.egg-info/SOURCES.txt --- old/pybeam-0.4/pybeam.egg-info/SOURCES.txt 2017-01-20 20:30:34.000000000 +0100 +++ new/pybeam-0.4.1/pybeam.egg-info/SOURCES.txt 2018-03-19 12:22:35.000000000 +0100 @@ -1,3 +1,4 @@ +README.md setup.py pybeam/__init__.py pybeam/beam_construct.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pybeam-0.4/pybeam.egg-info/requires.txt new/pybeam-0.4.1/pybeam.egg-info/requires.txt --- old/pybeam-0.4/pybeam.egg-info/requires.txt 2017-01-20 20:30:34.000000000 +0100 +++ new/pybeam-0.4.1/pybeam.egg-info/requires.txt 2018-03-19 12:22:35.000000000 +0100 @@ -1 +1,2 @@ -construct>=2.8 +construct<2.9,>=2.8 +six diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pybeam-0.4/setup.cfg new/pybeam-0.4.1/setup.cfg --- old/pybeam-0.4/setup.cfg 2017-01-20 20:30:35.000000000 +0100 +++ new/pybeam-0.4.1/setup.cfg 2018-03-19 12:22:35.000000000 +0100 @@ -1,5 +1,4 @@ [egg_info] tag_build = tag_date = 0 -tag_svn_revision = 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pybeam-0.4/setup.py new/pybeam-0.4.1/setup.py --- old/pybeam-0.4/setup.py 2017-01-20 20:23:41.000000000 +0100 +++ new/pybeam-0.4.1/setup.py 2018-03-19 12:22:19.000000000 +0100 @@ -1,7 +1,7 @@ from setuptools import setup setup(name='pybeam', - version='0.4', + version='0.4.1', description='Python module to parse Erlang BEAM files', url='http://github.com/matwey/pybeam', author='Matwey V. Kornilov', @@ -9,5 +9,5 @@ license='MIT', packages=['pybeam'], test_suite = 'test', - install_requires=['construct>=2.8'], + install_requires=['construct>=2.8,<2.9', 'six'], zip_safe=False)
