* [gentoo-commits] repo/gentoo:master commit in: sys-process/iotop/files/, sys-process/iotop/
@ 2019-02-28 22:49 Patrice Clement
0 siblings, 0 replies; 2+ messages in thread
From: Patrice Clement @ 2019-02-28 22:49 UTC (permalink / raw
To: gentoo-commits
commit: 03b1702e2d96eb257c30e2b59addf644e55469f8
Author: Emil Lundmark <lndmrk <AT> chromium <DOT> org>
AuthorDate: Thu Dec 20 16:59:05 2018 +0000
Commit: Patrice Clement <monsieurp <AT> gentoo <DOT> org>
CommitDate: Thu Feb 28 22:49:33 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=03b1702e
sys-process/iotop: fix parse_proc_pid_status().
iotop does not work on kernels that populate /proc/*/status either with
empty lines or lines containing spaces after the : character. These
patches from the upstream iotop project fixes the parsing of status.
Signed-off-by: Emil Lundmark <lndmrk <AT> chromium.org>
Closes: https://github.com/gentoo/gentoo/pull/11157
Signed-off-by: Patrice Clement <monsieurp <AT> gentoo.org>
...ctually-skip-invalid-lines-in-proc-status.patch | 26 +++++++++
...Ignore-invalid-lines-in-proc-status-files.patch | 64 ++++++++++++++++++++++
...-split-proc-status-lines-on-the-character.patch | 31 +++++++++++
sys-process/iotop/iotop-0.6.ebuild | 7 ++-
4 files changed, 127 insertions(+), 1 deletion(-)
diff --git a/sys-process/iotop/files/iotop-0.6-Actually-skip-invalid-lines-in-proc-status.patch b/sys-process/iotop/files/iotop-0.6-Actually-skip-invalid-lines-in-proc-status.patch
new file mode 100644
index 00000000000..9dc89bfb6f3
--- /dev/null
+++ b/sys-process/iotop/files/iotop-0.6-Actually-skip-invalid-lines-in-proc-status.patch
@@ -0,0 +1,26 @@
+From 7c51ce0e29bd135c216f18e18f0c4ab769af0d6f Mon Sep 17 00:00:00 2001
+From: Paul Wise <pabs3@bonedaddy.net>
+Date: Fri, 25 May 2018 15:20:44 +0800
+Subject: [PATCH 2/2] Actually skip invalid lines in /proc/*/status
+
+Fixes: commit 0392b205b5c3973a326721c2e9f97f0fa2eefa82
+---
+ iotop/data.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/iotop/data.py b/iotop/data.py
+index e0387f0..3874974 100644
+--- a/iotop/data.py
++++ b/iotop/data.py
+@@ -214,7 +214,7 @@ def parse_proc_pid_status(pid):
+ # Ignore lines that are not formatted correctly as
+ # some downstream kernels may have weird lines and
+ # the needed fields are probably formatted correctly.
+- pass
++ continue
+ result_dict[key] = value.strip()
+ except IOError:
+ pass # No such process
+--
+2.20.1.97.g81188d93c3-goog
+
diff --git a/sys-process/iotop/files/iotop-0.6-Ignore-invalid-lines-in-proc-status-files.patch b/sys-process/iotop/files/iotop-0.6-Ignore-invalid-lines-in-proc-status-files.patch
new file mode 100644
index 00000000000..df46caf4ce1
--- /dev/null
+++ b/sys-process/iotop/files/iotop-0.6-Ignore-invalid-lines-in-proc-status-files.patch
@@ -0,0 +1,64 @@
+From 0392b205b5c3973a326721c2e9f97f0fa2eefa82 Mon Sep 17 00:00:00 2001
+From: Paul Wise <pabs3@bonedaddy.net>
+Date: Fri, 25 May 2018 15:13:26 +0800
+Subject: [PATCH 1/2] Ignore invalid lines in /proc/*/status files
+
+One Ubuntu Linux kernel security fix introduced a blank line.
+Some other Linux kernels may have invalid lines in the future.
+
+See-also: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1772671
+Fixes: https://bugs.launchpad.net/ubuntu/+source/iotop/+bug/1772856
+Reported-by: Paul Jaros <jaros.paul@gmail.com>
+Reported-in: <CAEh_nc0_DXTmfu16PxmVyrCi6QQeSrpnGGhtfNu60wJYfa_6Zw@mail.gmail.com>
+Traceback (most recent call last):
+ File "/usr/sbin/iotop", line 17, in <module>
+ main()
+ File "/usr/lib/python2.7/dist-packages/iotop/ui.py", line 620, in main
+ main_loop()
+ File "/usr/lib/python2.7/dist-packages/iotop/ui.py", line 610, in <lambda>
+ main_loop = lambda: run_iotop(options)
+ File "/usr/lib/python2.7/dist-packages/iotop/ui.py", line 508, in run_iotop
+ return curses.wrapper(run_iotop_window, options)
+ File "/usr/lib/python2.7/curses/wrapper.py", line 43, in wrapper
+ return func(stdscr, *args, **kwds)
+ File "/usr/lib/python2.7/dist-packages/iotop/ui.py", line 501, in run_iotop_window
+ ui.run()
+ File "/usr/lib/python2.7/dist-packages/iotop/ui.py", line 155, in run
+ self.process_list.duration)
+ File "/usr/lib/python2.7/dist-packages/iotop/ui.py", line 434, in refresh_display
+ lines = self.get_data()
+ File "/usr/lib/python2.7/dist-packages/iotop/ui.py", line 415, in get_data
+ return list(map(format, processes))
+ File "/usr/lib/python2.7/dist-packages/iotop/ui.py", line 388, in format
+ cmdline = p.get_cmdline()
+ File "/usr/lib/python2.7/dist-packages/iotop/data.py", line 292, in get_cmdline
+ proc_status = parse_proc_pid_status(self.pid)
+ File "/usr/lib/python2.7/dist-packages/iotop/data.py", line 196, in parse_proc_pid_status
+ key, value = line.split(':\t', 1)
+ValueError: need more than 1 value to unpack
+---
+ iotop/data.py | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/iotop/data.py b/iotop/data.py
+index 115bb8f..e0387f0 100644
+--- a/iotop/data.py
++++ b/iotop/data.py
+@@ -208,7 +208,13 @@ def parse_proc_pid_status(pid):
+ result_dict = {}
+ try:
+ for line in open('/proc/%d/status' % pid):
+- key, value = line.split(':', 1)
++ try:
++ key, value = line.split(':', 1)
++ except ValueError:
++ # Ignore lines that are not formatted correctly as
++ # some downstream kernels may have weird lines and
++ # the needed fields are probably formatted correctly.
++ pass
+ result_dict[key] = value.strip()
+ except IOError:
+ pass # No such process
+--
+2.20.1.97.g81188d93c3-goog
+
diff --git a/sys-process/iotop/files/iotop-0.6-Only-split-proc-status-lines-on-the-character.patch b/sys-process/iotop/files/iotop-0.6-Only-split-proc-status-lines-on-the-character.patch
new file mode 100644
index 00000000000..ae8540f9da9
--- /dev/null
+++ b/sys-process/iotop/files/iotop-0.6-Only-split-proc-status-lines-on-the-character.patch
@@ -0,0 +1,31 @@
+From 7814f30a5ed65acd07f284bba991ca557788ee80 Mon Sep 17 00:00:00 2001
+From: Paul Wise <pabs3@bonedaddy.net>
+Date: Thu, 28 Jul 2016 13:25:54 +0800
+Subject: [PATCH] Only split /proc/*/status lines on the : character.
+
+Apparently vserver kernels have some lines that don't
+appear to have the tab character so iotop crashes.
+
+The tab character will be stripped by the next code line.
+
+Closes: https://bugs.gentoo.org/show_bug.cgi?id=458556
+---
+ iotop/data.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/iotop/data.py b/iotop/data.py
+index c4e961e..d18ca9d 100644
+--- a/iotop/data.py
++++ b/iotop/data.py
+@@ -197,7 +197,7 @@ def parse_proc_pid_status(pid):
+ result_dict = {}
+ try:
+ for line in open('/proc/%d/status' % pid):
+- key, value = line.split(':\t', 1)
++ key, value = line.split(':', 1)
+ result_dict[key] = value.strip()
+ except IOError:
+ pass # No such process
+--
+2.20.1.97.g81188d93c3-goog
+
diff --git a/sys-process/iotop/iotop-0.6.ebuild b/sys-process/iotop/iotop-0.6.ebuild
index 3faec2aa451..01dc5a097ef 100644
--- a/sys-process/iotop/iotop-0.6.ebuild
+++ b/sys-process/iotop/iotop-0.6.ebuild
@@ -21,7 +21,12 @@ CONFIG_CHECK="~TASK_IO_ACCOUNTING ~TASK_DELAY_ACCT ~TASKSTATS ~VM_EVENT_COUNTERS
DOCS=( NEWS README THANKS ChangeLog )
-PATCHES=( "${FILESDIR}"/${P}-setup.py3.patch )
+PATCHES=(
+ "${FILESDIR}"/${P}-setup.py3.patch
+ "${FILESDIR}"/${P}-Only-split-proc-status-lines-on-the-character.patch
+ "${FILESDIR}"/${P}-Ignore-invalid-lines-in-proc-status-files.patch
+ "${FILESDIR}"/${P}-Actually-skip-invalid-lines-in-proc-status.patch
+)
pkg_setup() {
linux-info_pkg_setup
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-process/iotop/files/, sys-process/iotop/
@ 2023-04-22 18:09 Andreas Sturmlechner
0 siblings, 0 replies; 2+ messages in thread
From: Andreas Sturmlechner @ 2023-04-22 18:09 UTC (permalink / raw
To: gentoo-commits
commit: d4d1e517792abee84d98fdb7bfda927588b1c052
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 24 19:03:38 2023 +0000
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sat Apr 22 18:09:26 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d4d1e517
sys-process/iotop: drop 0.6
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
sys-process/iotop/Manifest | 1 -
...ctually-skip-invalid-lines-in-proc-status.patch | 26 ---------
...Ignore-invalid-lines-in-proc-status-files.patch | 64 ----------------------
...-split-proc-status-lines-on-the-character.patch | 31 -----------
sys-process/iotop/files/iotop-0.6-setup.py3.patch | 31 -----------
sys-process/iotop/iotop-0.6.ebuild | 35 ------------
6 files changed, 188 deletions(-)
diff --git a/sys-process/iotop/Manifest b/sys-process/iotop/Manifest
index 9e9d839a5695..d1a935f054df 100644
--- a/sys-process/iotop/Manifest
+++ b/sys-process/iotop/Manifest
@@ -1,2 +1 @@
-DIST iotop-0.6.tar.bz2 29779 BLAKE2B 6c979f7beef4e9ec6536eb5ec113ab7089ccb0b8b00dfca6181408390584dac0eae18b110c3f4837a25defd7ab2c2e9d79f1f5cad762f97519e94847951f0037 SHA512 b1047da3bc46604447cc8ab22442a3a5381e1a79a6b176fe9ee8402ee5cebb959205407a6aeaffccccde9d2f67624ff8ee6717b051838f13ab88bf3a16db3ab9
DIST iotop-0.6_p20230124.tar.gz 28751 BLAKE2B 4fd281b663288825a3315442171df649b59a133479732367863e4f0d75f81e760af5117aec7b1ff070bb7a98e7348f76a6490b9ab8866c0ff7cb52073b07fbd8 SHA512 916809c9a97ed260525b00b4e6bd1f55f07b307bf1dc2f61e87317014d04e1bb3fab03c9ad9d5c110d198fbc89427cbe9e6679f03785f71e7e572f985dbac2a7
diff --git a/sys-process/iotop/files/iotop-0.6-Actually-skip-invalid-lines-in-proc-status.patch b/sys-process/iotop/files/iotop-0.6-Actually-skip-invalid-lines-in-proc-status.patch
deleted file mode 100644
index 9dc89bfb6f33..000000000000
--- a/sys-process/iotop/files/iotop-0.6-Actually-skip-invalid-lines-in-proc-status.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 7c51ce0e29bd135c216f18e18f0c4ab769af0d6f Mon Sep 17 00:00:00 2001
-From: Paul Wise <pabs3@bonedaddy.net>
-Date: Fri, 25 May 2018 15:20:44 +0800
-Subject: [PATCH 2/2] Actually skip invalid lines in /proc/*/status
-
-Fixes: commit 0392b205b5c3973a326721c2e9f97f0fa2eefa82
----
- iotop/data.py | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/iotop/data.py b/iotop/data.py
-index e0387f0..3874974 100644
---- a/iotop/data.py
-+++ b/iotop/data.py
-@@ -214,7 +214,7 @@ def parse_proc_pid_status(pid):
- # Ignore lines that are not formatted correctly as
- # some downstream kernels may have weird lines and
- # the needed fields are probably formatted correctly.
-- pass
-+ continue
- result_dict[key] = value.strip()
- except IOError:
- pass # No such process
---
-2.20.1.97.g81188d93c3-goog
-
diff --git a/sys-process/iotop/files/iotop-0.6-Ignore-invalid-lines-in-proc-status-files.patch b/sys-process/iotop/files/iotop-0.6-Ignore-invalid-lines-in-proc-status-files.patch
deleted file mode 100644
index df46caf4ce11..000000000000
--- a/sys-process/iotop/files/iotop-0.6-Ignore-invalid-lines-in-proc-status-files.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-From 0392b205b5c3973a326721c2e9f97f0fa2eefa82 Mon Sep 17 00:00:00 2001
-From: Paul Wise <pabs3@bonedaddy.net>
-Date: Fri, 25 May 2018 15:13:26 +0800
-Subject: [PATCH 1/2] Ignore invalid lines in /proc/*/status files
-
-One Ubuntu Linux kernel security fix introduced a blank line.
-Some other Linux kernels may have invalid lines in the future.
-
-See-also: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1772671
-Fixes: https://bugs.launchpad.net/ubuntu/+source/iotop/+bug/1772856
-Reported-by: Paul Jaros <jaros.paul@gmail.com>
-Reported-in: <CAEh_nc0_DXTmfu16PxmVyrCi6QQeSrpnGGhtfNu60wJYfa_6Zw@mail.gmail.com>
-Traceback (most recent call last):
- File "/usr/sbin/iotop", line 17, in <module>
- main()
- File "/usr/lib/python2.7/dist-packages/iotop/ui.py", line 620, in main
- main_loop()
- File "/usr/lib/python2.7/dist-packages/iotop/ui.py", line 610, in <lambda>
- main_loop = lambda: run_iotop(options)
- File "/usr/lib/python2.7/dist-packages/iotop/ui.py", line 508, in run_iotop
- return curses.wrapper(run_iotop_window, options)
- File "/usr/lib/python2.7/curses/wrapper.py", line 43, in wrapper
- return func(stdscr, *args, **kwds)
- File "/usr/lib/python2.7/dist-packages/iotop/ui.py", line 501, in run_iotop_window
- ui.run()
- File "/usr/lib/python2.7/dist-packages/iotop/ui.py", line 155, in run
- self.process_list.duration)
- File "/usr/lib/python2.7/dist-packages/iotop/ui.py", line 434, in refresh_display
- lines = self.get_data()
- File "/usr/lib/python2.7/dist-packages/iotop/ui.py", line 415, in get_data
- return list(map(format, processes))
- File "/usr/lib/python2.7/dist-packages/iotop/ui.py", line 388, in format
- cmdline = p.get_cmdline()
- File "/usr/lib/python2.7/dist-packages/iotop/data.py", line 292, in get_cmdline
- proc_status = parse_proc_pid_status(self.pid)
- File "/usr/lib/python2.7/dist-packages/iotop/data.py", line 196, in parse_proc_pid_status
- key, value = line.split(':\t', 1)
-ValueError: need more than 1 value to unpack
----
- iotop/data.py | 8 +++++++-
- 1 file changed, 7 insertions(+), 1 deletion(-)
-
-diff --git a/iotop/data.py b/iotop/data.py
-index 115bb8f..e0387f0 100644
---- a/iotop/data.py
-+++ b/iotop/data.py
-@@ -208,7 +208,13 @@ def parse_proc_pid_status(pid):
- result_dict = {}
- try:
- for line in open('/proc/%d/status' % pid):
-- key, value = line.split(':', 1)
-+ try:
-+ key, value = line.split(':', 1)
-+ except ValueError:
-+ # Ignore lines that are not formatted correctly as
-+ # some downstream kernels may have weird lines and
-+ # the needed fields are probably formatted correctly.
-+ pass
- result_dict[key] = value.strip()
- except IOError:
- pass # No such process
---
-2.20.1.97.g81188d93c3-goog
-
diff --git a/sys-process/iotop/files/iotop-0.6-Only-split-proc-status-lines-on-the-character.patch b/sys-process/iotop/files/iotop-0.6-Only-split-proc-status-lines-on-the-character.patch
deleted file mode 100644
index ae8540f9da9f..000000000000
--- a/sys-process/iotop/files/iotop-0.6-Only-split-proc-status-lines-on-the-character.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 7814f30a5ed65acd07f284bba991ca557788ee80 Mon Sep 17 00:00:00 2001
-From: Paul Wise <pabs3@bonedaddy.net>
-Date: Thu, 28 Jul 2016 13:25:54 +0800
-Subject: [PATCH] Only split /proc/*/status lines on the : character.
-
-Apparently vserver kernels have some lines that don't
-appear to have the tab character so iotop crashes.
-
-The tab character will be stripped by the next code line.
-
-Closes: https://bugs.gentoo.org/show_bug.cgi?id=458556
----
- iotop/data.py | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/iotop/data.py b/iotop/data.py
-index c4e961e..d18ca9d 100644
---- a/iotop/data.py
-+++ b/iotop/data.py
-@@ -197,7 +197,7 @@ def parse_proc_pid_status(pid):
- result_dict = {}
- try:
- for line in open('/proc/%d/status' % pid):
-- key, value = line.split(':\t', 1)
-+ key, value = line.split(':', 1)
- result_dict[key] = value.strip()
- except IOError:
- pass # No such process
---
-2.20.1.97.g81188d93c3-goog
-
diff --git a/sys-process/iotop/files/iotop-0.6-setup.py3.patch b/sys-process/iotop/files/iotop-0.6-setup.py3.patch
deleted file mode 100644
index 5844d86cb1ba..000000000000
--- a/sys-process/iotop/files/iotop-0.6-setup.py3.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 98a5985e52e7041eb96c80dd95fd5c70634f5ee7 Mon Sep 17 00:00:00 2001
-Message-Id: <98a5985e52e7041eb96c80dd95fd5c70634f5ee7.1371536396.git.jlec@gentoo.org>
-From: Justin Lecher <jlec@gentoo.org>
-Date: Tue, 18 Jun 2013 08:19:28 +0200
-Subject: [PATCH] Make setp.py compatible with python3
-
-Dictionaries in python 3 do not contain the itervalues() method anymore.
-The values() method should be used and can also safely applied for
-python 2.
-
-Signed-off-by: Justin Lecher <jlec@gentoo.org>
----
- setup.py | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/setup.py b/setup.py
-index 7150102..9de6068 100755
---- a/setup.py
-+++ b/setup.py
-@@ -7,7 +7,7 @@ from iotop.version import VERSION
- # 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'
-
---
-1.8.2.1
-
diff --git a/sys-process/iotop/iotop-0.6.ebuild b/sys-process/iotop/iotop-0.6.ebuild
deleted file mode 100644
index ddda92f971fe..000000000000
--- a/sys-process/iotop/iotop-0.6.ebuild
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_{9..10} )
-PYTHON_REQ_USE="ncurses(+)"
-DISTUTILS_USE_SETUPTOOLS=no
-
-inherit distutils-r1 linux-info
-
-DESCRIPTION="Top-like UI used to show which process is using the I/O"
-HOMEPAGE="http://guichaz.free.fr/iotop/"
-SRC_URI="http://guichaz.free.fr/iotop/files/${P}.tar.bz2"
-
-LICENSE="GPL-2+"
-SLOT="0"
-KEYWORDS="amd64 arm arm64 ~hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv sparc x86 ~amd64-linux ~x86-linux"
-
-RDEPEND="!sys-process/iotop-c"
-
-CONFIG_CHECK="~TASK_IO_ACCOUNTING ~TASK_DELAY_ACCT ~TASKSTATS ~VM_EVENT_COUNTERS"
-
-DOCS=( NEWS README THANKS ChangeLog )
-
-PATCHES=(
- "${FILESDIR}"/${P}-setup.py3.patch
- "${FILESDIR}"/${P}-Only-split-proc-status-lines-on-the-character.patch
- "${FILESDIR}"/${P}-Ignore-invalid-lines-in-proc-status-files.patch
- "${FILESDIR}"/${P}-Actually-skip-invalid-lines-in-proc-status.patch
-)
-
-pkg_setup() {
- linux-info_pkg_setup
-}
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-04-22 18:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-22 18:09 [gentoo-commits] repo/gentoo:master commit in: sys-process/iotop/files/, sys-process/iotop/ Andreas Sturmlechner
-- strict thread matches above, loose matches on Subject: below --
2019-02-28 22:49 Patrice Clement
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox