From patchwork Mon May 10 17:03:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adolf Belka X-Patchwork-Id: 4260 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 4Ff6nY2KZ1z44R5 for ; Mon, 10 May 2021 17:03:13 +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) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4Ff6nX0YzpzTM; Mon, 10 May 2021 17:03:12 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4Ff6nW4tpXz2ySY; Mon, 10 May 2021 17:03:11 +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 4Ff6nV6gXfz2xMk for ; Mon, 10 May 2021 17:03:10 +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 4Ff6nV0RXSzZV; Mon, 10 May 2021 17:03:10 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1620666190; 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=JoqHud3RBz8pSSsuUye9AM+NSnp7PcKNZZNjwu5WsCc=; b=0NnYet5fwF+/1v/62vaKUZTA4VdsDAXVZ7LoyyIh7NkPo3u9tcekAxDsKgvLBdkbSguxdh LPhDTljlmyNSWvDw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1620666190; 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=JoqHud3RBz8pSSsuUye9AM+NSnp7PcKNZZNjwu5WsCc=; b=bKxUY7rH+r/s5wup95D07aDET6gJPY+BmRPIbfHtK30MhsqsLf9QNrmPB5H1AIRUrxLtqZ ARhjHsPsgx97rAVl3TvQLSKdjisOP/h5aStjAMWugdNv+065rChadN5jzwnY9RckCmuqIT 0zGIWmOZLuo1Mdxp6BbOgdS6QTObqZQ44ukI7iiVLzyoOSYRiQQuPJnL9iBQRMj6zLLbg5 IoTOtbjos7dMVZMOLvBj4HkHWMlQi1FdlM6z2oaFh91LGjbcT/M6ZMWPUGyiGssnya/3M0 gXEcHPD+ImNQYwuHZ++1B5FDdte5uXETeoR3aacJDj2mVr5DvY8BYjM4XpxKZw== From: Adolf Belka To: development@lists.ipfire.org Subject: [PATCH v2] iotop: Update to work with python3 Date: Mon, 10 May 2021 19:03:08 +0200 Message-Id: <20210510170308.1889765-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" - v2 version has updated rootfile. One line was accidentally missed out of original patch submission. - 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 | 28 +++++++------------ lfs/iotop | 5 ++-- ...e-itervalues-with-values-in-setup.py.patch | 11 ++++++++ 3 files changed, 24 insertions(+), 20 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..541d6b3ee 100644 --- a/config/rootfiles/packages/iotop +++ b/config/rootfiles/packages/iotop @@ -1,20 +1,12 @@ -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' +