From 31beacaf6fdc745e8eda64858396f89796320042 Mon Sep 17 00:00:00 2001 From: Alexey Dokuchaev Date: Wed, 31 May 2023 12:47:58 +0000 Subject: net-p2p/py-ed2k-tools: add rudimentary support for TAG_TYPE_BLOB While most common eDonkey2000's .part.met tags are integers and strings, there could be other data embedded in them, like binary data blobs. Ignore (skip) them for now rather than choking on. While here, use a better way to detect if supplied argument is a directory. --- .../py-ed2k-tools/files/patch-ed2k__metutils.py | 33 +++++++++++++++++----- net-p2p/py-ed2k-tools/files/patch-temp__summary.py | 20 +++++++++---- 2 files changed, 40 insertions(+), 13 deletions(-) diff --git a/net-p2p/py-ed2k-tools/files/patch-ed2k__metutils.py b/net-p2p/py-ed2k-tools/files/patch-ed2k__metutils.py index 7cd01f6f60d3..7c4cfa1ac8ee 100644 --- a/net-p2p/py-ed2k-tools/files/patch-ed2k__metutils.py +++ b/net-p2p/py-ed2k-tools/files/patch-ed2k__metutils.py @@ -1,6 +1,6 @@ --- ed2k_metutils.py.orig 2003-05-06 11:53:14 UTC +++ ed2k_metutils.py -@@ -6,7 +6,6 @@ +@@ -6,24 +6,24 @@ # tested on macosx 10.2.4, python 2.2 import struct; @@ -8,9 +8,10 @@ import sys; # Some defines. -@@ -14,16 +13,16 @@ import sys; + TAG_TYPE_STRING = 2; TAG_TYPE_INTEGER = 3; ++TAG_TYPE_BLOB = 7 -TAG_HANDLE_FILENAME = chr( 1 ); -TAG_HANDLE_FILESIZE = chr( 2 ); @@ -35,7 +36,7 @@ class MetFile: """Class designed to hold the data of a .part.met file.""" -@@ -39,7 +38,7 @@ class MetFile: +@@ -39,7 +39,7 @@ class MetFile: # a .part file must exist, even if it's empty. The same doesn't apply for new overnet. self.version = 225; self.modDate = 0; @@ -44,7 +45,7 @@ return; header_struct = "