diff --git a/Use-lsb_release-fallback-code-if-import-distro-fails.patch b/Use-lsb_release-fallback-code-if-import-distro-fails.patch index d89083c..545b019 100644 --- a/Use-lsb_release-fallback-code-if-import-distro-fails.patch +++ b/Use-lsb_release-fallback-code-if-import-distro-fails.patch @@ -1,6 +1,6 @@ -From 5ff90c0210be6b9b48f5cc269d2450e85a958ec0 Mon Sep 17 00:00:00 2001 +From ba542439639453148ea804fc4e396534cd99abb9 Mon Sep 17 00:00:00 2001 From: Martin Wilck -Date: Mon, 16 Mar 2020 14:33:35 +0100 +Date: Mon, 2 Jan 2023 15:33:07 +0100 Subject: [PATCH] Use lsb_release fallback code if "import distro" fails With python 3.8, the standard python "platform" module doesn't @@ -10,26 +10,32 @@ module by default. Catch the resulting exception, and use the already existing fallback code to determine the distribution using lsb_release. --- - base/password.py | 8 ++++++-- - installer/core_install.py | 10 +++++++--- - 2 files changed, 13 insertions(+), 5 deletions(-) + base/utils.py | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +diff --git a/base/utils.py b/base/utils.py +index 94d5c8c..458ddd8 100644 +--- a/base/utils.py ++++ b/base/utils.py +@@ -2519,10 +2519,14 @@ def get_distro_name(passwordObj = None): + name = platform.dist()[0].lower() + ver = platform.dist()[1] + except AttributeError: +- import distro +- name = distro.linux_distribution()[0].lower() +- ver = distro.linux_distribution()[1] +- distro_release_name = distro.distro_release_attr('name') ++ try: ++ import distro ++ name = distro.linux_distribution()[0].lower() ++ ver = distro.linux_distribution()[1] ++ distro_release_name = distro.distro_release_attr('name') ++ except (ImportError, AttributeError): ++ # Use fallback code below ++ pass + if not name: + found = False + log.debug("Not able to detect distro") +-- +2.39.0 -Index: hplip-3.22.4/installer/core_install.py -=================================================================== ---- hplip-3.22.4.orig/installer/core_install.py -+++ hplip-3.22.4/installer/core_install.py -@@ -651,6 +651,14 @@ class CoreInstall(object): - name = distro.linux_distribution()[0].lower() - ver = distro.linux_distribution()[1] - distro_release_name = distro.distro_release_attr('name') -+ try: -+ import distro -+ name = distro.linux_distribution()[0].lower() -+ ver = distro.linux_distribution()[1] -+ distro_release_name = distro.distro_release_attr('name') -+ except (ImportError, AttributeError): -+ # Use fallback code below -+ pass - if not name: - found = False - log.debug("Not able to detect distro") diff --git a/hplip-3.22.10.tar.gz b/hplip-3.22.10.tar.gz new file mode 100644 index 0000000..1ad17e6 --- /dev/null +++ b/hplip-3.22.10.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:533c3f2f6b53e4163ded4fd81d1f11ae6162a0f6451bd5e62a8382d0c1366624 +size 29333247 diff --git a/hplip-3.22.10.tar.gz.asc b/hplip-3.22.10.tar.gz.asc new file mode 100644 index 0000000..afc6745 --- /dev/null +++ b/hplip-3.22.10.tar.gz.asc @@ -0,0 +1,6 @@ +-----BEGIN PGP SIGNATURE----- + +iF0EABECAB0WIQRKui9m29WpWJSRDgZz13DNpZBHuQUCY1qE5wAKCRBz13DNpZBH +udspAJ4ySBCmJKGZ/YlOKRo2Z6N0vGniYACfQ9mtdi2GC12Tt1HQRYol+xu6QIw= +=XQRp +-----END PGP SIGNATURE----- diff --git a/hplip-3.22.6.tar.gz b/hplip-3.22.6.tar.gz deleted file mode 100644 index 504c230..0000000 --- a/hplip-3.22.6.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:27ed0d492febb0b47c656234820d3ce573b24ff5b62e3bf4b2c47f82868d6bb4 -size 29331408 diff --git a/hplip-3.22.6.tar.gz.asc b/hplip-3.22.6.tar.gz.asc deleted file mode 100644 index 543e129..0000000 --- a/hplip-3.22.6.tar.gz.asc +++ /dev/null @@ -1,6 +0,0 @@ ------BEGIN PGP SIGNATURE----- - -iF0EABECAB0WIQRKui9m29WpWJSRDgZz13DNpZBHuQUCYrP0iwAKCRBz13DNpZBH -uZa8AKDokQhhws3KiMK8hdTZknEmOJty3QCeJfjh9fm7MAbG6IDtKyd+1ju+pvA= -=qtZb ------END PGP SIGNATURE----- diff --git a/hplip.changes b/hplip.changes index f111979..1cdc11b 100644 --- a/hplip.changes +++ b/hplip.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Mon Jan 2 14:08:12 UTC 2023 - Martin Wilck + +- Update to 3.22.10 + * drop no-systray-failure-message.patch (fixed upstream) + * adapt Use-lsb_release-fallback-code-if-import-distro-fails.patch + (code moved to different source file upstream) + ------------------------------------------------------------------- Mon Nov 21 16:13:36 UTC 2022 - Dominique Leuenberger diff --git a/hplip.spec b/hplip.spec index b16f1dd..88b530a 100644 --- a/hplip.spec +++ b/hplip.spec @@ -1,7 +1,7 @@ # # spec file for package hplip # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,7 +24,7 @@ %define pyexe %{_bindir}/python3 %global use_qt5 1 Name: hplip -Version: 3.22.6 +Version: 3.22.10 Release: 0 Summary: HP's Printing, Scanning, and Faxing Software License: BSD-3-Clause AND GPL-2.0-or-later AND MIT @@ -62,8 +62,6 @@ Patch107: hplip-udev-rules-in-usr.patch # Patch108 add_missing_includes_and_define_GNU_SOURCE.patch adds missing '#include <...>' # and missing '#define _GNU_SOURCE' see https://bugs.launchpad.net/hplip/+bug/1456590 Patch108: add_missing_includes_and_define_GNU_SOURCE.patch -# PATCH-FIX-SUSE: GNOME no longer provides a system tray, so don't warn the user that we can't find it -Patch109: no-systray-failure-message.patch Patch110: hpijs-avoid-segfault-in-DJGenericVIP-DJGenericVIP.patch Patch112: ui5-systemtray-wait-only-10s-for-system-tray.patch # Python3 port: cleanup patches @@ -319,7 +317,6 @@ This sub-package is only required by developers. # Patch108 add_missing_includes_and_define_GNU_SOURCE.patch adds missing '#include <...>' # and missing '#define _GNU_SOURCE' see https://bugs.launchpad.net/hplip/+bug/1456590 %patch108 -p1 -b .add_missing_includes_and_define_GNU_SOURCE.orig -%patch109 -p1 -b .systemtray.py.orig %patch110 -p1 -b .boo1094141 %patch112 -p1 %patch300 -p1 -b .pcardext-python3 diff --git a/no-systray-failure-message.patch b/no-systray-failure-message.patch deleted file mode 100644 index da5c560..0000000 --- a/no-systray-failure-message.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff -urp hplip-3.17.9.orig/ui5/systemtray.py hplip-3.17.9/ui5/systemtray.py ---- hplip-3.17.9.orig/ui5/systemtray.py 2017-09-19 02:29:18.000000000 -0500 -+++ hplip-3.17.9/ui5/systemtray.py 2017-10-12 15:39:43.456026353 -0500 -@@ -848,12 +848,7 @@ def run(read_pipe): - i += 1 - - if not QSystemTrayIcon.isSystemTrayAvailable(): -- FailureUI(None, -- QApplication.translate("SystemTray", -- "No system tray detected on this system.

Unable to start, exiting.

", -- None), -- QApplication.translate("SystemTray", "HPLIP Status Service", -- None)) -+ exit(0) - else: - notifier = QSocketNotifier(read_pipe, QSocketNotifier.Read) - # QObject.notifier.activated[int].connect(app.notifierActivated)