From nobody Sat Apr 16 04:25:40 2022 X-Original-To: dev-commits-ports-all@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 DD5B97CEFC6; Sat, 16 Apr 2022 04:25:40 +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 4KgKr428Ffz3PjM; Sat, 16 Apr 2022 04:25:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650083140; 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=tzbjbRyEfTRPNKZEYQrch+RPqaG68SVeEx/6MgfDMIw=; b=Rv1W32+R1cxGeBAu98EDRyCouw5zPo9oEscIKmglKxNllHBO9bwyrFQoSrLzpAF7Lvb6VW ivMGLcMOOoOcD7BAIVqJR1PZPD6s+jzUeFVJtJWbSFdU1Z/1B0aMEgnc8Fz5g2F884KKms gQhURA4KY4nZoiTTiTW3a75wx9t6WL7vbISoNDk+FyE6NLAvZ0Xo8GffELoVujSnhO7dpM wXwgu+2+KFXKwYyms8iEB0S2fPn6iS4VvWJkiIu9oYfVUom4CJeqkBpsNzc3JdaKOAhVnJ HOCFrOqLR4AZSSIW55CfVhcra7uIZ6+Zcw0ZEWXzol55qD7XW64oD13xiYnmEw== 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 1AEE522A59; Sat, 16 Apr 2022 04:25:40 +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 23G4PeYT009072; Sat, 16 Apr 2022 04:25:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23G4PetA009071; Sat, 16 Apr 2022 04:25:40 GMT (envelope-from git) Date: Sat, 16 Apr 2022 04:25:40 GMT Message-Id: <202204160425.23G4PetA009071@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: ae72db56f755 - main - net/tcpwatch: Fix build with setuptools 61.0.0+ List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@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: ae72db56f755a02755591c4b0a7439c595b0488b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650083140; 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=tzbjbRyEfTRPNKZEYQrch+RPqaG68SVeEx/6MgfDMIw=; b=FGT4PskAsQEiFdHHMKJLsUZTiTyIabDeARYb1kCD6v9Du9V6tpAsrcTKLbFKzfH3vDQv0I TaOQMCL36frVz4Uc1SMtO7LOmGKJXhZO9rwxFRznU1laOcDq49pGAZ4dfsWkoP+mWwq7y3 jRY/Ebfdk/4g2eyIKNLTl76t++Q5NvtR/bXSe8dItOQzXjz/EmwP/9ys/lK084hChFLbqm 9YlphoVhZ6QsB9Q6x/xTi65o+UwolSKsMLbUKX/Oyx0nDI3jmphwOLwyjP2STADq2WAJEe isc6Vx5G++M4I3lzIR3i+ARDVQp5KJedIduOpEOV7rJMR2Chv1URwGTXJidRgQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1650083140; a=rsa-sha256; cv=none; b=YhFsvdXIpYZiwhJPGlhZxik9zXLTz7y2VFYcX2bqrTW9DyBUys5rGF4eVaathbryNMa6Kp wndn+M8+JJFNkhRXO1jTYfO9ginfvtQ98YAvznbiTQN6rx9W7FC5t/IBlOevAZWBnpKNm1 H38doW/knEiC9XJ7gJSzufT0Fc0T79vzEoSkxtDYmQEMtvutl3nC3N6l8jYezaaUehzNFF neVQ+D56zEoj/F22i6K5EU+I+ExXi45hL9+Zf3z9MzgIAE6cZsZI1FSXgEsbQD/kYf55Y8 GJJZI0cvXrUEczJwfGJr2g+0gI/V9eK/V91PhSh5wvlM9a32vfqLeBwlJYYQwg== 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=ae72db56f755a02755591c4b0a7439c595b0488b commit ae72db56f755a02755591c4b0a7439c595b0488b Author: Po-Chuan Hsieh AuthorDate: 2022-04-16 04:16:02 +0000 Commit: Po-Chuan Hsieh CommitDate: 2022-04-16 04:19:55 +0000 net/tcpwatch: Fix build with setuptools 61.0.0+ With hat: python --- net/tcpwatch/files/patch-2to3 | 193 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 193 insertions(+) diff --git a/net/tcpwatch/files/patch-2to3 b/net/tcpwatch/files/patch-2to3 new file mode 100644 index 000000000000..f86b4a788807 --- /dev/null +++ b/net/tcpwatch/files/patch-2to3 @@ -0,0 +1,193 @@ +--- tcpwatch.py.orig 2004-06-17 00:03:46 UTC ++++ tcpwatch.py +@@ -71,8 +71,8 @@ Revision information: + $Id: tcpwatch.py,v 1.9 2004/06/17 00:03:46 shane Exp $ + """ + +-from __future__ import nested_scopes + ++ + VERSION = '1.3' + COPYRIGHT = ( + 'TCPWatch %s Copyright 2001 Shane Hathaway, Zope Corporation' +@@ -346,7 +346,7 @@ class BasicObserver: + if not show_cr: + data = data.replace('\r', '') + lines = data.split('\n') +- lines = map(escape, lines) ++ lines = list(map(escape, lines)) + s = ('\n%s' % arrow).join(lines) + self.write(s) + +@@ -472,13 +472,13 @@ def setupTk(titlepart, config_info, colorized=1): + """Starts the Tk application and returns an observer factory. + """ + +- import Tkinter +- from ScrolledText import ScrolledText +- from Queue import Queue, Empty ++ import tkinter ++ from tkinter.scrolledtext import ScrolledText ++ from queue import Queue, Empty + try: +- from cStringIO import StringIO ++ from io import StringIO + except ImportError: +- from StringIO import StringIO ++ from io import StringIO + + startup_text = COPYRIGHT + (""" + +@@ -489,11 +489,11 @@ the list on the left to see the data transferred. + """ % config_info) + + +- class TkTCPWatch (Tkinter.Frame): ++ class TkTCPWatch (tkinter.Frame): + '''The tcpwatch top-level window. + ''' + def __init__(self, master): +- Tkinter.Frame.__init__(self, master) ++ tkinter.Frame.__init__(self, master) + self.createWidgets() + # connections maps ids to TkConnectionObservers. + self.connections = {} +@@ -502,15 +502,15 @@ the list on the left to see the data transferred. + self.processQueue() + + def createWidgets(self): +- listframe = Tkinter.Frame(self) +- listframe.pack(side=Tkinter.LEFT, fill=Tkinter.BOTH, expand=1) +- scrollbar = Tkinter.Scrollbar(listframe, orient=Tkinter.VERTICAL) +- self.connectlist = Tkinter.Listbox( ++ listframe = tkinter.Frame(self) ++ listframe.pack(side=tkinter.LEFT, fill=tkinter.BOTH, expand=1) ++ scrollbar = tkinter.Scrollbar(listframe, orient=tkinter.VERTICAL) ++ self.connectlist = tkinter.Listbox( + listframe, yscrollcommand=scrollbar.set, exportselection=0) + scrollbar.config(command=self.connectlist.yview) +- scrollbar.pack(side=Tkinter.RIGHT, fill=Tkinter.Y) ++ scrollbar.pack(side=tkinter.RIGHT, fill=tkinter.Y) + self.connectlist.pack( +- side=Tkinter.LEFT, fill=Tkinter.BOTH, expand=1) ++ side=tkinter.LEFT, fill=tkinter.BOTH, expand=1) + self.connectlist.bind('', self.mouseListSelect) + self.textbox = ScrolledText(self, background="#ffffff") + self.textbox.tag_config("message", foreground="#000000") +@@ -520,32 +520,32 @@ the list on the left to see the data transferred. + self.textbox.tag_config("server", foreground="#770000") + self.textbox.tag_config( + "serveresc", foreground="#770000", background="#dddddd") +- self.textbox.insert(Tkinter.END, startup_text, "message") +- self.textbox.pack(side='right', fill=Tkinter.BOTH, expand=1) +- self.pack(fill=Tkinter.BOTH, expand=1) ++ self.textbox.insert(tkinter.END, startup_text, "message") ++ self.textbox.pack(side='right', fill=tkinter.BOTH, expand=1) ++ self.pack(fill=tkinter.BOTH, expand=1) + + def addConnection(self, id, conn): + self.connections[id] = conn + connectlist = self.connectlist +- connectlist.insert(Tkinter.END, id) ++ connectlist.insert(tkinter.END, id) + + def updateConnection(self, id, output): + if id == self.showingid: + textbox = self.textbox + for data, style in output: +- textbox.insert(Tkinter.END, data, style) ++ textbox.insert(tkinter.END, data, style) + + def mouseListSelect(self, event=None): + connectlist = self.connectlist + idx = connectlist.nearest(event.y) + sel = connectlist.get(idx) + connections = self.connections +- if connections.has_key(sel): ++ if sel in connections: + self.showingid = '' + output = connections[sel].getOutput() +- self.textbox.delete(1.0, Tkinter.END) ++ self.textbox.delete(1.0, tkinter.END) + for data, style in output: +- self.textbox.insert(Tkinter.END, data, style) ++ self.textbox.insert(tkinter.END, data, style) + self.showingid = sel + + def processQueue(self): +@@ -630,7 +630,7 @@ the list on the left to see the data transferred. + # Escape the input data. + was_escaped = 0 + start_idx = 0 +- for idx in xrange(len(data)): ++ for idx in range(len(data)): + c = data[idx] + escaped = (c < ' ' and c != '\n') or c >= '\x80' + if was_escaped != escaped: +@@ -661,7 +661,7 @@ the list on the left to see the data transferred. + + + def createApp(titlepart): +- master = Tkinter.Tk() ++ master = tkinter.Tk() + app = TkTCPWatch(master) + try: + wm_title = app.master.wm_title +@@ -1165,7 +1165,7 @@ class HTTPProxyToClientConnection (ForwardingEndpoint) + """ + first_line = request.first_line.strip() + if not ' ' in first_line: +- raise ValueError, ('Malformed request: %s' % first_line) ++ raise ValueError('Malformed request: %s' % first_line) + command, url = first_line.split(' ', 1) + pos = url.rfind(' HTTP/') + if pos >= 0: +@@ -1187,7 +1187,7 @@ class HTTPProxyToClientConnection (ForwardingEndpoint) + host = request.headers.get('HOST') + path = url + if not host: +- raise ValueError, ('Request type not supported: %s' % url) ++ raise ValueError('Request type not supported: %s' % url) + + if ':' in host: + host, port = host.split(':') +@@ -1324,7 +1324,7 @@ def main(args): + 'no-record-responses', + 'no-record-errors', + ]) +- except getopt.GetoptError, msg: ++ except getopt.GetoptError as msg: + usageError(msg) + + fwd_params = [] +@@ -1404,15 +1404,11 @@ def main(args): + config_info_lines = [] + title_lst = [] + if fwd_params: +- config_info_lines.extend(map( +- lambda args: 'Forwarding %s:%d -> %s:%d' % args, fwd_params)) +- title_lst.extend(map( +- lambda args: '%s:%d -> %s:%d' % args, fwd_params)) ++ config_info_lines.extend(['Forwarding %s:%d -> %s:%d' % args for args in fwd_params]) ++ title_lst.extend(['%s:%d -> %s:%d' % args for args in fwd_params]) + if proxy_params: +- config_info_lines.extend(map( +- lambda args: 'HTTP proxy listening on %s:%d' % args, proxy_params)) +- title_lst.extend(map( +- lambda args: '%s:%d -> proxy' % args, proxy_params)) ++ config_info_lines.extend(['HTTP proxy listening on %s:%d' % args for args in proxy_params]) ++ title_lst.extend(['%s:%d -> proxy' % args for args in proxy_params]) + if split_http: + config_info_lines.append('HTTP connection splitting enabled.') + if record_directory: +@@ -1469,8 +1465,8 @@ def main(args): + # Run the main loop. + try: + if mainloop is not None: +- import thread +- thread.start_new_thread(asyncore.loop, (), {'timeout': 1.0}) ++ import _thread ++ _thread.start_new_thread(asyncore.loop, (), {'timeout': 1.0}) + mainloop() + else: + asyncore.loop(timeout=1.0)