From nobody Sun Jul 9 10:46:26 2023 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QzP2B73DWz4lq2J; Sun, 9 Jul 2023 10:46:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QzP2B3zvDz4bdj; Sun, 9 Jul 2023 10:46:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688899586; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kMwHdmF9BBPUFK3ccryl5shhZmbh7OeBatdtawxpEGc=; b=ldVCeo69VDUNovbYDWEXodUfzQ/HPA9RXQ6TfVYqtNsSDq3u2A5shQPLKLkVl1PoGiEr0T tKi4Ech0GQ9K31p7ClDJpq7oAECMi0xyOuWMffHRNVEpMmy02HK4II2mycfUIUXs0dBXwv baXVexlKHUQyDJ6azzV98QYBM6NEU/J4GpZLVmQjMGNPCPQsSGPozfLtb/IjF95zyx533L FahGYLUF/m/B9dyVIvV2Pp59KeaowM83edIJBJMXYKEe7m/ewnfC5Nhg5l/56qaleyc/im TCqUjFXrXLlGRXqRPtZdR6KDkazxf209U1/mlptKSGgLiud+GWoTURqSJp96BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688899586; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kMwHdmF9BBPUFK3ccryl5shhZmbh7OeBatdtawxpEGc=; b=L/s2ZMvIpzXpwuXQWV2W5No2bkkQ3As8X907rRVmEd+bBFNjKDEgGV1OIsNUpTfHmIAexg R3adWkEumyUc1rI7S17V2ZuGapYwBllgvY6M1PQ7eYdvFDn0r2orKXiQ5rDuTHkwmMKOui ZtiP0gUBMmDq/hFfWdhONaeLS99pY2sGayGMszx+OFkSU+LODR82Egi638jhm6hkuERcKm sVzjbLa+oZiPyqBTkAtLciSL26G7x0dWQu8Iu/JZ8ugFqzYjN4NM3WdYNOaHvxhcwsAXXm +Qcb5vT/6+Y2A6Zvs49q7gNVtjkeFzqffWEmP4JwIiXr1EEIpcxkmt1sDnBlsQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1688899586; a=rsa-sha256; cv=none; b=uJAQfSj2VvtlCBi4Im7R5INJeiYelDFb8hpmqa4aVLcFzs3D9mJAGU5MIqmzjGsdSZFF0f dzD7Kw8bov5kWBjA6kiRzrytCkCpdmzRe2rxjt3FnGvVNgjacUaad/lY44Nt72mJ7BBDAM EYYsZiBtLSe+MkH71V6LoAAuZ8W+sIJ55D2FSgvOOcDZbp1NbaSwBFmaLYiml5exZmW544 tqMQxeMy/lWUVo+LCc+CJoHBkuOZyQM2os3pP39jqzhLfICC1vjrwNDP2mrazRTQN9W2ZH 9nJhD9I/a3vSHP5desW5CMx1m1nUuHnau+LDHVpJAL+1BvYUbyhmHu8xV+3LGA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QzP2B3542z10Xy; Sun, 9 Jul 2023 10:46:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 369AkQI3085035; Sun, 9 Jul 2023 10:46:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 369AkQTI085034; Sun, 9 Jul 2023 10:46:26 GMT (envelope-from git) Date: Sun, 9 Jul 2023 10:46:26 GMT Message-Id: <202307091046.369AkQTI085034@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Po-Chuan Hsieh Subject: git: e93acc87c3f1 - main - news/sabnzbd: Update to 4.0.2 List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sunpoet X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e93acc87c3f167677ba187bb3934f7de780df844 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by sunpoet: URL: https://cgit.FreeBSD.org/ports/commit/?id=e93acc87c3f167677ba187bb3934f7de780df844 commit e93acc87c3f167677ba187bb3934f7de780df844 Author: Po-Chuan Hsieh AuthorDate: 2023-07-09 10:31:57 +0000 Commit: Po-Chuan Hsieh CommitDate: 2023-07-09 10:31:57 +0000 news/sabnzbd: Update to 4.0.2 - Add py-sabctools 7.1.0 support [1] PR: 272071 Approved by: James French (maintainer) Obtained from: https://github.com/sabnzbd/sabnzbd/commit/a179f2a895259e49f3679405ad59cac06e0bf2d9 [1] --- news/sabnzbd/Makefile | 4 +- news/sabnzbd/distinfo | 6 +- news/sabnzbd/files/patch-sabctools | 115 +++++++++++++++++++++++++++++++++++++ 3 files changed, 120 insertions(+), 5 deletions(-) diff --git a/news/sabnzbd/Makefile b/news/sabnzbd/Makefile index d2c4a0de46c5..e1cc10adb619 100644 --- a/news/sabnzbd/Makefile +++ b/news/sabnzbd/Makefile @@ -1,5 +1,5 @@ PORTNAME= sabnzbd -DISTVERSION= 4.0.0 +DISTVERSION= 4.0.2 CATEGORIES= news MASTER_SITES= https://github.com/sabnzbd/sabnzbd/releases/download/${DISTVERSION}/ DISTNAME= SABnzbd-${DISTVERSION}-src @@ -19,7 +19,7 @@ RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}cheetah3>=0:devel/py-cheetah3@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}feedparser>=6.0.0:textproc/py-feedparser@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}portend>=0:net/py-portend@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}sqlite3>=0:databases/py-sqlite3@${PY_FLAVOR} \ - ${PYTHON_PKGNAMEPREFIX}sabctools>=0:news/py-sabctools@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}sabctools>=7.1.0<7.1.0_99:news/py-sabctools@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}guessit>0:multimedia/py-guessit@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}puremagic>0:sysutils/py-puremagic@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}pysocks>0:net/py-pysocks@${PY_FLAVOR} \ diff --git a/news/sabnzbd/distinfo b/news/sabnzbd/distinfo index 38ad0171ffc8..6433ee11ccf8 100644 --- a/news/sabnzbd/distinfo +++ b/news/sabnzbd/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1682683069 -SHA256 (SABnzbd-4.0.0-src.tar.gz) = 32e6073a238d25747ef86919ff0804725cf59ddbcfab60c812e21c998ce2ed71 -SIZE (SABnzbd-4.0.0-src.tar.gz) = 5079964 +TIMESTAMP = 1688165296 +SHA256 (SABnzbd-4.0.2-src.tar.gz) = 2783f225057031869dff74f7eb191f54f35e8abe60906fcaaa94ab7772166c4e +SIZE (SABnzbd-4.0.2-src.tar.gz) = 5081392 diff --git a/news/sabnzbd/files/patch-sabctools b/news/sabnzbd/files/patch-sabctools new file mode 100644 index 000000000000..a9d0ee784c29 --- /dev/null +++ b/news/sabnzbd/files/patch-sabctools @@ -0,0 +1,115 @@ +Obtained from: https://github.com/sabnzbd/sabnzbd/commit/a179f2a895259e49f3679405ad59cac06e0bf2d9 + +--- requirements.txt.orig 2023-06-07 19:24:42 UTC ++++ requirements.txt +@@ -1,6 +1,6 @@ + # Main requirements + # Note that not all sub-dependencies are listed, but only ones we know could cause trouble +-sabctools==7.0.2 ++sabctools==7.1.0 + cheetah3==3.2.6.post1 + cffi==1.15.1 + pycparser==2.21 +--- sabnzbd/assembler.py.orig 2023-06-07 19:24:42 UTC ++++ sabnzbd/assembler.py +@@ -27,6 +27,7 @@ from threading import Thread + import ctypes + from typing import Tuple, Optional, List + ++import sabctools + import sabnzbd + from sabnzbd.misc import get_all_passwords, match_str + from sabnzbd.filesystem import ( +@@ -160,13 +161,21 @@ class Assembler(Thread): + + @staticmethod + def assemble(nzo: NzbObject, nzf: NzbFile, file_done: bool): +- """Assemble a NZF from its table of articles +- 1) Partial write: write what we have +- 2) Nothing written before: write all +- """ ++ """Assemble a NZF from its table of articles""" + ++ # When a file exists, we cannot use "w+b" ++ if os.path.exists(nzf.filepath): ++ open_mode = "r+b" ++ file_sparse = True ++ else: ++ open_mode = "w+b" ++ file_sparse = False ++ + # We write large article-sized chunks, so we can safely skip the buffering of Python +- with open(nzf.filepath, "ab", buffering=0) as fout: ++ with open(nzf.filepath, open_mode, buffering=0) as fout: ++ # Track position, so we can prevent a seek if writing continuous ++ file_position = 0 ++ + for article in nzf.decodetable: + # Break if deleted during writing + if nzo.status is Status.DELETED: +@@ -178,9 +187,25 @@ class Assembler(Thread): + + # Write all decoded articles + if article.decoded: ++ # On first write try to make the file sparse ++ if not file_sparse and article.file_size is not None and article.file_size > 0: ++ file_sparse = True ++ try: ++ sabctools.sparse(fout, article.file_size) ++ except: ++ logging.debug("Failed to make %s sparse with length %d", nzf.filepath, article.file_size) ++ logging.debug("Traceback: ", exc_info=True) ++ + data = sabnzbd.ArticleCache.load_article(article) + # Could be empty in case nzo was deleted + if data: ++ if article.data_begin is not None: ++ # Seek ahead if needed ++ if article.data_begin != file_position: ++ fout.seek(article.data_begin) ++ file_position = article.data_begin + len(data) ++ else: ++ fout.seek(0, os.SEEK_END) + fout.write(data) + nzf.update_crc32(article.crc32, len(data)) + article.on_disk = True +--- sabnzbd/constants.py.orig 2023-06-07 19:24:42 UTC ++++ sabnzbd/constants.py +@@ -49,7 +49,7 @@ RENAMES_FILE = "__renames__" + ATTRIB_FILE = "SABnzbd_attrib" + REPAIR_REQUEST = "repair-all.sab" + +-SABCTOOLS_VERSION_REQUIRED = "7.0.2" ++SABCTOOLS_VERSION_REQUIRED = "7.1.0" + + DB_HISTORY_VERSION = 1 + DB_HISTORY_NAME = "history%s.db" % DB_HISTORY_VERSION +--- sabnzbd/decoder.py.orig 2023-06-07 19:24:42 UTC ++++ sabnzbd/decoder.py +@@ -172,7 +172,7 @@ def decode(article: Article, raw_data: bytearray): + + def decode_yenc(article: Article, data: bytearray) -> bytearray: + # Let SABCTools do all the heavy lifting +- yenc_filename, article.data_begin, article.data_size, crc_correct = sabctools.yenc_decode(data) ++ yenc_filename, article.file_size, article.data_begin, article.data_size, crc_correct = sabctools.yenc_decode(data) + + nzf = article.nzf + # Assume it is yenc +--- sabnzbd/nzbstuff.py.orig 2023-06-07 19:24:42 UTC ++++ sabnzbd/nzbstuff.py +@@ -163,6 +163,7 @@ ArticleSaver = ( + "bytes", + "lowest_partnum", + "decoded", ++ "file_size", + "data_begin", + "data_size", + "on_disk", +@@ -187,6 +188,7 @@ class Article(TryList): + self.fetcher_priority: int = 0 + self.tries: int = 0 # Try count + self.decoded: bool = False ++ self.file_size: Optional[int] = None + self.data_begin: Optional[int] = None + self.data_size: Optional[int] = None + self.on_disk: bool = False