From 14c28bd71ee7d79fbd50dd81b8f84722783c9ad5 Mon Sep 17 00:00:00 2001 From: John Kacur Date: Wed, 13 Dec 2023 11:07:47 -0500 Subject: [PATCH] Don't start the gui if a display is not available Revert removing distutils for rhel8 Update the License tag in the specfile to the spdx version Resolves: RHEL-19179 Signed-off-by: John Kacur --- Add-SPDX-license-identifiers.patch | 14 +++--- ...-the-gui-if-a-display-is-not-availab.patch | 34 +++++++++++++ tuna-Remove-distutils-from-setup.patch | 50 ------------------- tuna.spec | 16 ++++-- 4 files changed, 52 insertions(+), 62 deletions(-) create mode 100644 tuna-Don-t-start-the-gui-if-a-display-is-not-availab.patch delete mode 100644 tuna-Remove-distutils-from-setup.patch diff --git a/Add-SPDX-license-identifiers.patch b/Add-SPDX-license-identifiers.patch index 3c028c1..944dcb8 100644 --- a/Add-SPDX-license-identifiers.patch +++ b/Add-SPDX-license-identifiers.patch @@ -1,7 +1,7 @@ -From 2cac6f2f0280ab45a1436881e473bf80f658068c Mon Sep 17 00:00:00 2001 +From 8c9b74f89c616a7aebbbd159e71aeb3c49979472 Mon Sep 17 00:00:00 2001 From: Clark Williams Date: Thu, 17 Aug 2023 08:12:38 -0500 -Subject: [PATCH 2/3] Add SPDX license identifiers +Subject: [PATCH 1/2] Add SPDX license identifiers use SPDX license identifiers to clarify the licences under which tuna is released. @@ -81,15 +81,15 @@ index 2ca87e9edc62..a65117637160 100755 import getopt import sys diff --git a/setup.py b/setup.py -index eed81cb0fca0..c53af9ef2f73 100755 +index f3e36529fefb..a00adb9721a8 100755 --- a/setup.py +++ b/setup.py @@ -1,4 +1,5 @@ #!/usr/bin/python3 +# SPDX-License-Identifier: GPL-2.0-only - import os - import sysconfig - from os.path import isfile, relpath + from distutils.sysconfig import get_python_lib + from distutils.core import setup + from os.path import isfile, join diff --git a/testuna b/testuna index 4bf91ebdb76f..cb98640c0167 100755 --- a/testuna @@ -353,5 +353,5 @@ index de9846bb5fae..1051983e53f9 100644 Functions to translate a scheduling policy into either a string name or an equivalent integer -- -2.42.0 +2.41.0 diff --git a/tuna-Don-t-start-the-gui-if-a-display-is-not-availab.patch b/tuna-Don-t-start-the-gui-if-a-display-is-not-availab.patch new file mode 100644 index 0000000..d879b57 --- /dev/null +++ b/tuna-Don-t-start-the-gui-if-a-display-is-not-availab.patch @@ -0,0 +1,34 @@ +From f2763aaed8f421bcf266a3122a84c41a7441a5d9 Mon Sep 17 00:00:00 2001 +From: John Kacur +Date: Mon, 11 Dec 2023 16:29:02 -0500 +Subject: [PATCH] tuna: Don't start the gui if a display is not available + +This is intended for the getopt branch of tuna + +Don't start the gui if a display is not available. + +Signed-off-by: John Kacur +--- + tuna-cmd.py | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/tuna-cmd.py b/tuna-cmd.py +index 38e7017336a5..ff2920f06d6f 100755 +--- a/tuna-cmd.py ++++ b/tuna-cmd.py +@@ -821,6 +821,12 @@ def main(): + sys.exit(2) + + if run_gui: ++ # Don't try to start the gui if no display is available ++ display = os.getenv("DISPLAY") ++ if not display: ++ usage() ++ return ++ + try: + from tuna import tuna_gui + except ImportError: +-- +2.42.0 + diff --git a/tuna-Remove-distutils-from-setup.patch b/tuna-Remove-distutils-from-setup.patch deleted file mode 100644 index f4e41cb..0000000 --- a/tuna-Remove-distutils-from-setup.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 29ee3b08da1b855cd4744223c7fd6a6599e5e11a Mon Sep 17 00:00:00 2001 -From: John Kacur -Date: Thu, 16 Feb 2023 14:29:15 -0500 -Subject: [PATCH 1/3] tuna: Remove distutils from setup - -distutils is deprecated. Replace it with sysconfig and setuptools - -Signed-off-by: John Kacur ---- - setup.py | 17 ++++++++++------- - 1 file changed, 10 insertions(+), 7 deletions(-) - -diff --git a/setup.py b/setup.py -index f3e36529fefb..eed81cb0fca0 100755 ---- a/setup.py -+++ b/setup.py -@@ -1,15 +1,18 @@ - #!/usr/bin/python3 --from distutils.sysconfig import get_python_lib --from distutils.core import setup --from os.path import isfile, join --import glob - import os -+import sysconfig -+from os.path import isfile, relpath -+from setuptools import setup - - if isfile("MANIFEST"): -- os.unlink("MANIFEST") -+ os.unlink("MANIFEST") -+ -+SCHEME = 'rpm_prefix' -+if SCHEME not in sysconfig.get_scheme_names(): -+ SCHEME = 'posix_prefix' - - # Get PYTHONLIB with no prefix so --prefix installs work. --PYTHONLIB = join(get_python_lib(standard_lib=1, prefix=''), 'site-packages') -+PYTHONLIB = relpath(sysconfig.get_path('platlib', SCHEME), '/usr') - - setup(name="tuna", - version = "0.18", -@@ -25,4 +28,4 @@ thread/IRQ level. Allows isolating CPUs for use by a specific application and mo - threads and interrupts to a CPU by just dragging and dropping them. - """, - packages = ["tuna", "tuna/gui"], -- ) -+) --- -2.42.0 - diff --git a/tuna.spec b/tuna.spec index cbfd4ba..7e80738 100644 --- a/tuna.spec +++ b/tuna.spec @@ -1,7 +1,7 @@ Name: tuna Version: 0.18 -Release: 8%{?dist} -License: GPLv2 +Release: 9%{?dist} +License: GPL-2.0-only AND LGPL-2.1-only Summary: Application tuning GUI & command line utility Group: Applications/System Source: https://www.kernel.org/pub/software/utils/tuna/%{name}-%{version}.tar.xz @@ -22,9 +22,9 @@ Patch4: tuna-tuna_gui.py-use-fstrings.patch Patch5: tuna-tuna-cmd.py-use-fstrings.patch Patch6: tuna-Adapt-show_threads-cgroup-output-to-terminal-si.patch Patch7: tuna-Fix-show_threads-cgroup-without-a-term.patch -Patch8: tuna-Remove-distutils-from-setup.patch -Patch9: Add-SPDX-license-identifiers.patch -Patch10: tuna-Remove-spec-file-from-git.patch +Patch8: Add-SPDX-license-identifiers.patch +Patch9: tuna-Remove-spec-file-from-git.patch +Patch10: tuna-Don-t-start-the-gui-if-a-display-is-not-availab.patch %description Provides interface for changing scheduler and IRQ tunables, at whole CPU and at @@ -83,6 +83,12 @@ rm -rf %{buildroot} %{_datadir}/polkit-1/actions/org.tuna.policy %changelog +* Wed Dec 13 2023 John Kacur - 0.18-9 +- Don't start the gui if a display is not available +- Revert removing distutils for rhel8 +- Update the License tag in the specfile to the spdx version +Resolves: RHEL-19179 + * Mon Dec 11 2023 John Kacur - 0.18-8 - Remove deprecated distutils from setup - Adjust SPDX patch to accomdate the removed distutils