git: b669d2e5ce77 - main - devel/brz: Fix with python 3.12
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 30 Jun 2026 00:47:08 UTC
The branch main has been updated by vvd:
URL: https://cgit.FreeBSD.org/ports/commit/?id=b669d2e5ce777497122c29c3bffe45f62fdfa1f0
commit b669d2e5ce777497122c29c3bffe45f62fdfa1f0
Author: Matthew D. Fuller <fullermd@over-yonder.net>
AuthorDate: 2026-06-30 00:43:50 +0000
Commit: Vladimir Druzenko <vvd@FreeBSD.org>
CommitDate: 2026-06-30 00:43:50 +0000
devel/brz: Fix with python 3.12
This is backported from upstream changes in brz 3.3.5 to get us by until
the larger switch to the 3.3 stream.
While here replace gettext with gettext-tools in USES - port doesn't
link with libintl, but uses msgfmt during build.
PR: 296361 296283
Sponsored by: UNIS Labs
---
devel/brz/Makefile | 4 +--
devel/brz/files/patch-breezy_bzr_index.py | 11 ++++++++
devel/brz/files/patch-breezy_git_dir.py | 11 ++++++++
devel/brz/files/patch-breezy_git_mapping.py | 11 ++++++++
devel/brz/files/patch-breezy_git_repository.py | 11 ++++++++
devel/brz/files/patch-breezy_lockdir.py | 11 ++++++++
devel/brz/files/patch-breezy_plugin.py | 10 ++++++++
.../brz/files/patch-breezy_tests_test__selftest.py | 13 ++++++++++
devel/brz/files/patch-breezy_tests_test__setup.py | 24 ++++++++++++++++++
.../files/patch-breezy_transport_http_response.py | 29 ++++++++++++++++++++++
.../files/patch-breezy_transport_http_urllib.py | 24 ++++++++++++++++++
11 files changed, 157 insertions(+), 2 deletions(-)
diff --git a/devel/brz/Makefile b/devel/brz/Makefile
index 57dd3f5a1cdf..6e02594a3070 100644
--- a/devel/brz/Makefile
+++ b/devel/brz/Makefile
@@ -1,6 +1,6 @@
PORTNAME= brz
DISTVERSION= 3.2.2
-PORTREVISION= 3
+PORTREVISION= 4
CATEGORIES= devel
MASTER_SITES= PYPI
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
@@ -21,7 +21,7 @@ RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}configobj>=0:devel/py-configobj@${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
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: