diff --git a/devel/brz/Makefile b/devel/brz/Makefile index 57dd3f5a1cdf..6e02594a3070 100644 --- a/devel/brz/Makefile +++ b/devel/brz/Makefile @@ -1,57 +1,57 @@ PORTNAME= brz DISTVERSION= 3.2.2 -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= devel MASTER_SITES= PYPI PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} DISTNAME= breezy-${PORTVERSION} MAINTAINER= fullermd@over-yonder.net COMMENT= Distributed version control system based on bzr WWW= https://www.breezy-vcs.org/ LICENSE= GPLv2+ LICENSE_FILE= ${WRKSRC}/COPYING.txt BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}configobj>=0:devel/py-configobj@${PY_FLAVOR} RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}configobj>=0:devel/py-configobj@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}fastbencode>=0:devel/py-fastbencode@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}launchpadlib>=0:devel/py-launchpadlib@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}patiencediff>=0:textproc/py-patiencediff@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}six>=0:devel/py-six@${PY_FLAVOR} TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}testtools>=0:devel/py-testtools@${PY_FLAVOR} -USES= gettext python shebangfix +USES= gettext-tools python shebangfix USE_PYTHON= autoplist concurrent cython0 distutils SHEBANG_FILES= brz MAKE_ENV= BRZ_LOG=/dev/null PLIST_FILES= bin/bzr OPTIONS_DEFINE= CA_BUNDLE DULWICH SFTP OPTIONS_DEFAULT= CA_BUNDLE DULWICH CA_BUNDLE_DESC= Include CA bundle for SSL cert validation DULWICH_DESC= Depend on Dulwich for git support SFTP_DESC= Paramiko for SFTP support CA_BUNDLE_RUN_DEPENDS= ${LOCALBASE}/share/certs/ca-root-nss.crt:security/ca_root_nss DULWICH_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}dulwich>=0:devel/py-dulwich@${PY_FLAVOR} SFTP_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}paramiko>=0:security/py-paramiko@${PY_FLAVOR} post-patch: @${REINPLACE_CMD} -e 's|man/man1|share/man/man1|' ${WRKSRC}/setup.py @${RM} ${WRKSRC}/breezy/*_pyx.c ${WRKSRC}/breezy/bzr/*_pyx.c post-install: ${INSTALL_MAN} ${WRKSRC}/brz.1 ${STAGEDIR}${PREFIX}/share/man/man1 ${STRIP_CMD} \ ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/breezy/*.so \ ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/breezy/bzr/*.so ${RLN} ${STAGEDIR}${PREFIX}/bin/brz ${STAGEDIR}${PREFIX}/bin/bzr do-test: cd ${WRKSRC} && ./brz selftest .include diff --git a/devel/brz/files/patch-breezy_bzr_index.py b/devel/brz/files/patch-breezy_bzr_index.py new file mode 100644 index 000000000000..90c152ed45bc --- /dev/null +++ b/devel/brz/files/patch-breezy_bzr_index.py @@ -0,0 +1,11 @@ +--- breezy/bzr/index.py.orig 2021-12-07 02:24:26 UTC ++++ breezy/bzr/index.py +@@ -165,7 +165,7 @@ class GraphIndexBuilder(object): + if self._key_length != len(key): + raise BadIndexKey(key) + for element in key: +- if not element or type(element) != bytes or _whitespace_re.search(element) is not None: ++ if not element or not isinstance(element, bytes) or _whitespace_re.search(element) is not None: + raise BadIndexKey(key) + + def _external_references(self): diff --git a/devel/brz/files/patch-breezy_git_dir.py b/devel/brz/files/patch-breezy_git_dir.py new file mode 100644 index 000000000000..a9f8ece87173 --- /dev/null +++ b/devel/brz/files/patch-breezy_git_dir.py @@ -0,0 +1,11 @@ +--- breezy/git/dir.py.orig 2022-02-02 23:16:49 UTC ++++ breezy/git/dir.py +@@ -67,7 +67,7 @@ class GitControlDirFormat(ControlDirFormat): + fixed_components = True + + def __eq__(self, other): +- return type(self) == type(other) ++ return type(self) is type(other) + + def is_supported(self): + return True diff --git a/devel/brz/files/patch-breezy_git_mapping.py b/devel/brz/files/patch-breezy_git_mapping.py new file mode 100644 index 000000000000..ba016a10b16f --- /dev/null +++ b/devel/brz/files/patch-breezy_git_mapping.py @@ -0,0 +1,11 @@ +--- breezy/git/mapping.py.orig 2022-01-23 23:17:50 UTC ++++ breezy/git/mapping.py +@@ -160,7 +160,7 @@ class BzrGitMapping(foreign.VcsMapping): + super(BzrGitMapping, self).__init__(foreign_vcs_git) + + def __eq__(self, other): +- return (type(self) == type(other) ++ return (type(self) is type(other) + and self.revid_prefix == other.revid_prefix) + + @classmethod diff --git a/devel/brz/files/patch-breezy_git_repository.py b/devel/brz/files/patch-breezy_git_repository.py new file mode 100644 index 000000000000..3c0125cd20b4 --- /dev/null +++ b/devel/brz/files/patch-breezy_git_repository.py @@ -0,0 +1,11 @@ +--- breezy/git/repository.py.orig 2022-02-02 23:16:49 UTC ++++ breezy/git/repository.py +@@ -352,7 +352,7 @@ class LocalGitRepository(GitRepository): + return list(ret) + + def _get_parents(self, revid, no_alternates=False): +- if type(revid) != bytes: ++ if not isinstance(revid, bytes): + raise ValueError + try: + (hexsha, mapping) = self.lookup_bzr_revision_id(revid) diff --git a/devel/brz/files/patch-breezy_lockdir.py b/devel/brz/files/patch-breezy_lockdir.py new file mode 100644 index 000000000000..dd5e756167c4 --- /dev/null +++ b/devel/brz/files/patch-breezy_lockdir.py @@ -0,0 +1,11 @@ +--- breezy/lockdir.py.orig 2021-12-07 02:24:26 UTC ++++ breezy/lockdir.py +@@ -803,7 +803,7 @@ class LockHeldInfo(object): + + def __eq__(self, other): + """Equality check for lock holders.""" +- if type(self) != type(other): ++ if not isinstance(self, type(other)): + return False + return self.info_dict == other.info_dict + diff --git a/devel/brz/files/patch-breezy_plugin.py b/devel/brz/files/patch-breezy_plugin.py new file mode 100644 index 000000000000..dbf80fedbbad --- /dev/null +++ b/devel/brz/files/patch-breezy_plugin.py @@ -0,0 +1,10 @@ +--- breezy/plugin.py.orig 2026-06-28 22:29:17 UTC ++++ breezy/plugin.py +@@ -38,7 +38,6 @@ import sys + import re + import sys + +-import imp + from importlib import util as importlib_util + + import breezy diff --git a/devel/brz/files/patch-breezy_tests_test__selftest.py b/devel/brz/files/patch-breezy_tests_test__selftest.py new file mode 100644 index 000000000000..239478aa7a8d --- /dev/null +++ b/devel/brz/files/patch-breezy_tests_test__selftest.py @@ -0,0 +1,13 @@ +--- breezy/tests/test_selftest.py.orig 2021-12-07 02:24:26 UTC ++++ breezy/tests/test_selftest.py +@@ -1249,8 +1249,8 @@ class TestRunner(tests.TestCase): + def test_verbose_test_count(self): + """A verbose test run reports the right test count at the start""" + suite = TestUtil.TestSuite([ +- unittest.FunctionTestCase(lambda:None), +- unittest.FunctionTestCase(lambda:None)]) ++ unittest.FunctionTestCase(lambda: None), ++ unittest.FunctionTestCase(lambda: None)]) + self.assertEqual(suite.countTestCases(), 2) + stream = StringIO() + runner = tests.TextTestRunner(stream=stream, verbosity=2) diff --git a/devel/brz/files/patch-breezy_tests_test__setup.py b/devel/brz/files/patch-breezy_tests_test__setup.py new file mode 100644 index 000000000000..02322a46f1a1 --- /dev/null +++ b/devel/brz/files/patch-breezy_tests_test__setup.py @@ -0,0 +1,24 @@ +--- breezy/tests/test_setup.py.orig 2022-03-20 00:01:04 UTC ++++ breezy/tests/test_setup.py +@@ -16,11 +16,12 @@ + + """Test for setup.py build process""" + +-from distutils import version + import os + import sys + import subprocess + ++from packaging.version import Version ++ + import breezy + from .. import tests + +@@ -90,6 +91,6 @@ class TestDistutilsVersion(tests.TestCase): + def test_version_with_string(self): + # We really care about two pyrex specific versions and our ability to + # detect them +- lv = version.LooseVersion ++ lv = Version + self.assertTrue(lv("0.9.4.1") < lv('0.17.beta1')) + self.assertTrue(lv("0.9.6.3") < lv('0.10')) diff --git a/devel/brz/files/patch-breezy_transport_http_response.py b/devel/brz/files/patch-breezy_transport_http_response.py new file mode 100644 index 000000000000..55b9ed097513 --- /dev/null +++ b/devel/brz/files/patch-breezy_transport_http_response.py @@ -0,0 +1,29 @@ +--- breezy/transport/http/response.py.orig 2021-12-07 02:24:26 UTC ++++ breezy/transport/http/response.py +@@ -21,7 +21,6 @@ responses. + responses. + """ + +-import cgi + from io import BytesIO + import os + import http.client as http_client +@@ -383,10 +382,15 @@ def handle_response(url, code, getheader, data): + # being of type 'application/octet-stream' as per RFC2616 section + # 7.2.1. + # Therefore it is obviously not multipart +- content_type = getheader('content-type', 'application/octet-stream') +- mimetype, options = cgi.parse_header(content_type) ++ content_type = getheader("content-type", "application/octet-stream") ++ from email.message import EmailMessage ++ ++ msg = EmailMessage() ++ msg["content-type"] = content_type ++ params = msg["content-type"].params ++ mimetype = msg.get_content_type() + if mimetype == 'multipart/byteranges': +- rfile.set_boundary(options['boundary'].encode('ascii')) ++ rfile.set_boundary(params['boundary'].encode('ascii')) + else: + # A response to a range request, but not multipart + content_range = getheader('content-range', None) diff --git a/devel/brz/files/patch-breezy_transport_http_urllib.py b/devel/brz/files/patch-breezy_transport_http_urllib.py new file mode 100644 index 000000000000..d0a8fbe7e7ca --- /dev/null +++ b/devel/brz/files/patch-breezy_transport_http_urllib.py @@ -0,0 +1,24 @@ +--- breezy/transport/http/urllib.py.orig 2021-12-07 02:24:26 UTC ++++ breezy/transport/http/urllib.py +@@ -24,7 +24,6 @@ import base64 + DEBUG = 0 + + import base64 +-import cgi + import errno + import os + import re +@@ -1903,8 +1902,11 @@ class HttpTransport(ConnectedTransport): + def text(self): + if self.status == 204: + return None +- charset = cgi.parse_header( +- self._actual.headers['Content-Type'])[1].get('charset') ++ from email.message import EmailMessage ++ ++ msg = EmailMessage() ++ msg["content-type"] = self._actual.headers["Content-Type"] ++ charset = msg["content-type"].params.get("charset") + if charset: + return self.data.decode(charset) + else: