summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaphaël Hertzog <raphael@offensive-security.com>2021-01-27 06:48:04 -0800
committerRaphaël Hertzog <raphael@offensive-security.com>2021-01-27 06:48:04 -0800
commitfeace7e3715fb5212c71d2d910c47966a61b9733 (patch)
treecebf1aafcb2c6ac93e22116b58842e5773dc5840
parent633324a673ba0a86e8862afb45eedc4a99bad278 (diff)
parent658e5cf084b2e80989c37e63421f657638af2e77 (diff)
pytsk (20200117-3) unstable; urgency=medium
* Team upload. [ Sophie Brun ] * Refresh patches * Import upstream patch to generate correct binding code with sleuthkit >=4.8 (Closes: #971149) [ Debian Janitor ] * Apply multi-arch hints. + python3-tsk: Add Multi-Arch: same. [ Raphaël Hertzog ] * Allow failure of reprotest job * Bump Standards-Version to 4.5.1 * Update watch file format version to 4. [dgit import unpatched pytsk 20200117-3]
-rw-r--r--debian/changelog241
-rw-r--r--debian/clean2
-rw-r--r--debian/control23
-rw-r--r--debian/copyright62
-rw-r--r--debian/gbp.conf15
-rw-r--r--debian/patches/0001-Link-system-tsk-statically-talloc-dynamically-instea.patch97
-rw-r--r--debian/patches/change-lexer.patch175
-rw-r--r--debian/patches/series2
-rw-r--r--debian/python3-tsk.docs1
-rwxr-xr-xdebian/rules25
-rw-r--r--debian/salsa-ci.yml7
-rw-r--r--debian/source/format1
-rw-r--r--debian/tests/autopkgtest-pkg-python.conf1
-rw-r--r--debian/upstream/metadata5
-rw-r--r--debian/watch3
15 files changed, 660 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..e3e7e26
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,241 @@
+pytsk (20200117-3) unstable; urgency=medium
+
+ * Team upload.
+
+ [ Sophie Brun ]
+ * Refresh patches
+ * Import upstream patch to generate correct binding code with
+ sleuthkit >=4.8 (Closes: #971149)
+
+ [ Debian Janitor ]
+ * Apply multi-arch hints. + python3-tsk: Add Multi-Arch: same.
+
+ [ Raphaël Hertzog ]
+ * Allow failure of reprotest job
+ * Bump Standards-Version to 4.5.1
+ * Update watch file format version to 4.
+
+ -- Raphaël Hertzog <raphael@offensive-security.com> Wed, 27 Jan 2021 15:48:04 +0100
+
+pytsk (20200117-2) unstable; urgency=medium
+
+ * Team upload
+ * Bump DH to 13
+ * Add new Build-Dependeds libvhdi-dev and libvmdk-dev (closes: #969315)
+ * d/t/autopkgtest-pkg-python.conf: Create file to describe correct import_name
+
+ -- Samuel Henrique <samueloph@debian.org> Sat, 05 Sep 2020 14:01:33 +0100
+
+pytsk (20200117-1) unstable; urgency=medium
+
+ [ Samuel Henrique ]
+ * Configure git-buildpackage for Debian
+
+ [ Debian Janitor ]
+ * Use secure copyright file specification URI.
+ * Bump debhelper from old 11 to 12.
+ * Set debhelper-compat version in Build-Depends.
+ * Set upstream metadata fields: Bug-Database, Bug-Submit, Repository,
+ Repository-Browse.
+ * Update standards version to 4.5.0, no changes needed.
+ * Remove Section on python3-tsk that duplicates source.
+
+ [ Hilko Bengen ]
+ * New upstream version 20200117
+ * Rebase patch
+
+ -- Hilko Bengen <bengen@debian.org> Thu, 27 Aug 2020 23:27:38 +0200
+
+pytsk (20190507-1.1) unstable; urgency=low
+
+ * Non-maintainer upload.
+ * Remove the Python 2 bindings. (Closes: #938291)
+
+ [ Samuel Henrique ]
+ * Add salsa-ci.yml
+
+ -- Adrian Bunk <bunk@debian.org> Sun, 19 Jan 2020 00:22:33 +0200
+
+pytsk (20190507-1) unstable; urgency=medium
+
+ * New upstream version 20190507
+
+ -- Hilko Bengen <bengen@debian.org> Wed, 08 May 2019 10:06:10 +0200
+
+pytsk (20190316-1) unstable; urgency=medium
+
+ * New upstream version 20190316
+ * Rebase patch
+
+ -- Hilko Bengen <bengen@debian.org> Sun, 21 Apr 2019 19:10:21 +0200
+
+pytsk (20190121-2) unstable; urgency=medium
+
+ * Add patch to make the build compatible with -Wl,--as-needed, thanks to
+ Steve Langasek (Closes: #889525)
+
+ -- Hilko Bengen <bengen@debian.org> Mon, 28 Jan 2019 19:15:48 +0100
+
+pytsk (20190121-1) unstable; urgency=medium
+
+ * New upstream version 20190121
+ * Update patch
+
+ -- Hilko Bengen <bengen@debian.org> Tue, 22 Jan 2019 15:22:27 +0100
+
+pytsk (20180225-2) unstable; urgency=medium
+
+ * Use Source:Package in built-using generation to fix FTBFS if sluethkit
+ has been binnNMU'd; thanks to Peter Green (Closes: #916895)
+ * Drop unneeded dh --parallel parameter
+ * Bump Debhelper compat level
+ * Replace dh_install --fail-missing
+ * Bump Standards-Version
+ * No longer try to install now missing examples
+
+ -- Hilko Bengen <bengen@debian.org> Mon, 24 Dec 2018 17:33:25 +0100
+
+pytsk (20180225-1) unstable; urgency=medium
+
+ * Team upload
+ [ Raphaël Hertzog ]
+ * Update team maintainer address to Debian Security Tools
+ <team+pkg-security@tracker.debian.org>
+ * Update Vcs-Git and Vcs-Browser for the move to salsa.debian.org
+
+ [ Hilko Bengen ]
+ * New upstream version 20180225
+ * Rebase build patch
+ * Bump Standards-Version
+
+ -- Hilko Bengen <bengen@debian.org> Sat, 31 Mar 2018 19:56:47 +0200
+
+pytsk (20171108-1) unstable; urgency=medium
+
+ * New upstream version 20171108
+ * Rebase patch
+
+ -- Hilko Bengen <bengen@debian.org> Thu, 09 Nov 2017 22:32:01 +0100
+
+pytsk (20170802-3) unstable; urgency=medium
+
+ * Add missing build-dependencies for linking
+
+ -- Hilko Bengen <bengen@debian.org> Sat, 16 Sep 2017 18:29:43 +0200
+
+pytsk (20170802-2) unstable; urgency=medium
+
+ * Link libtsk statically, add Built-Using entry (Closes: #873374)
+ * Modernize package: DH compat level, Standards-Version, Vcs-Git URL
+
+ -- Hilko Bengen <bengen@debian.org> Sat, 16 Sep 2017 16:30:52 +0200
+
+pytsk (20170802-1) unstable; urgency=medium
+
+ * New upstream version 20170802
+ * Rework setup.py patch
+
+ -- Hilko Bengen <bengen@debian.org> Tue, 01 Aug 2017 12:59:08 +0200
+
+pytsk (20170508-1) unstable; urgency=medium
+
+ * New upstream version 20170508
+
+ -- Hilko Bengen <bengen@debian.org> Tue, 09 May 2017 09:28:28 +0200
+
+pytsk (20170128-1) unstable; urgency=medium
+
+ * New upstream version 20170128
+ * Update patch
+ * Bump Standards-Version
+
+ -- Hilko Bengen <bengen@debian.org> Sun, 29 Jan 2017 10:44:56 +0100
+
+pytsk (20161109-1) unstable; urgency=medium
+
+ * New upstream version 20161109
+ * Rebase patch
+
+ -- Hilko Bengen <bengen@debian.org> Thu, 10 Nov 2016 10:43:23 +0100
+
+pytsk (20160721-1) unstable; urgency=medium
+
+ * New upstream version
+ * Update patch
+
+ -- Hilko Bengen <bengen@debian.org> Fri, 22 Jul 2016 08:29:51 +0200
+
+pytsk (20160325-1) unstable; urgency=medium
+
+ * New upstream version
+ * Update patch
+
+ -- Hilko Bengen <bengen@debian.org> Mon, 28 Mar 2016 17:30:27 +0200
+
+pytsk (20160318-1) unstable; urgency=medium
+
+ * New upstream version
+ * Do not embed talloc, (patched) sleuthkit into pytsk
+ * The package can now actually be built from source again
+ * No longer depend on autoconf
+
+ -- Hilko Bengen <bengen@debian.org> Sat, 19 Mar 2016 22:44:32 +0100
+
+pytsk (20160312-2) unstable; urgency=medium
+
+ * Add setuptools build-dependency
+
+ -- Hilko Bengen <bengen@debian.org> Thu, 17 Mar 2016 22:50:44 +0100
+
+pytsk (20160312-1) unstable; urgency=medium
+
+ * New upstream version
+
+ -- Hilko Bengen <bengen@debian.org> Thu, 17 Mar 2016 22:28:50 +0100
+
+pytsk (20160111-2) unstable; urgency=medium
+
+ * Update debian/watch
+ * Add pytsk build-dependency (Closes: #811000)
+ * Don't install anything from /usr/share/doc/pytsk
+
+ -- Hilko Bengen <bengen@debian.org> Thu, 14 Jan 2016 19:59:05 +0100
+
+pytsk (20160111-1) unstable; urgency=medium
+
+ * New upstream version
+ * Drop GCC5 patch that has been integrated upstream
+
+ -- Hilko Bengen <bengen@debian.org> Wed, 13 Jan 2016 22:44:14 +0100
+
+pytsk (20150406-5) unstable; urgency=medium
+
+ * Update build depends, depends to include python3 dependency for
+ python3-tsk. Thanks to Scott Kitterman (Closes: #809475)
+
+ -- Hilko Bengen <bengen@debian.org> Tue, 05 Jan 2016 18:16:15 +0100
+
+pytsk (20150406-4) unstable; urgency=medium
+
+ * Add python3-tsk package
+
+ -- Hilko Bengen <bengen@debian.org> Thu, 29 Oct 2015 00:01:55 +0100
+
+pytsk (20150406-3) unstable; urgency=medium
+
+ * Add upstream patch to deal with GCC 5
+
+ -- Hilko Bengen <bengen@debian.org> Fri, 18 Sep 2015 17:52:47 +0200
+
+pytsk (20150406-2) unstable; urgency=medium
+
+ * Gave package to Debian Forensics team
+ * Added dh-python to Build-Depends
+
+ -- Hilko Bengen <bengen@debian.org> Tue, 04 Aug 2015 18:57:54 +0200
+
+pytsk (20150406-1) unstable; urgency=low
+
+ * Initial release (Closes: #792888)
+
+ -- Hilko Bengen <bengen@debian.org> Sun, 19 Jul 2015 20:10:19 +0200
diff --git a/debian/clean b/debian/clean
new file mode 100644
index 0000000..c09009f
--- /dev/null
+++ b/debian/clean
@@ -0,0 +1,2 @@
+a.out
+pytsk3.c
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..c002bbe
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,23 @@
+Source: pytsk
+Priority: optional
+Maintainer: Debian Security Tools <team+pkg-security@tracker.debian.org>
+Uploaders: Hilko Bengen <bengen@debian.org>
+Build-Depends: debhelper-compat (= 13), dh-python,
+ pkg-config, python3-all-dev, libtsk-dev, libtalloc-dev,
+ python3-setuptools,
+ libafflib-dev, libewf-dev, zlib1g-dev,
+ libvhdi-dev, libvmdk-dev
+Standards-Version: 4.5.1
+Section: python
+Homepage: https://github.com/py4n6/pytsk/
+Vcs-Git: https://salsa.debian.org/pkg-security-team/pytsk.git
+Vcs-Browser: https://salsa.debian.org/pkg-security-team/pytsk
+
+Package: python3-tsk
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, ${python3:Depends}
+Built-Using: ${misc:Built-Using}
+Multi-Arch: same
+Description: Python Bindings for The Sleuth Kit
+ This package contains Python 3 bindings to libtsk3, the shared library
+ that provides all the functionality of The Sleuth Kit.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..edd7513
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,62 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: pytsk
+Source: https://github.com/py4n6/pytsk/
+
+Files: *
+Copyright: 2010-2013 Michael Cohen <scudette@gmail.com>
+License: Apache-2.0
+
+Files: generate_bindings.py
+Copyright: 2012 Joachim Metz <joachim.metz@gmail.com>
+License: Apache-2.0
+
+Files: run_tests.py
+Copyright: 2012 Kristinn Gudjonsson <kiddi@kiddaland.net>
+ 2013 Joachim Metz <joachim.metz@gmail.com>
+License: Apache-2.0
+
+Files: tests/*
+Copyright: 2013 Joachim Metz <joachim.metz@gmail.com>
+License: Apache-2.0
+
+Files: talloc/*
+Copyright: 2004 Andrew Tridgell
+ 2006 Stefan Metzmacher
+License: LGPL-3.0+
+
+Files: debian/*
+Copyright: 2015 Hilko Bengen <bengen@debian.org>
+License: Apache-2.0
+
+License: Apache-2.0
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+ .
+ https://www.apache.org/licenses/LICENSE-2.0
+ .
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ .
+ On Debian systems, the complete text of the Apache version 2.0 license
+ can be found in "/usr/share/common-licenses/Apache-2.0".
+
+License: LGPL-3.0+
+ This package is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 3 of the License, or (at your option) any later version.
+ .
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
+ .
+ On Debian systems, the complete text of the GNU Lesser General
+ Public License can be found in "/usr/share/common-licenses/LGPL-3".
diff --git a/debian/gbp.conf b/debian/gbp.conf
new file mode 100644
index 0000000..23ae3db
--- /dev/null
+++ b/debian/gbp.conf
@@ -0,0 +1,15 @@
+[DEFAULT]
+debian-branch = debian/master
+pristine-tar = True
+
+[buildpackage]
+sign-tags = True
+
+[import-orig]
+filter-pristine-tar = True
+
+[pq]
+patch-numbers = False
+
+[dch]
+multimaint-merge = True
diff --git a/debian/patches/0001-Link-system-tsk-statically-talloc-dynamically-instea.patch b/debian/patches/0001-Link-system-tsk-statically-talloc-dynamically-instea.patch
new file mode 100644
index 0000000..87f8a1b
--- /dev/null
+++ b/debian/patches/0001-Link-system-tsk-statically-talloc-dynamically-instea.patch
@@ -0,0 +1,97 @@
+From: Hilko Bengen <bengen@debian.org>
+Date: Sat, 19 Mar 2016 22:31:25 +0100
+Subject: Link system tsk (statically),
+ talloc (dynamically) instead of embedding
+
+Forwarded: not-needed
+---
+ setup.py | 47 ++++++++++++-----------------------------------
+ 1 file changed, 12 insertions(+), 35 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index a5fbc0d..1a2da3d 100755
+--- a/setup.py
++++ b/setup.py
+@@ -245,9 +245,9 @@ class BuildExtCommand(build_ext):
+ def run(self):
+ compiler = new_compiler(compiler=self.compiler)
+ # pylint: disable=attribute-defined-outside-init
+- self.define = self.configure_source_tree(compiler)
++ self.define = [("HAVE_TSK_LIBTSK_H", "")]
+
+- libtsk_path = os.path.join("sleuthkit", "tsk")
++ libtsk_path = "/usr/include/tsk"
+
+ if not os.access("pytsk3.c", os.R_OK):
+ # Generate the Python binding code (pytsk3.c).
+@@ -269,7 +269,7 @@ class BuildExtCommand(build_ext):
+ class SDistCommand(sdist):
+ """Custom handler for generating source dist."""
+ def run(self):
+- libtsk_path = os.path.join("sleuthkit", "tsk")
++ libtsk_path = "/usr/include/tsk"
+
+ # sleuthkit submodule is not there, probably because this has been
+ # freshly checked out.
+@@ -356,35 +356,10 @@ class UpdateCommand(Command):
+ subprocess.check_call(["git", "apply", patch_file], cwd="sleuthkit")
+
+ def run(self):
+- subprocess.check_call(["git", "stash"], cwd="sleuthkit")
+-
+- subprocess.check_call(["git", "submodule", "init"])
+- subprocess.check_call(["git", "submodule", "update"])
+-
+- print("Updating sleuthkit")
+- subprocess.check_call(["git", "reset", "--hard"], cwd="sleuthkit")
+- subprocess.check_call(["git", "clean", "-x", "-f", "-d"], cwd="sleuthkit")
+- subprocess.check_call(["git", "checkout", "master"], cwd="sleuthkit")
+- subprocess.check_call(["git", "pull"], cwd="sleuthkit")
+- if self.use_head:
+- print("Pulling from HEAD")
+- else:
+- print("Pulling from tag: {0:s}".format(self._SLEUTHKIT_GIT_TAG))
+- subprocess.check_call(["git", "fetch", "--tags"], cwd="sleuthkit")
+- git_tag_path = "tags/sleuthkit-{0:s}".format(self._SLEUTHKIT_GIT_TAG)
+- subprocess.check_call(["git", "checkout", git_tag_path], cwd="sleuthkit")
+-
+- self.patch_sleuthkit()
+-
+- compiler_type = distutils.ccompiler.get_default_compiler()
+- if compiler_type != "msvc":
+- subprocess.check_call(["./bootstrap"], cwd="sleuthkit")
+-
+- # Now derive the version based on the date.
+ with open("version.txt", "w") as fd:
+ fd.write(self.version)
+
+- libtsk_path = os.path.join("sleuthkit", "tsk")
++ libtsk_path = "/usr/include/tsk"
+
+ # Generate the Python binding code (pytsk3.c).
+ libtsk_header_files = [
+@@ -418,16 +393,18 @@ class ProjectBuilder(object):
+ # The args for the extension builder.
+ self.extension_args = {
+ "define_macros": [],
+- "include_dirs": ["talloc", self._libtsk_path, "sleuthkit", "."],
++ "include_dirs": ["."],
+ "library_dirs": [],
+- "libraries": []}
++ "libraries": [ "talloc" ],
++ "extra_link_args": [
++ "-Wl,-Bstatic", "-ltsk", "-Wl,-Bdynamic",
++ "-lafflib", "-lewf", "-lstdc++", "-lz",
++ "-lvmdk", "-lvhdi",
++ ]}
+
+ # The sources to build.
+ self._source_files = [
+- "class.c", "error.c", "tsk3.c", "pytsk3.c", "talloc/talloc.c"]
+-
+- # Path to the top of the unpacked sleuthkit sources.
+- self._sleuthkit_path = "sleuthkit"
++ "class.c", "error.c", "tsk3.c", "pytsk3.c"]
+
+ def build(self):
+ """Build everything."""
diff --git a/debian/patches/change-lexer.patch b/debian/patches/change-lexer.patch
new file mode 100644
index 0000000..e37940d
--- /dev/null
+++ b/debian/patches/change-lexer.patch
@@ -0,0 +1,175 @@
+From: Sophie Brun <sophie@offensive-security.com>
+Date: Wed, 27 Jan 2021 07:58:24 +0100
+Subject: Changes to lexer to better handle recursive structs of libtsk
+
+Origin: https://github.com/py4n6/pytsk/commit/923dd422cd1152548db79192db2dff8324ab4d50
+Bug: https://github.com/py4n6/pytsk/issues/71
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=971149
+
+sleuthkit (libtsk) version 4.8 breaks the generation of TSK_FS_INFO.
+---
+ class_parser.py | 18 +++++++++++-------
+ lexer.py | 21 +++++++++++----------
+ 2 files changed, 22 insertions(+), 17 deletions(-)
+
+diff --git a/class_parser.py b/class_parser.py
+index db140f3..be994dc 100644
+--- a/class_parser.py
++++ b/class_parser.py
+@@ -235,7 +235,7 @@ import lexer
+ DEBUG = 0
+
+ # The pytsk3 version.
+-VERSION = "20200117"
++VERSION = "20210126"
+
+ # These functions are used to manage library memory.
+ FREE = "aff4_free"
+@@ -2022,7 +2022,7 @@ class Wrapper(Type):
+
+
+ class PointerWrapper(Wrapper):
+- """ A pointer to a wrapped class """
++ """A pointer to a wrapped class """
+
+ def __init__(self, name, type, *args, **kwargs):
+ type = type.split()[0]
+@@ -2062,7 +2062,7 @@ class PointerWrapper(Wrapper):
+
+
+ class StructWrapper(Wrapper):
+- """ A wrapper for struct classes """
++ """A wrapper for struct classes """
+ active = False
+
+ def __init__(self, name, type, *args, **kwargs):
+@@ -3316,7 +3316,7 @@ class ProxiedMethod(Method):
+
+
+ class StructConstructor(ConstructorMethod):
+- """ A constructor for struct wrappers - basically just allocate
++ """A constructor for struct wrappers - basically just allocate
+ memory for the struct.
+ """
+
+@@ -3414,7 +3414,7 @@ class ClassGenerator(object):
+ return result
+
+ def prepare(self):
+- """ This method is called just before we need to write the
++ """This method is called just before we need to write the
+ output and allows us to do any last minute fixups.
+ """
+ pass
+@@ -4147,6 +4147,7 @@ class HeaderParser(lexer.SelfFeederMixIn):
+ # we cant handle them at all)
+ ["(RECURSIVE_)?STRUCT", "(struct|union)\s+([_A-Za-z0-9]+)?\s*{", "PUSH_STATE", "RECURSIVE_STRUCT"],
+ ["RECURSIVE_STRUCT", "}\s+[0-9A-Za-z]+", "POP_STATE", None],
++ ["RECURSIVE_STRUCT", "};", "POP_STATE", None],
+
+ # Process enums (2 forms - named and typedefed)
+ ["INITIAL", r"enum\s+([0-9A-Za-z_]+)\s+{", "PUSH_STATE,ENUM_START", "ENUM"],
+@@ -4168,10 +4169,13 @@ class HeaderParser(lexer.SelfFeederMixIn):
+
+ ]
+
+- def __init__(self, name, verbose=1, base=""):
++ def __init__(self, name, verbose=0, base=""):
++ if DEBUG > 0:
++ verbose = 1
++
+ self.module = Module(name)
+ self.base = base
+- super(HeaderParser, self).__init__(verbose=0)
++ super(HeaderParser, self).__init__(verbose=verbose)
+
+ file_object = io.BytesIO(
+ b"// Base object\n"
+diff --git a/lexer.py b/lexer.py
+index cd62899..2993074 100644
+--- a/lexer.py
++++ b/lexer.py
+@@ -16,6 +16,7 @@
+ """A simple feed lexer."""
+
+ import re
++import sys
+
+
+ class Lexer(object):
+@@ -75,7 +76,7 @@ class Lexer(object):
+ error = self.error,
+ )
+ if self.verbose > 1:
+- print("Saving state {0:s}".format(self.processed))
++ sys.stderr.write("Saving state {0:s}\n".format(self.processed))
+
+ def restore_state(self):
+ state = self.saved_state
+@@ -92,7 +93,7 @@ class Lexer(object):
+ self.error = state["error"]
+
+ if self.verbose > 1:
+- print("Restoring state to offset {0:s}".format(self.processed))
++ sys.stderr.write("Restoring state to offset {0:s}\n".format(self.processed))
+
+ def next_token(self, end=True):
+ ## Now try to match any of the regexes in order:
+@@ -101,12 +102,12 @@ class Lexer(object):
+ ## Does the rule apply for us now?
+ if state.match(current_state):
+ if self.verbose > 2:
+- print("{0:s}: Trying to match {1:s} with {2:s}".format(
++ sys.stderr.write("{0:s}: Trying to match {1:s} with {2:s}\n".format(
+ self.state, repr(self.buffer[:10]), repr(re_str)))
+ match = regex.match(self.buffer)
+ if match:
+ if self.verbose > 3:
+- print("{0:s} matched {1:s}".format(
++ sys.stderr.write("{0:s} matched {1:s}\n".format(
+ re_str, match.group(0).encode("utf8")))
+
+ ## The match consumes the data off the buffer (the
+@@ -119,7 +120,7 @@ class Lexer(object):
+ for t in token.split(","):
+ try:
+ if self.verbose > 0:
+- print("0x{0:X}: Calling {1:s} {2:s}".format(
++ sys.stderr.write("0x{0:X}: Calling {1:s} {2:s}\n".format(
+ self.processed, t, repr(match.group(0))))
+ cb = getattr(self, t, self.default_handler)
+ except AttributeError:
+@@ -165,18 +166,18 @@ class Lexer(object):
+
+ def default_handler(self, token, match):
+ if self.verbose > 2:
+- print("Default handler: {0:s} with {1:s}".format(
++ sys.stderr.write("Default handler: {0:s} with {1:s}\n".format(
+ token, repr(match.group(0))))
+
+ def ERROR(self, message=None, weight=1):
+ if self.verbose > 0 and message:
+- print("Error({0:s}): {1:s}".format(weight, message))
++ sys.stderr.write("Error({0:d}): {1!s}\n".format(weight, message))
+
+ self.error += weight
+
+ def PUSH_STATE(self, dummy_token=None, dummy_match=None):
+ if self.verbose > 1:
+- print("Storing state {0:s}".format(self.state))
++ sys.stderr.write("Storing state {0:s}\n".format(self.state))
+
+ self.state_stack.append(self.state)
+
+@@ -184,9 +185,9 @@ class Lexer(object):
+ try:
+ state = self.state_stack.pop()
+ if self.verbose > 1:
+- print("Returned state to {0:s}".format(state))
++ sys.stderr.write("Returned state to {0:s}\n".format(state))
+ except IndexError:
+- print("Tried to pop the state but failed - possible recursion error")
++ sys.stderr.write("Tried to pop the state but failed - possible recursion error\n")
+ state = None
+ return state
+
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..b0221e7
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,2 @@
+0001-Link-system-tsk-statically-talloc-dynamically-instea.patch
+change-lexer.patch
diff --git a/debian/python3-tsk.docs b/debian/python3-tsk.docs
new file mode 100644
index 0000000..e845566
--- /dev/null
+++ b/debian/python3-tsk.docs
@@ -0,0 +1 @@
+README
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..878dc6b
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,25 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+%:
+ dh $@ --with python3 --buildsystem=pybuild
+
+override_dh_compress:
+ dh_compress -X/examples/
+
+override_dh_clean:
+ rm -rf tmp
+ dh_clean
+
+override_dh_missing:
+ dh_missing --fail-missing
+
+override_dh_install:
+ dh_install -X/usr/share/doc/pytsk
+ dpkg-query --show \
+ --showformat 'misc:Built-Using=$${Source:Package} (= $${source:Version})\n' \
+ libtsk-dev \
+ | tee -a debian/python3-tsk.substvars > /dev/null
diff --git a/debian/salsa-ci.yml b/debian/salsa-ci.yml
new file mode 100644
index 0000000..1d8d33b
--- /dev/null
+++ b/debian/salsa-ci.yml
@@ -0,0 +1,7 @@
+---
+include:
+ - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml
+ - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml
+
+reprotest:
+ allow_failure: true
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/tests/autopkgtest-pkg-python.conf b/debian/tests/autopkgtest-pkg-python.conf
new file mode 100644
index 0000000..f8c876a
--- /dev/null
+++ b/debian/tests/autopkgtest-pkg-python.conf
@@ -0,0 +1 @@
+ import_name = pytsk3
diff --git a/debian/upstream/metadata b/debian/upstream/metadata
new file mode 100644
index 0000000..f3448b6
--- /dev/null
+++ b/debian/upstream/metadata
@@ -0,0 +1,5 @@
+---
+Bug-Database: https://github.com/py4n6/pytsk/issues
+Bug-Submit: https://github.com/py4n6/pytsk/issues/new
+Repository: https://github.com/py4n6/pytsk.git
+Repository-Browse: https://github.com/py4n6/pytsk
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..11420f6
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,3 @@
+version=4
+# We have seen 20160111.tgz.tar.gz... ignore the extra ".tgz"
+https://github.com/py4n6/pytsk/releases .*/archive/(20.*?)(?:\.tgz)?\.tar\.gz