From b84eaab3fb165df687e3f6f4333badede5f2f27fab80b80cc55a0b10aede4a94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= Date: Mon, 4 Oct 2021 12:13:33 +0000 Subject: [PATCH] Accepting request 922998 from home:bnavigator:branches:devel:languages:python - Update to 0.7.4 * relax dependencies for most users #72 * show records by date filter * handling of invalid dates #43 * handling of malformed evtx files * pin dependencies due to py2 deprecation #67 * testing on pytest 4 - Drop pytest4.patch merged upstream - Fix rpmlint alternative link errors - Fix missing python2-xml requirement OBS-URL: https://build.opensuse.org/request/show/922998 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-evtx?expand=0&rev=22 --- pytest4.patch | 60 ---------------------------------------- python-evtx-0.6.1.tar.gz | 3 -- python-evtx-0.7.4.tar.gz | 3 ++ python-evtx.changes | 14 ++++++++++ python-evtx.spec | 43 ++++++++++++++-------------- 5 files changed, 38 insertions(+), 85 deletions(-) delete mode 100644 pytest4.patch delete mode 100644 python-evtx-0.6.1.tar.gz create mode 100644 python-evtx-0.7.4.tar.gz diff --git a/pytest4.patch b/pytest4.patch deleted file mode 100644 index 2a8188a..0000000 --- a/pytest4.patch +++ /dev/null @@ -1,60 +0,0 @@ ---- a/tests/fixtures.py -+++ b/tests/fixtures.py -@@ -21,7 +21,7 @@ def system_path(): - - - @pytest.yield_fixture --def system(): -+def system(system_path): - ''' - yields the contents of the system.evtx test file. - the returned value is a memory map of the contents, -@@ -30,8 +30,7 @@ def system(): - Returns: - mmap.mmap: the contents of the test file. - ''' -- p = system_path() -- with open(p, 'rb') as f: -+ with open(system_path, 'rb') as f: - with contextlib.closing(mmap.mmap(f.fileno(), 0, - access=mmap.ACCESS_READ)) as buf: - yield buf -@@ -52,7 +51,7 @@ def security_path(): - - - @pytest.yield_fixture --def security(): -+def security(security_path): - ''' - yields the contents of the security.evtx test file. - the returned value is a memory map of the contents, -@@ -61,8 +60,7 @@ def security(): - Returns: - mmap.mmap: the contents of the test file. - ''' -- p = security_path() -- with open(p, 'rb') as f: -+ with open(security_path, 'rb') as f: - with contextlib.closing(mmap.mmap(f.fileno(), 0, - access=mmap.ACCESS_READ)) as buf: - yield buf ---- a/tests/test_records.py -+++ b/tests/test_records.py -@@ -248,7 +248,7 @@ def test_parse_record(system): - ['EndOfStreamNode']]]]], - ['Substitutions', None, [ - ['WstringTypeNode', 'System'], -- ['WstringTypeNode', 'C:\Windows\System32\Winevt\Logs\Archive-System-2012-03-14-04-17-39-932.evtx']]]]]]]]]]] -+ ['WstringTypeNode', 'C:\\Windows\\System32\\Winevt\\Logs\\Archive-System-2012-03-14-04-17-39-932.evtx']]]]]]]]]]] - - assert extract_structure(record.root()) == expected - -@@ -264,7 +264,7 @@ def test_render_record(system): - chunk = one(fh.chunks()) - record = one(chunk.records()) - -- xml = record.xml() -+ xml = record.xml() - assert xml == textwrap.dedent('''\ - - 105 diff --git a/python-evtx-0.6.1.tar.gz b/python-evtx-0.6.1.tar.gz deleted file mode 100644 index d3596cc..0000000 --- a/python-evtx-0.6.1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4fc8604242dfe68929a77d45de4ff2f6f3b14593c0de984128478edf2a532302 -size 295127 diff --git a/python-evtx-0.7.4.tar.gz b/python-evtx-0.7.4.tar.gz new file mode 100644 index 0000000..1f62b37 --- /dev/null +++ b/python-evtx-0.7.4.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ecf3c1736ec9e080ddd1c64b6dad23c756e20d54bd30acc21245b9706258fdd9 +size 446141 diff --git a/python-evtx.changes b/python-evtx.changes index eaba201..bddfd95 100644 --- a/python-evtx.changes +++ b/python-evtx.changes @@ -1,3 +1,17 @@ +------------------------------------------------------------------- +Mon Oct 4 08:29:55 UTC 2021 - Ben Greiner + +- Update to 0.7.4 + * relax dependencies for most users #72 + * show records by date filter + * handling of invalid dates #43 + * handling of malformed evtx files + * pin dependencies due to py2 deprecation #67 + * testing on pytest 4 +- Drop pytest4.patch merged upstream +- Fix rpmlint alternative link errors +- Fix missing python2-xml requirement + ------------------------------------------------------------------- Tue May 26 06:34:09 UTC 2020 - Petr Gajdos diff --git a/python-evtx.spec b/python-evtx.spec index e9281b2..01bdee1 100644 --- a/python-evtx.spec +++ b/python-evtx.spec @@ -1,7 +1,7 @@ # # spec file for package python-evtx # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,27 +18,31 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define commands dump dump_chunk_slack eid_record_numbers extract_record filter_records info record_structure structure templates +%bcond_without python2 Name: python-evtx -Version: 0.6.1 +Version: 0.7.4 Release: 0 Summary: Windows Event Log files parser License: Apache-2.0 URL: https://github.com/williballenthin/python-evtx Source: https://github.com/williballenthin/python-evtx/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz -# PATCH-FIX-UPSTREAM pytest4.patch gh#williballenthin/python-evtx#66 mcepl@suse.com -# make the test suite pass under pytest 4 -Patch0: pytest4.patch BuildRequires: %{python_module hexdump} BuildRequires: %{python_module lxml} BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} +%if %{with python2} +BuildRequires: python2-xml +%endif BuildRequires: dos2unix BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-hexdump Requires: python-lxml +%ifpython2 +Requires: python-xml +%endif Requires(post): update-alternatives -Requires(postun): update-alternatives +Requires(postun):update-alternatives BuildArch: noarch %python_subpackages @@ -71,27 +75,22 @@ done %pytest %post -for c in %{commands}; do - %python_install_alternative evtx_$c.py -done +%{lua:for c in rpm.expand("%{commands}"):gmatch("%S+") do + print(rpm.expand("%python_install_alternative evtx_" .. c .. ".py")) +end} %postun -for c in %{commands}; do - %python_uninstall_alternative evtx_$c.py -done +%{lua:for c in rpm.expand("%{commands}"):gmatch("%S+") do + print(rpm.expand("%python_uninstall_alternative evtx_" .. c .. ".py")) +end} %files %{python_files} %license LICENSE.TXT %doc README.md -%{python_sitelib}/* -%python_alternative %{_bindir}/evtx_dump.py -%python_alternative %{_bindir}/evtx_dump_chunk_slack.py -%python_alternative %{_bindir}/evtx_eid_record_numbers.py -%python_alternative %{_bindir}/evtx_extract_record.py -%python_alternative %{_bindir}/evtx_filter_records.py -%python_alternative %{_bindir}/evtx_info.py -%python_alternative %{_bindir}/evtx_record_structure.py -%python_alternative %{_bindir}/evtx_structure.py -%python_alternative %{_bindir}/evtx_templates.py +%{python_sitelib}/Evtx +%{python_sitelib}/python_evtx-%{version}*-info +%{lua:for c in rpm.expand("%{commands}"):gmatch("%S+") do + print(rpm.expand("%python_alternative %{_bindir}/evtx_" .. c .. ".py")) +end} %changelog