From nobody Fri Mar 25 13:50:54 2022 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 0D7511A3489A; Fri, 25 Mar 2022 13:50:58 +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 4KQ3QR4mdqz3hJN; Fri, 25 Mar 2022 13:50:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648216256; 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=ExxNk3hRveyMuQ6CHJYHNsofwnQ+sPrGR/z20jl9CdA=; b=Ra12sb/EA+z5XI95ZK92e6CjURrxWNzk5IH53ul6LwlG12DE8372ZTdKLYYbj1YSaTTPGg SeurgLGwsZLuBRoDAe2xr55wbV7Wm4nSXm1HmE18ju7HmPR3PY2y+70VnAB9EMw2RkTn/k 3uDw5raG/ELvmQfdnq/7iiok076vaZCQtV2gU5uGIkyWkn/+yeemwM9+6VNGVCeWgMvvte 2v2y8dZJmeiuoE1fZF8c2pkGGcm4dxLjKGfWQcTsGXKgfWbmVh5jTSkCzdP5607RdUVS2V XVXpmGr3et5sr8cOdN0XYdmIJH2EzgoRexNLjI+XQjARrv7/3dl6WqfLfeptew== 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 8756C5AF8; Fri, 25 Mar 2022 13:50:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 22PDosno037567; Fri, 25 Mar 2022 13:50:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 22PDosZF037566; Fri, 25 Mar 2022 13:50:54 GMT (envelope-from git) Date: Fri, 25 Mar 2022 13:50:54 GMT Message-Id: <202203251350.22PDosZF037566@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: 7aa9570e2be2 - main - security/py-gnutls: Fix build with setuptools 58.0.0+ 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: 7aa9570e2be2591eac6ab8306a85f5e38be95601 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648216256; 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=ExxNk3hRveyMuQ6CHJYHNsofwnQ+sPrGR/z20jl9CdA=; b=ZS/b+A1ElHbXsvAqj1vZEEhWqQZZEBSgHfM8Ut49hG9kkj2Lk/IpnpGHuiIlYAvPDjrAbS V0zViwvIlIfu6l/emZpChahaiMTEy6yDzV48Xtaj1aaVEvTuTGhZFohiy03Lc9WsrX0thH 36dWlzuwQ8BAU7cJCYKiTWBPmGnlq6VWVZ4t0MIGBpybFHAFVSYow+IdVGlGJhtf2vVo1p 3qBKbdAVvNS91zWGCPU3zTeo4kStbwKl261ZsXN+/qVA3svYMWadvFbOe+P4GJb3K4XTyh uVvoshzrOqSFDqPe1KjALMUUrOCDEj9T9DOzCVQLPaNaP16uML/I2ezCL/HKOQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1648216256; a=rsa-sha256; cv=none; b=SL5Vsshhi/a1JIx4ya1am5miOgMv3rAV/obVT0zJdnRHFUjD05FhKs3eVJLour9amTxSNP YT+PfSTNMFVq9Zy2koiPPeRbu0T/NE1KRzQORbSZ1uoUcdd1E0HBg2ZgcGFerAgAPbGPOv LZbCX7UJ3JZZB7CPfKCN0XlOPLGEasNEeQM0L31bKVqMZuP1jNeKzdHxcyI3mYZO+gelL6 berFBkb8FHx5qgYtSZ5TO1OVxS1Q584XOQEn0dg+DLR7Xqq1tCJwJ0q+76faCrDdazHpe4 ef77R8C9BLSvGeKpDWOhHjoC8e8MXFl7+gro4QV7M0Br44hHlTSwDlpcEzsp/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by sunpoet: URL: https://cgit.FreeBSD.org/ports/commit/?id=7aa9570e2be2591eac6ab8306a85f5e38be95601 commit 7aa9570e2be2591eac6ab8306a85f5e38be95601 Author: Po-Chuan Hsieh AuthorDate: 2022-03-25 13:33:59 +0000 Commit: Po-Chuan Hsieh CommitDate: 2022-03-25 13:38:20 +0000 security/py-gnutls: Fix build with setuptools 58.0.0+ With hat: python --- security/py-gnutls/files/patch-2to3 | 201 ++++++++++++++++++++++++++++++++++++ 1 file changed, 201 insertions(+) diff --git a/security/py-gnutls/files/patch-2to3 b/security/py-gnutls/files/patch-2to3 new file mode 100644 index 000000000000..ab5564904aee --- /dev/null +++ b/security/py-gnutls/files/patch-2to3 @@ -0,0 +1,201 @@ +--- gnutls/connection.py.orig 2017-01-26 09:15:54 UTC ++++ gnutls/connection.py +@@ -388,7 +388,7 @@ class ServerSession(Session): + data_length = c_size_t(256) + data = create_string_buffer(data_length.value) + hostname_type = c_uint() +- for i in xrange(2**16): ++ for i in range(2**16): + try: + gnutls_server_name_get(self._c_object, data, byref(data_length), byref(hostname_type), i) + except RequestedDataNotAvailable: +@@ -407,7 +407,7 @@ class ServerSessionFactory(object): + + def __init__(self, socket, context, session_class=ServerSession): + if not issubclass(session_class, ServerSession): +- raise TypeError, "session_class must be a subclass of ServerSession" ++ raise TypeError("session_class must be a subclass of ServerSession") + self.socket = socket + self.context = context + self.session_class = session_class +--- gnutls/constants.py.orig 2016-03-08 13:28:28 UTC ++++ gnutls/constants.py +@@ -31,7 +31,7 @@ class GNUTLSConstant(int): + + ## Generate all exported constants + code = '\n'.join(["%s = GNUTLSConstant('%s')" % (name, name) for name in __all__]) +-exec code in locals(), globals() ++exec(code, locals(), globals()) + del code, name + + del constants +--- gnutls/interfaces/twisted/__init__.py.orig 2016-03-08 13:28:28 UTC ++++ gnutls/interfaces/twisted/__init__.py +@@ -41,7 +41,7 @@ class RecurrentCall(object): + self.now, self.next = self.next, self.next + self.period + result = self.func(*self.args, **self.kwargs) + if result is KeepRunning: +- delay = max(self.next-time(), 0) ++ delay = max(self.__next__-time(), 0) + self.callid = reactor.callLater(delay, self) + def cancel(self): + if self.callid is not None: +@@ -77,7 +77,7 @@ class TLSMixin: + return tcp.Connection.doRead(self) + except (OperationWouldBlock, OperationInterrupted): + return +- except GNUTLSError, e: ++ except GNUTLSError as e: + return e + + def writeSomeData(self, data): +@@ -87,7 +87,7 @@ class TLSMixin: + return self.writeSomeData(data) + except OperationWouldBlock: + return 0 +- except GNUTLSError, e: ++ except GNUTLSError as e: + return e + + def _sendCloseReason(self, reason): +@@ -117,11 +117,11 @@ class TLSMixin: + self.stopWriting() + try: + self._sendCloseAlert(SHUT_WR) +- except OperationWouldBlock, e: ++ except OperationWouldBlock as e: + if self.socket.interrupted_while_writing: + self.startWriting() + return +- except Exception, e: ++ except Exception as e: + return e + del self.doWrite + +@@ -153,7 +153,7 @@ class TLSClient(TLSMixin, tcp.Client): + return + try: + self.context.credentials.verify_callback(self.socket.peer_certificate) +- except Exception, e: ++ except Exception as e: + self.loseConnection(e) + return + else: +@@ -166,7 +166,7 @@ class TLSClient(TLSMixin, tcp.Client): + return + try: + session.verify_peer() +- except Exception, e: ++ except Exception as e: + preverify_status = e + else: + preverify_status = CertificateOK +@@ -184,7 +184,7 @@ class TLSClient(TLSMixin, tcp.Client): + if self.socket.interrupted_while_writing: + self.startWriting() + return +- except GNUTLSError, e: ++ except GNUTLSError as e: + del self.doRead + self.failIfNotConnected(err = e) + return +@@ -195,11 +195,11 @@ class TLSClient(TLSMixin, tcp.Client): + + try: + self._verifyPeer() +- except GNUTLSError, e: ++ except GNUTLSError as e: + self.closeTLSSession(e) + self.failIfNotConnected(err = e) + return +- except Exception, e: ++ except Exception as e: + self.closeTLSSession(e) + self.failIfNotConnected(err = error.getConnectError(str(e))) + return +@@ -258,7 +258,7 @@ class TLSServer(TLSMixin, tcp.Server): + return + try: + self.context.credentials.verify_callback(self.socket.peer_certificate) +- except Exception, e: ++ except Exception as e: + self.loseConnection(e) + return + else: +@@ -271,7 +271,7 @@ class TLSServer(TLSMixin, tcp.Server): + return + try: + session.verify_peer() +- except Exception, e: ++ except Exception as e: + preverify_status = e + else: + preverify_status = CertificateOK +@@ -289,7 +289,7 @@ class TLSServer(TLSMixin, tcp.Server): + if self.socket.interrupted_while_writing: + self.startWriting() + return +- except GNUTLSError, e: ++ except GNUTLSError as e: + del self.doRead + return e + +@@ -300,7 +300,7 @@ class TLSServer(TLSMixin, tcp.Server): + + try: + self._verifyPeer() +- except Exception, e: ++ except Exception as e: + self.loseConnection(e) + return + +--- gnutls/validators.py.orig 2016-03-08 13:28:28 UTC ++++ gnutls/validators.py +@@ -76,7 +76,7 @@ class TypeValidator(Validator): + class MultiTypeValidator(TypeValidator): + @staticmethod + def can_validate(obj): +- return isinstance(obj, tuple) and not filter(lambda x: not isclass(x), obj) ++ return isinstance(obj, tuple) and not [x for x in obj if not isclass(x)] + + class OneOfValidator(Validator): + def __init__(self, typ): +@@ -94,7 +94,7 @@ class ListOfValidator(Validator): + def __init__(self, typ): + self.type = typ.type + def check(self, value): +- return isinstance(value, (tuple, list)) and not filter(lambda x: not isinstance(x, self.type), value) ++ return isinstance(value, (tuple, list)) and not [x for x in value if not isinstance(x, self.type)] + @staticmethod + def can_validate(obj): + return isinstance(obj, list_of) +@@ -109,7 +109,7 @@ class ComplexValidator(Validator): + return bool(sum(t.check(value) for t in self.type)) + @staticmethod + def can_validate(obj): +- return isinstance(obj, tuple) and not filter(lambda x: Validator.get(x) is None, obj) ++ return isinstance(obj, tuple) and not [x for x in obj if Validator.get(x) is None] + @property + def name(self): + return self.join_names([x.name for x in self.type]) +@@ -135,7 +135,7 @@ class one_of(object): + + class list_of(object): + def __init__(self, *args): +- if filter(lambda x: not isclass(x), args): ++ if [x for x in args if not isclass(x)]: + raise TypeError("list_of arguments must be types") + if len(args) == 1: + self.type = args[0] +@@ -163,9 +163,9 @@ def preserve_signature(func): + if constants: + ## import the required GNUTLSConstants used as function default arguments + code = "from gnutls.constants import %s\n" % ', '.join(c.name for c in constants) +- exec code in locals(), locals() ++ exec(code, locals(), locals()) + code = "def %s(%s): return wrapper(%s)\nnew_wrapper = %s\n" % (func.__name__, signature, parameters, func.__name__) +- exec code in locals(), locals() ++ exec(code, locals(), locals()) + new_wrapper.__name__ = func.__name__ + new_wrapper.__doc__ = func.__doc__ + new_wrapper.__module__ = func.__module__