From patchwork Sun May 9 13:36:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adolf Belka X-Patchwork-Id: 4258 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4FdQFB0Kq0z44RY for ; Sun, 9 May 2021 13:36:14 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4FdQF72Vk0z1VG; Sun, 9 May 2021 13:36:11 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4FdQF65bLhz2xd1; Sun, 9 May 2021 13:36:10 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4FdQF55YFlz2xPJ for ; Sun, 9 May 2021 13:36:09 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4FdQF50FY2zYq; Sun, 9 May 2021 13:36:08 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1620567369; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=N+gy48MyGdfDiTSp/cv3uIh2CZ3lR8JDv3DvSXcdlxc=; b=ExwkrVg/1pGiGp8h0ekqVsuNW9hiRNXhLyB6DtCDnULrXkZWAWpmw9p7/Bss/V7QJVScc8 XWEG6DvFFTpDZXAg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1620567369; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=N+gy48MyGdfDiTSp/cv3uIh2CZ3lR8JDv3DvSXcdlxc=; b=S0Qq7X1psA1moJwrwgyLx61TFo6o4Yd+y0XCGPeJsqincI03q1ypkvXxLHlNPmXrKLgyA+ F2idjVrZl/BRyQ9gQzKf145meypLe0GN2l3atedT9ucMtnRBcJgjt8XnvgqeAMyPFKyk3Y MLAX5p7H2aRiLdKqPPRSk7Aaup7OE5+q8GX5jeLgZJrWDF/F947SgswjCImCTGscAyG+QU LnemxOQeWTH+q5AFdmKqxUPMz60A2QCCSlLhQFRzK7tRsKO8aikrPb1pRo5Vc5oAjGBaiE QFXi110skukTF98FNJNsx6b/A8WI9oozIRZa15XnhOsoybqYXghO1sXSnmZbqA== From: Adolf Belka To: development@lists.ipfire.org Subject: [PATCH] iotop: Update to work with python3 Date: Sun, 9 May 2021 15:36:06 +0200 Message-Id: <20210509133606.3525716-1-adolf.belka@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" - Change from building with python2 to python3 - iotop setup.py used "itervalues" which is no longer used by python3 In python3 this has been changed to "values". Patch created to update this in the source tarball setup.py - Update lfs file with patch application and use of python3 - Update of rootfile - Installed updated version into vm testbed and iotop confirmed working Signed-off-by: Adolf Belka --- config/rootfiles/packages/iotop | 29 +++++++------------ lfs/iotop | 5 ++-- ...e-itervalues-with-values-in-setup.py.patch | 11 +++++++ 3 files changed, 24 insertions(+), 21 deletions(-) create mode 100644 src/patches/iotop-0.6-replace-itervalues-with-values-in-setup.py.patch diff --git a/config/rootfiles/packages/iotop b/config/rootfiles/packages/iotop index 5ebe221ef..4a60e2cef 100644 --- a/config/rootfiles/packages/iotop +++ b/config/rootfiles/packages/iotop @@ -1,20 +1,11 @@ -usr/lib/python2.7/site-packages/iotop -#usr/lib/python2.7/site-packages/iotop-0.6-py2.7.egg-info -#usr/lib/python2.7/site-packages/iotop/__init__.py -#usr/lib/python2.7/site-packages/iotop/__init__.pyc -#usr/lib/python2.7/site-packages/iotop/data.py -#usr/lib/python2.7/site-packages/iotop/data.pyc -#usr/lib/python2.7/site-packages/iotop/genetlink.py -#usr/lib/python2.7/site-packages/iotop/genetlink.pyc -#usr/lib/python2.7/site-packages/iotop/ioprio.py -#usr/lib/python2.7/site-packages/iotop/ioprio.pyc -#usr/lib/python2.7/site-packages/iotop/netlink.py -#usr/lib/python2.7/site-packages/iotop/netlink.pyc -#usr/lib/python2.7/site-packages/iotop/ui.py -#usr/lib/python2.7/site-packages/iotop/ui.pyc -#usr/lib/python2.7/site-packages/iotop/version.py -#usr/lib/python2.7/site-packages/iotop/version.pyc -#usr/lib/python2.7/site-packages/iotop/vmstat.py -#usr/lib/python2.7/site-packages/iotop/vmstat.pyc +usr/lib/python3.8/site-packages/iotop +#usr/lib/python3.8/site-packages/iotop-0.6-py3.8.egg-info +#usr/lib/python3.8/site-packages/iotop/__init__.py +#usr/lib/python3.8/site-packages/iotop/data.py +#usr/lib/python3.8/site-packages/iotop/genetlink.py +#usr/lib/python3.8/site-packages/iotop/ioprio.py +#usr/lib/python3.8/site-packages/iotop/netlink.py +#usr/lib/python3.8/site-packages/iotop/ui.py +#usr/lib/python3.8/site-packages/iotop/version.py +#usr/lib/python3.8/site-packages/iotop/vmstat.py usr/sbin/iotop -#usr/share/man/man8/iotop.8 diff --git a/lfs/iotop b/lfs/iotop index d286eb1a9..02f027e5c 100644 --- a/lfs/iotop +++ b/lfs/iotop @@ -33,7 +33,7 @@ DIR_APP = $(DIR_SRC)/$(THISAPP) TARGET = $(DIR_INFO)/$(THISAPP) PROG = iotop -PAK_VER = 1 +PAK_VER = 2 DEPS = ############################################################################### @@ -77,6 +77,7 @@ $(subst %,%_MD5,$(objects)) : $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) @$(PREBUILD) @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE) - cd $(DIR_APP) && python setup.py install + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/iotop-0.6-replace-itervalues-with-values-in-setup.py.patch + cd $(DIR_APP) && python3 setup.py install @rm -rf $(DIR_APP) @$(POSTBUILD) diff --git a/src/patches/iotop-0.6-replace-itervalues-with-values-in-setup.py.patch b/src/patches/iotop-0.6-replace-itervalues-with-values-in-setup.py.patch new file mode 100644 index 000000000..9778d19d1 --- /dev/null +++ b/src/patches/iotop-0.6-replace-itervalues-with-values-in-setup.py.patch @@ -0,0 +1,11 @@ +--- iotop-0.6/setup.py.orig 2013-05-27 00:44:18.000000000 +0200 ++++ iotop-0.6/setup.py 2021-05-08 23:20:44.340837716 +0200 +@@ -7,7 +7,7 @@ + # Dirty hack to make setup.py install the iotop script to sbin/ instead of bin/ + # while still honoring the choice of installing into local/ or not. + if hasattr(distutils_install, 'INSTALL_SCHEMES'): +- for d in distutils_install.INSTALL_SCHEMES.itervalues(): ++ for d in distutils_install.INSTALL_SCHEMES.values(): + if d.get('scripts', '').endswith('/bin'): + d['scripts'] = d['scripts'][:-len('/bin')] + '/sbin' +