[AUTOPATCHER-CORE] Upgrade iotop to 1.25 - 3.0 upgrade (#7139)

Co-authored-by: Harshit Gupta <guptaharshit@microsoft.com>
This commit is contained in:
CBL-Mariner-Bot 2024-02-13 13:38:08 -08:00 коммит произвёл GitHub
Родитель f3a84e32bd
Коммит 0fb0227f2a
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
5 изменённых файлов: 43 добавлений и 107 удалений

Просмотреть файл

@ -1,31 +0,0 @@
From 99c8d7cedce81f17b851954d94bfa73787300599 Mon Sep 17 00:00:00 2001
From: Christophe Vu-Brugier <cvubrugier@fastmail.fm>
Date: Fri, 17 Oct 2014 13:49:31 +0200
Subject: [PATCH] Fix build error with Python 3 caused by itervalues() in
setup.py
The itervalues() method is not available in Python 3. As a
consequence, this patch replaces the call to itervalues() in setup.py
with a call to values() which works on both Python 2 and Python 3.
Signed-off-by: Christophe Vu-Brugier <cvubrugier@fastmail.fm>
Signed-off-by: Paul Wise <pabs3@bonedaddy.net>
---
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'
--
2.11.4.GIT

Просмотреть файл

@ -1,46 +0,0 @@
From 5bdd01c3b3b1c415c71b00b2374538995f63597c Mon Sep 17 00:00:00 2001
From: Paul Wise <pabs3@bonedaddy.net>
Date: Sun, 29 Apr 2018 11:40:58 +0800
Subject: [PATCH] Switch from python to python3
Python 2 will be EOL in 2020 so Python 3 is preferrable.
See-also: https://pythonclock.org/
---
iotop.py | 2 +-
sbin/iotop | 2 +-
setup.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/iotop.py b/iotop.py
index 13ed873..666c6b4 100755
--- a/iotop.py
+++ b/iotop.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# iotop: Display I/O usage of processes in a top like UI
# Copyright (c) 2007, 2008 Guillaume Chazarain <guichaz@gmail.com>
# GPL version 2 or later
diff --git a/sbin/iotop b/sbin/iotop
index c5202d3..bb23a6e 100755
--- a/sbin/iotop
+++ b/sbin/iotop
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# iotop: Display I/O usage of processes in a top like UI
# Copyright (c) 2007, 2008 Guillaume Chazarain <guichaz@gmail.com>, GPLv2
# See iotop --help for some help
diff --git a/setup.py b/setup.py
index 9de6068..e87bfaa 100755
--- a/setup.py
+++ b/setup.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
from distutils.core import setup
from distutils.command import install as distutils_install
--
2.11.4.GIT

Просмотреть файл

@ -1,5 +1,5 @@
{
"Signatures": {
"iotop-0.6.tar.gz": "1a7c02fd3758bb048d8af861c5f8735eb3ee9abadeaa787f27b8af2b1eaee8ce"
"iotop-1.25.tar.gz": "51f72021c06044013a9502127160c01f2499ec06dadc4e8a2538da8162676386"
}
}

Просмотреть файл

@ -1,49 +1,62 @@
Summary: Iotop is a Python program with a top like UI used to show the processes and their corresponding IO activity.
%global _hardened_build 1
Summary: Simple top-like I/O monitor (implemented in C).
Name: iotop
Version: 0.6
Release: 10%{?dist}
Version: 1.25
Release: 1%{?dist}
License: GPLv2
Vendor: Microsoft Corporation
Distribution: Azure Linux
Group: System/Monitoring
URL: http://guichaz.free.fr/iotop/
Source0: http://guichaz.free.fr/iotop/files/%{name}-%{version}.tar.gz
# Fix build issue with Python 3
# https://repo.or.cz/iotop.git/commit/99c8d7cedce81f17b851954d94bfa73787300599
Patch0: %{name}-itervalues.patch
# Build explicitly with Python 3
# https://repo.or.cz/iotop.git/commit/5bdd01c3b3b1c415c71b00b2374538995f63597c
Patch1: %{name}-use-py3.patch
BuildRequires: python3-devel
Requires: python3
Requires: python3-curses
BuildArch: noarch
URL: https://github.com/tomas-m/iotop
# Source0: https://github.com/tomas-m/%{name}/archive/refs/tags/v%{version}.tar.gz
Source0: %{name}-%{version}.tar.gz
BuildRequires: gcc
BuildRequires: gnupg2
BuildRequires: ncurses-devel
BuildRequires: make
BuildRequires: pkgconfig(ncursesw)
%description
Iotop is a Python program with a top like UI used to show the processes and their corresponding IO activity.
iotop does for I/O usage what top(1) does for CPU usage. It watches I/O
usage information output by the Linux kernel and displays a table of
current I/O usage by processes on the system. It is handy for answering
the question "Why is the disk churning so much?".
iotop requires a Linux kernel built with the CONFIG_TASKSTATS,
CONFIG_TASK_DELAY_ACCT, CONFIG_TASK_IO_ACCOUNTING and
CONFIG_VM_EVENT_COUNTERS config options on.
This package actually an alternative re-implementation of the older
Python-based iotop in C, optimized for performance. Normally a monitoring
tool intended to be used on a system under heavy stress should use the
least additional resources as possible.
%prep
%autosetup -p1
%build
%py3_build
%set_build_flags
NO_FLTO=1 %make_build
%install
%py3_install
V=1 STRIP=: %make_install
# %%check
# This package does not have any tests
%files
%defattr(-,root,root)
%files
%license COPYING
%doc NEWS THANKS
%{python3_sitelib}/%{name}*.egg-info
%{python3_sitelib}/%{name}/
%{_sbindir}/%{name}
%{_mandir}/man8/%{name}*
%license LICENSE
%{_sbindir}/iotop
%{_mandir}/man8/iotop.8*
%changelog
* Mon Feb 12 2024 Harshit Gupta <guptaharshit@microsoft.com> - 1.25-1
- Auto-upgrade to 1.25 - 3.0 upgrade
- Change the package to iotop-c (iotop but with C-based implementation)
- Re-import from Fedora 40 (license: MIT)
* Wed May 25 2022 Nicolas Guibourge <nicolasg@microsoft.com> - 0.6-10
- Add dependency on python3-curses

Просмотреть файл

@ -7281,8 +7281,8 @@
"type": "other",
"other": {
"name": "iotop",
"version": "0.6",
"downloadUrl": "http://guichaz.free.fr/iotop/files/iotop-0.6.tar.gz"
"version": "1.25",
"downloadUrl": "https://github.com/tomas-m/iotop/archive/refs/tags/v1.25.tar.gz"
}
}
},