Package: libtorrent-rasterbar Version: 1.2.9-0.3 Severity: normal Tags: patch pending
This is the patch for my 1.2.9-0.3 NMU. I failed to include the BTS #987306 reference to the RC bug fixed by this upload. diff --git a/debian/changelog b/debian/changelog index fac2238e8..a7a0c392a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +libtorrent-rasterbar (1.2.9-0.3) unstable; urgency=medium + + * Non-maintainer upload. + * Added d/patches/ README suggesting patch ordering and naming. + * Added patch from upstream to make python move_storage() match C++ signature + + -- Petter Reinholdtsen <p...@debian.org> Fri, 30 Apr 2021 07:51:42 +0200 + libtorrent-rasterbar (1.2.9-0.2) unstable; urgency=medium * Non-maintainer upload. diff --git a/debian/patches/0001-python-move-storage.patch b/debian/patches/0001-python-move-storage.patch new file mode 100644 index 000000000..eed013288 --- /dev/null +++ b/debian/patches/0001-python-move-storage.patch @@ -0,0 +1,57 @@ +Description: fix regression in python binding for move_storage() +Origin: upstream, commit 386596aa88a19dcba3d4f5925dbce3c517065ea2 +Author: arvidn <ar...@libtorrent.org> +Last-Update: 2021-04-30 +Bugs-Debian: https://bugs.debian.org/987306 + +diff --git a/bindings/python/src/converters.cpp b/bindings/python/src/converters.cpp +index 68ca2cf66..7d9eb1f9b 100644 +--- a/bindings/python/src/converters.cpp ++++ b/bindings/python/src/converters.cpp +@@ -23,6 +23,7 @@ + #include "libtorrent/peer_class.hpp" + #include "libtorrent/pex_flags.hpp" + #include "libtorrent/string_view.hpp" ++#include "libtorrent/storage_defs.hpp" + #include <vector> + #include <map> + +@@ -342,6 +343,30 @@ struct to_strong_typedef + } + }; + ++template<typename T> ++struct to_enum_class ++{ ++ using underlying_type = typename std::underlying_type<T>::type; ++ ++ to_enum_class() ++ { ++ converter::registry::push_back( ++ &convertible, &construct, type_id<T>() ++ ); ++ } ++ ++ static void* convertible(PyObject* x) ++ { ++ return PyNumber_Check(x) ? x : nullptr; ++ } ++ ++ static void construct(PyObject* x, converter::rvalue_from_python_stage1_data* data) ++ { ++ void* storage = ((converter::rvalue_from_python_storage<T>*)data)->storage.bytes; ++ data->convertible = new (storage) T(static_cast<T>(static_cast<underlying_type>(extract<underlying_type>(object(borrowed(x)))))); ++ } ++}; ++ + template<class T> + struct from_bitfield_flag + { +@@ -495,6 +520,7 @@ void bind_converters() + to_strong_typedef<lt::file_index_t>(); + to_strong_typedef<lt::port_mapping_t>(); + to_strong_typedef<lt::peer_class_t>(); ++ to_enum_class<lt::move_flags_t>(); + to_bitfield_flag<lt::torrent_flags_t>(); + to_bitfield_flag<lt::peer_flags_t>(); + to_bitfield_flag<lt::peer_source_flags_t>(); diff --git a/debian/patches/README b/debian/patches/README new file mode 100644 index 000000000..80c158437 --- /dev/null +++ b/debian/patches/README @@ -0,0 +1,3 @@ +0xxx: Grabbed from upstream development. +1xxx: Possibly relevant for upstream adoption. +2xxx: Only relevant for official Debian release. diff --git a/debian/patches/series b/debian/patches/series index 682a66f02..91feb9475 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1 +1,2 @@ +0001-python-move-storage.patch fix-html-docs.patch -- Happy hacking Petter Reinholdtsen