diff --git a/hplip-ui-optional.patch b/hplip-ui-optional.patch index fa64da8..f7cbed2 100644 --- a/hplip-ui-optional.patch +++ b/hplip-ui-optional.patch @@ -1,6 +1,12 @@ -diff -up hplip-3.16.7/base/utils.py.ui-optional hplip-3.16.7/base/utils.py ---- hplip-3.16.7/base/utils.py.ui-optional 2016-07-15 12:12:28.000000000 +0200 -+++ hplip-3.16.7/base/utils.py 2016-08-12 10:12:24.599398769 +0200 +diff -up hplip-3.18.4/base/utils.py.ui-optional hplip-3.18.4/base/utils.py +--- hplip-3.18.4/base/utils.py.ui-optional 2018-04-25 12:34:16.000000000 +0200 ++++ hplip-3.18.4/base/utils.py 2018-04-26 09:27:26.487258888 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/python3 + # -*- coding: utf-8 -*- + # + # (c) Copyright 2001-2015 HP Development Company, L.P. @@ -733,6 +733,13 @@ def checkPyQtImport(): # qt3 if os.getenv('DISPLAY') and os.getenv('STARTED_FROM_MENU'): no_qt_message_gtk() @@ -52,3 +58,19 @@ diff -up hplip-3.16.7/base/utils.py.ui-optional hplip-3.16.7/base/utils.py sys.exit(1) +diff -up hplip-3.18.4/plugin.py.ui-optional hplip-3.18.4/plugin.py +--- hplip-3.18.4/plugin.py.ui-optional 2018-05-11 10:06:02.925579534 +0200 ++++ hplip-3.18.4/plugin.py 2018-05-11 10:25:08.576302069 +0200 +@@ -252,7 +252,11 @@ if mode == GUI_MODE: + # clean_exit(1) + + QApplication, ui_package = utils.import_dialog(ui_toolkit) +- ui = import_module(ui_package + ".plugindialog") ++ try: ++ ui = import_module(ui_package + ".plugindialog") ++ except ModuleNotFoundError: ++ log.error("hplip-gui not installed. GUI not available. Exiting.") ++ clean_exit(1) + if ui_toolkit == "qt5": + from PyQt5.QtWidgets import QMessageBox + elif ui_toolkit == "qt4": diff --git a/hplip.spec b/hplip.spec index 95430a7..848afa5 100644 --- a/hplip.spec +++ b/hplip.spec @@ -7,7 +7,7 @@ Summary: HP Linux Imaging and Printing Project Name: hplip Version: 3.18.4 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ and MIT and BSD Url: https://developers.hp.com/hp-linux-imaging-and-printing @@ -525,6 +525,9 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop %postun libs -p /sbin/ldconfig %changelog +* Fri May 11 2018 Zdenek Dohnal - 3.18.4-2 +- 1577078 - add other trap for missing gui + * Thu Apr 26 2018 Zdenek Dohnal - 3.18.4-1 - 3.18.4