From 3622e7ff124d955b6863e1805583fd3ea41ea83a Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 03 2016 05:49:19 +0000 Subject: import python-schedutils-0.4-6.el7 --- diff --git a/SOURCES/Update-spec-file-to-install-man-pages-for-pchrt-and-.patch b/SOURCES/Update-spec-file-to-install-man-pages-for-pchrt-and-.patch new file mode 100644 index 0000000..337f2bb --- /dev/null +++ b/SOURCES/Update-spec-file-to-install-man-pages-for-pchrt-and-.patch @@ -0,0 +1,64 @@ +From 995b053b6003aa157be5daf8f3677dedcda06445 Mon Sep 17 00:00:00 2001 +From: John Kacur +Date: Tue, 10 May 2016 17:41:31 +0200 +Subject: [PATCH] Update spec file to install man pages for pchrt and ptaskset + +Install pchrt.1 and ptaskset.1 using the spec file + +Signed-off-by: John Kacur +--- + rpm/SPECS/python-schedutils.spec | 15 ++++++++++++--- + 1 file changed, 12 insertions(+), 3 deletions(-) + +diff --git a/rpm/SPECS/python-schedutils.spec b/rpm/SPECS/python-schedutils.spec +index 24749581fd2f..084f0978a4ac 100644 +--- a/rpm/SPECS/python-schedutils.spec ++++ b/rpm/SPECS/python-schedutils.spec +@@ -4,7 +4,7 @@ + Summary: Linux scheduler python bindings + Name: python-schedutils + Version: 0.4 +-Release: 1%{?dist} ++Release: 2%{?dist} + License: GPLv2 + URL: http://git.kernel.org/?p=linux/kernel/git/acme/python-schedutils.git + Source: http://userweb.kernel.org/~acme/python-schedutils/%{name}-%{version}.tar.bz2 +@@ -28,6 +28,9 @@ rm -rf %{buildroot} + mkdir -p %{buildroot}%{_bindir} + cp -p pchrt.py %{buildroot}%{_bindir}/pchrt + cp -p ptaskset.py %{buildroot}%{_bindir}/ptaskset ++mkdir -p %{buildroot}%{_mandir}/man1 ++gzip -c pchrt.1 > %{buildroot}%{_mandir}/man1/pchrt.1.gz ++gzip -c ptaskset.1 > %{buildroot}%{_mandir}/man1/ptaskset.1.gz + + %clean + rm -rf %{buildroot} +@@ -41,8 +44,14 @@ rm -rf %{buildroot} + %if "%{python_ver}" >= "2.5" + %{python_sitearch}/*.egg-info + %endif ++%{_mandir}/man1/pchrt.1.gz ++%{_mandir}/man1/ptaskset.1.gz + + %changelog ++* Tue May 10 2016 John Kacur - 0.4-2 ++- Add man pages for pchrt and ptaskset ++- Fix and update usage messages for pchrt and ptaskset ++ + * Mon Aug 1 2011 Arnaldo Carvalho de Melo - 0.4-1 + - New upstream release. + +@@ -63,8 +72,8 @@ rm -rf %{buildroot} + * Tue Jun 10 2008 Arnaldo Carvalho de Melo - 0.1-3 + - add dist to the release tag + +-* Tue Dec 19 2007 Arnaldo Carvalho de Melo - 0.1-2 ++* Wed Dec 19 2007 Arnaldo Carvalho de Melo - 0.1-2 + - First build into rhel5-rt + +-* Tue Dec 19 2007 Arnaldo Carvalho de Melo - 0.1-1 ++* Wed Dec 19 2007 Arnaldo Carvalho de Melo - 0.1-1 + - Initial package +-- +2.4.11 + diff --git a/SOURCES/python-schedutils-Add-man-pages-for-pchrt-and-ptasks.patch b/SOURCES/python-schedutils-Add-man-pages-for-pchrt-and-ptasks.patch new file mode 100644 index 0000000..4e6392d --- /dev/null +++ b/SOURCES/python-schedutils-Add-man-pages-for-pchrt-and-ptasks.patch @@ -0,0 +1,104 @@ +From cfcbaa7607f0e57eedc4841c2e430a3065f13298 Mon Sep 17 00:00:00 2001 +From: John Kacur +Date: Tue, 10 May 2016 16:55:43 +0200 +Subject: [PATCH 2/2] python-schedutils: Add man pages for pchrt and ptaskset + +Add some minimal man pages based on the output of --help for +pchrt and ptaskset + +Signed-off-by: John Kacur +--- + pchrt.1 | 47 +++++++++++++++++++++++++++++++++++++++++++++++ + ptaskset.1 | 26 ++++++++++++++++++++++++++ + 2 files changed, 73 insertions(+) + create mode 100644 pchrt.1 + create mode 100644 ptaskset.1 + +diff --git a/pchrt.1 b/pchrt.1 +new file mode 100644 +index 000000000000..cc5136d4dbda +--- /dev/null ++++ b/pchrt.1 +@@ -0,0 +1,47 @@ ++.\" Hey, EMACS: -*- nroff -*- ++.TH PCHRT 1 "May 10 2016" ++.SH NAME ++.B pchrt (python\-schedutils) \- manipulate the real-time attributes of a process ++.SH SYNOPSIS ++pchrt [options] [prio] [pid | cmd [args...]] ++.SH OPTIONS ++.TP ++.B \-b, \-\-batch ++set policy to SCHED_BATCH ++.TP ++.B \-f, \-\-fifo ++set policy to SCHED_FIFO ++.TP ++.B \-i, \-\-idle ++set policy to SCHED_IDLE ++.TP ++.B \-p, \-\-pid ++operate on existing given pid ++.TP ++.B \-m, \-\-max ++show min and max valid priorities ++.TP ++.B \-o, \-\-other ++set policy to SCHED_OTHER ++.TP ++.B \-r, \-\-rr ++set policy to SCHED_RR (default) ++.TP ++.B \-R, \-\-reset-on-fork ++set SCHED_RESET_ON_FORK for FIFO or RR ++.TP ++.B \-h, \-\-help ++display help ++.TP ++.B Note: ++You must give a priority if changing policy. ++.SH SEE ALSO ++.BR chrt (1) ++.SH AUTHOR ++pchrt was written by Arnaldo Carvalho de Melo ++.br ++as part of python\-schedutils ++.PP ++This manual page was written by John Kacur ++.PP ++Report bugs and send patches to +diff --git a/ptaskset.1 b/ptaskset.1 +new file mode 100644 +index 000000000000..022d8f8bed65 +--- /dev/null ++++ b/ptaskset.1 +@@ -0,0 +1,26 @@ ++.\" Hey, EMACS: -*- nroff -*- ++.TH PTASKSET 1 "May 10 2016" ++.SH NAME ++.B ptaskset (python\-schedutils) \- set or get the affinity of a process ++.SH SYNOPSIS ++ptaskset [options] [mask | cpu\-list] [pid | cmd [args...]] ++.SH OPTIONS ++.TP ++.B \-p, \-\-pid ++operate on existing given pid ++.TP ++.B \-c, \-\-cpu\-list ++display and specify cpus in list format ++.TP ++.B \-h, \-\-help ++display help ++.SH SEE ALSO ++.BR taskset (1) ++.SH AUTHOR ++ptaskset was written by Arnaldo Carvalho de Melo ++.br ++as part of python\-schedutils ++.PP ++This manual page was written by John Kacur ++.PP ++Report bugs and send patches to +-- +2.4.11 + diff --git a/SOURCES/python-schedutils-Correct-typos-in-usage-messages.patch b/SOURCES/python-schedutils-Correct-typos-in-usage-messages.patch new file mode 100644 index 0000000..1206b75 --- /dev/null +++ b/SOURCES/python-schedutils-Correct-typos-in-usage-messages.patch @@ -0,0 +1,55 @@ +From 4f039736f02e3cc8d3b2240d3bb05ae6f8600dee Mon Sep 17 00:00:00 2001 +From: John Kacur +Date: Tue, 10 May 2016 15:59:31 +0200 +Subject: [PATCH 1/2] python-schedutils: Correct typos in usage messages + +Correct typos in usage messages + - "chrt" should say "pchrt" + - "taskset" should say "ptaskset" + +Also update the email address for bug reports and patches. + +Signed-off-by: John Kacur +--- + pchrt.py | 4 ++-- + ptaskset.py | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/pchrt.py b/pchrt.py +index c4f1f2c5e5ec..0761792454fa 100755 +--- a/pchrt.py ++++ b/pchrt.py +@@ -18,7 +18,7 @@ import os, schedutils, sys + + def usage(): + print '''pchrt (python-schedutils) +-usage: chrt [options] [prio] [pid | cmd [args...]] ++usage: pchrt [options] [prio] [pid | cmd [args...]] + manipulate real-time attributes of a process + -b, --batch set policy to SCHED_BATCH + -f, --fifo set policy to SCHED_FIFO +@@ -32,7 +32,7 @@ manipulate real-time attributes of a process + + You must give a priority if changing policy. + +-Report bugs and send patches to ''' ++Report bugs and send patches to ''' + return + + def show_priority_limits(policy): +diff --git a/ptaskset.py b/ptaskset.py +index 15f0ec5bfa1f..afd18477f109 100755 +--- a/ptaskset.py ++++ b/ptaskset.py +@@ -18,7 +18,7 @@ import os, schedutils, sys + + def usage(): + print '''ptaskset (python-schedutils) +-usage: taskset [options] [mask | cpu-list] [pid | cmd [args...]] ++usage: ptaskset [options] [mask | cpu-list] [pid | cmd [args...]] + set or get the affinity of a process + + -p, --pid operate on existing given pid +-- +2.4.11 + diff --git a/SOURCES/python-schedutils-Update-URL-in-python-schedutils.sp.patch b/SOURCES/python-schedutils-Update-URL-in-python-schedutils.sp.patch new file mode 100644 index 0000000..dfce1cc --- /dev/null +++ b/SOURCES/python-schedutils-Update-URL-in-python-schedutils.sp.patch @@ -0,0 +1,30 @@ +From ac9a2b761feaa93b56816ad70bb823e7c984ecb4 Mon Sep 17 00:00:00 2001 +From: John Kacur +Date: Thu, 30 Jun 2016 14:31:37 +0200 +Subject: [PATCH 2/2] python-schedutils: Update URL in python-schedutils.spec + +Update URL in python-schedutils.spec to show the proper location + +Signed-off-by: John Kacur +--- + rpm/SPECS/python-schedutils.spec | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/rpm/SPECS/python-schedutils.spec b/rpm/SPECS/python-schedutils.spec +index 084f0978a4ac..8372a898ac1c 100644 +--- a/rpm/SPECS/python-schedutils.spec ++++ b/rpm/SPECS/python-schedutils.spec +@@ -6,8 +6,8 @@ Name: python-schedutils + Version: 0.4 + Release: 2%{?dist} + License: GPLv2 +-URL: http://git.kernel.org/?p=linux/kernel/git/acme/python-schedutils.git +-Source: http://userweb.kernel.org/~acme/python-schedutils/%{name}-%{version}.tar.bz2 ++URL: https://www.kernel.org/pub/scm/libs/python/python-schedutils/python-schedutils.git ++Source: %{name}-%{version}.tar.bz2 + Group: System Environment/Libraries + BuildRequires: python-devel + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +-- +2.4.11 + diff --git a/SOURCES/schedutils.c-added-support-for-SCHED_DEADLINE.patch b/SOURCES/schedutils.c-added-support-for-SCHED_DEADLINE.patch new file mode 100644 index 0000000..8a26c37 --- /dev/null +++ b/SOURCES/schedutils.c-added-support-for-SCHED_DEADLINE.patch @@ -0,0 +1,54 @@ +From f1cd069d51c9efe12613512463004623820f100e Mon Sep 17 00:00:00 2001 +From: Jiri Kastner +Date: Thu, 23 Jun 2016 09:21:20 +0200 +Subject: [PATCH 1/2] schedutils.c: added support for SCHED_DEADLINE + +Signed-off-by: Jiri Kastner +Signed-off-by: John Kacur +--- + python-schedutils/schedutils.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/python-schedutils/schedutils.c b/python-schedutils/schedutils.c +index d852d5d6ad10..be38e1811af2 100644 +--- a/python-schedutils/schedutils.c ++++ b/python-schedutils/schedutils.c +@@ -243,6 +243,10 @@ static PyObject *get_priority(PyObject *self __unused, PyObject *args) + #ifndef SCHED_IDLE + #define SCHED_IDLE 5 + #endif ++#ifndef SCHED_DEADLINE ++#define SCHED_DEADLINE 6 ++#endif ++ + + static PyObject *schedstr(PyObject *self __unused, PyObject *args) + { +@@ -258,6 +262,7 @@ static PyObject *schedstr(PyObject *self __unused, PyObject *args) + case SCHED_FIFO: s = "SCHED_FIFO"; break; + case SCHED_BATCH: s = "SCHED_BATCH"; break; + case SCHED_IDLE: s = "SCHED_IDLE"; break; ++ case SCHED_DEADLINE: s = "SCHED_DEADLINE"; break; + default: s = "UNKNOWN"; break; + } + +@@ -282,6 +287,8 @@ static PyObject *schedfromstr(PyObject *self __unused, PyObject *args) + scheduler = SCHED_BATCH; + else if (strcmp(s, "SCHED_IDLE") == 0) + scheduler = SCHED_IDLE; ++ else if (strcmp(s, "SCHED_DEADLINE") == 0) ++ scheduler = SCHED_DEADLINE; + else { + PyErr_SetString(PyExc_OSError, "Unknown scheduler"); + return NULL; +@@ -382,6 +389,7 @@ PyMODINIT_FUNC initschedutils(void) + PyModule_AddIntConstant(m, "SCHED_RR", SCHED_RR); + PyModule_AddIntConstant(m, "SCHED_BATCH", SCHED_BATCH); + PyModule_AddIntConstant(m, "SCHED_IDLE", SCHED_IDLE); ++ PyModule_AddIntConstant(m, "SCHED_DEADLINE", SCHED_DEADLINE); + PyModule_AddIntConstant(m, "SCHED_RESET_ON_FORK", SCHED_RESET_ON_FORK); + } + +-- +2.4.11 + diff --git a/SPECS/python-schedutils.spec b/SPECS/python-schedutils.spec index 3bd0cd8..d0952b2 100644 --- a/SPECS/python-schedutils.spec +++ b/SPECS/python-schedutils.spec @@ -4,7 +4,7 @@ Summary: Linux scheduler python bindings Name: python-schedutils Version: 0.4 -Release: 4%{?dist} +Release: 6%{?dist} License: GPLv2 URL: http://git.kernel.org/?p=linux/kernel/git/acme/python-schedutils.git Source: http://userweb.kernel.org/~acme/python-schedutils/%{name}-%{version}.tar.bz2 @@ -12,12 +12,23 @@ Group: System Environment/Libraries BuildRequires: python-devel BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +Patch1: python-schedutils-Correct-typos-in-usage-messages.patch +Patch2: python-schedutils-Add-man-pages-for-pchrt-and-ptasks.patch +Patch3: Update-spec-file-to-install-man-pages-for-pchrt-and-.patch +Patch4: schedutils.c-added-support-for-SCHED_DEADLINE.patch +Patch5: python-schedutils-Update-URL-in-python-schedutils.sp.patch + %description Python interface for the Linux scheduler sched_{get,set}{affinity,scheduler} functions and friends. %prep %setup -q +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 %build %{__python} setup.py build @@ -28,6 +39,9 @@ rm -rf %{buildroot} mkdir -p %{buildroot}%{_bindir} cp -p pchrt.py %{buildroot}%{_bindir}/pchrt cp -p ptaskset.py %{buildroot}%{_bindir}/ptaskset +mkdir -p %{buildroot}%{_mandir}/man1 +gzip -c pchrt.1 > %{buildroot}%{_mandir}/man1/pchrt.1.gz +gzip -c ptaskset.1 > %{buildroot}%{_mandir}/man1/ptaskset.1.gz %clean rm -rf %{buildroot} @@ -41,8 +55,20 @@ rm -rf %{buildroot} %if "%{python_ver}" >= "2.5" %{python_sitearch}/*.egg-info %endif +%{_mandir}/man1/pchrt.1.gz +%{_mandir}/man1/ptaskset.1.gz %changelog +* Tue Jul 05 2016 John Kacur - 0.4-6 +- python-schedutils-Update-URL-in-python-schedutils.sp.patch +- schedutils.c-added-support-for-SCHED_DEADLINE.patch +Resolves: rhbz#1298388 + +* Tue May 10 2016 John Kacur - 0.4-5 +- Add man pages for pchrt and ptaskset +- Fix and update usage messages for pchrt and ptaskset +- Resolves:rhbz#948381 + * Fri Jan 24 2014 Daniel Mach - 0.4-4 - Mass rebuild 2014-01-24 @@ -72,8 +98,8 @@ rm -rf %{buildroot} * Tue Jun 10 2008 Arnaldo Carvalho de Melo - 0.1-3 - add dist to the release tag -* Tue Dec 19 2007 Arnaldo Carvalho de Melo - 0.1-2 +* Wed Dec 19 2007 Arnaldo Carvalho de Melo - 0.1-2 - First build into rhel5-rt -* Tue Dec 19 2007 Arnaldo Carvalho de Melo - 0.1-1 +* Wed Dec 19 2007 Arnaldo Carvalho de Melo - 0.1-1 - Initial package