Compare commits

...

10 Commits

Author SHA1 Message Date
Mohan Boddu 624668f00c Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
Signed-off-by: Mohan Boddu <mboddu@redhat.com>
2021-08-09 20:27:51 +00:00
Mohan Boddu 7707f0b292 Rebuilt for RHEL 9 BETA for openssl 3.0
Related: rhbz#1971065
Signed-off-by: Mohan Boddu <mboddu@redhat.com>
2021-06-16 03:25:54 +00:00
Zdenek Dohnal f72d735feb add hplip-repack.sh as a source
Related: rhbz#1969767
2021-06-09 13:19:07 +02:00
Zdenek Dohnal b42fc75ad2 1969767 - remove redundant files
Resolves: rhbz#1969767
2021-06-09 11:44:01 +02:00
Zdenek Dohnal 00d40af338 gating.yaml: Use rhel-9 2021-05-11 13:32:44 +02:00
Zdenek Dohnal 5a56869e69 Add gating yaml 2021-05-07 10:58:23 +02:00
Mohan Boddu 63d9cc21cb - Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
Signed-off-by: Mohan Boddu <mboddu@redhat.com>
2021-04-16 00:07:08 +00:00
DistroBaker 458652024f Merged update from upstream sources
This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/hplip.git#613fa6c3de1332f7181b9f955f607dfad7ebbacb
2021-03-24 23:25:59 +00:00
DistroBaker 68aa2fdae1 Merged update from upstream sources
This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/hplip.git#b2f875a7674e3bb5e14291d1abe9f6484cc256ec
2021-02-05 21:05:02 +00:00
DistroBaker 62e3d5426a Merged update from upstream sources
This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/hplip.git#46cc98726f3310223a6d323f28fc0085204ea51e
2021-02-04 02:08:07 +01:00
15 changed files with 375 additions and 322 deletions

2
.gitignore vendored
View File

@ -101,3 +101,5 @@ hplip-3.10.6.tar.gz
/hplip-3.20.6.tar.gz
/hplip-3.20.9.tar.gz
/hplip-3.20.11.tar.gz
/hplip-3.21.2.tar.gz
/hplip-3.21.2-repack.tar.gz

View File

@ -1,7 +1,7 @@
diff -up hplip-3.18.12/Makefile.am.libimageprocessor-removal hplip-3.18.12/Makefile.am
--- hplip-3.18.12/Makefile.am.libimageprocessor-removal 2019-01-08 12:51:08.629447883 +0100
+++ hplip-3.18.12/Makefile.am 2019-01-08 12:51:08.710447208 +0100
@@ -166,7 +166,7 @@ if !HPLIP_CLASS_DRIVER
diff -up hplip-3.21.2/Makefile.am.libimageprocessor-removal hplip-3.21.2/Makefile.am
--- hplip-3.21.2/Makefile.am.libimageprocessor-removal 2021-02-24 12:38:31.707900421 +0100
+++ hplip-3.21.2/Makefile.am 2021-02-24 12:38:31.735900172 +0100
@@ -167,7 +167,7 @@ if !HPLIP_CLASS_DRIVER
dist_hplip_SCRIPTS = hpssd.py __init__.py hpdio.py
endif #HPLIP_CLASS_DRIVER
@ -10,7 +10,7 @@ diff -up hplip-3.18.12/Makefile.am.libimageprocessor-removal hplip-3.18.12/Makef
dist_noinst_SCRIPTS += dat2drv.py install.py hplip-install init-suse-firewall init-iptables-firewall class_rpm_build.sh hplipclassdriver.spec createPPD.sh Makefile_dat2drv hpijs-drv
if !HPLIP_CLASS_DRIVER
@@ -594,7 +594,7 @@ hpcups_SOURCES = prnt/hpcups/HPCupsFilte
@@ -595,7 +595,7 @@ hpcups_SOURCES = prnt/hpcups/HPCupsFilte
prnt/hpcups/ImageProcessor.h
hpcups_CXXFLAGS = $(APDK_ENDIAN_FLAG) $(DBUS_CFLAGS)
@ -19,7 +19,7 @@ diff -up hplip-3.18.12/Makefile.am.libimageprocessor-removal hplip-3.18.12/Makef
#else
#hpcupsdir = $(cupsfilterdir)
#hpcups_PROGRAMS = hpcups
@@ -684,16 +684,6 @@ endif #HPLIP_CLASS_DRIVER
@@ -685,16 +685,6 @@ endif #HPLIP_CLASS_DRIVER
install-data-hook:
if HPLIP_BUILD
@ -36,9 +36,9 @@ diff -up hplip-3.18.12/Makefile.am.libimageprocessor-removal hplip-3.18.12/Makef
if !HPLIP_CLASS_DRIVER
# If scanner build, add hpaio entry to sane dll.conf.
if [ "$(scan_build)" = "yes" ]; then \
diff -up hplip-3.18.12/prnt/hpcups/HPCupsFilter.cpp.libimageprocessor-removal hplip-3.18.12/prnt/hpcups/HPCupsFilter.cpp
--- hplip-3.18.12/prnt/hpcups/HPCupsFilter.cpp.libimageprocessor-removal 2019-01-08 12:51:08.619447966 +0100
+++ hplip-3.18.12/prnt/hpcups/HPCupsFilter.cpp 2019-01-08 12:52:39.321686854 +0100
diff -up hplip-3.21.2/prnt/hpcups/HPCupsFilter.cpp.libimageprocessor-removal hplip-3.21.2/prnt/hpcups/HPCupsFilter.cpp
--- hplip-3.21.2/prnt/hpcups/HPCupsFilter.cpp.libimageprocessor-removal 2021-02-24 12:38:31.701900474 +0100
+++ hplip-3.21.2/prnt/hpcups/HPCupsFilter.cpp 2021-02-24 12:42:49.445720549 +0100
@@ -31,7 +31,6 @@
\*****************************************************************************/
@ -47,55 +47,66 @@ diff -up hplip-3.18.12/prnt/hpcups/HPCupsFilter.cpp.libimageprocessor-removal hp
#include <signal.h>
#include <sys/wait.h>
@@ -645,16 +644,10 @@ int HPCupsFilter::processRasterData(cups
@@ -659,21 +658,8 @@ int HPCupsFilter::processRasterData(cups
snprintf(hpPreProcessedRasterFile, sizeof (hpPreProcessedRasterFile), "%s/hp_%s_cups_SwapedPagesXXXXXX",CUPS_TMP_DIR, m_JA.user_name);
- image_processor_t* imageProcessor = imageProcessorCreate();
- image_processor_t* imageProcessor=NULL;
- IMAGE_PROCESSOR_ERROR result;
- //added if condition to check if pinter language is "ljzjstream"
- //If so, then bypass imageprocessing functions while running HPCUPS filter.
- if(strncmp(m_JA.printer_platform, "ljzjstream",10) == 0){
- imageProcessor = imageProcessorCreate();
- }
while (cupsRasterReadHeader2(cups_raster, &cups_header))
{
- IMAGE_PROCESSOR_ERROR result = imageProcessorStartPage(imageProcessor, &cups_header);
- if(strncmp(m_JA.printer_platform, "ljzjstream",10) == 0){
- result = imageProcessorStartPage(imageProcessor, &cups_header);
- if (result != IPE_SUCCESS){
- dbglog("DEBUG: imageProcessorStartPage failed result = %d\n", result);
- }
-
- }
current_page_number++;
if (current_page_number == 1) {
@@ -753,12 +746,6 @@ int HPCupsFilter::processRasterData(cups
@@ -772,14 +758,6 @@ int HPCupsFilter::processRasterData(cups
color_raster = rgbRaster;
black_raster = kRaster;
- if(strncmp(m_JA.printer_platform, "ljzjstream",10) == 0)
- {
- result = imageProcessorProcessLine(imageProcessor, m_pPrinterBuffer, cups_header.cupsBytesPerLine);
- if (result != IPE_SUCCESS){
- dbglog("DEBUG: imageProcessorProcessLine failed result = %d\n", result);
- }
-
- }
-
if ((y == 0) && !is_ljmono) {
//For ljmono, make sure that first line is not a blankRaster line.Otherwise printer
//may not skip blank lines before actual data
@@ -788,12 +775,6 @@ int HPCupsFilter::processRasterData(cups
@@ -809,14 +787,6 @@ int HPCupsFilter::processRasterData(cups
}
} // for() loop end
- if(strncmp(m_JA.printer_platform, "ljzjstream",10) == 0)
- {
- result = imageProcessorEndPage(imageProcessor);
- if (result != IPE_SUCCESS){
- dbglog("DEBUG: imageProcessorEndPage failed result = %d\n", result);
- }
-
- }
-
m_Job.NewPage();
if (err != NO_ERROR) {
break;
@@ -808,8 +789,6 @@ int HPCupsFilter::processRasterData(cups
rgbRaster = NULL;
@@ -832,10 +802,6 @@ int HPCupsFilter::processRasterData(cups
}
- if(strncmp(m_JA.printer_platform, "ljzjstream",10) == 0)
- {
- imageProcessorDestroy(imageProcessor);
-
- }
unlink(hpPreProcessedRasterFile);
return ret_status;
}

8
gating.yaml Normal file
View File

@ -0,0 +1,8 @@
--- !Policy
product_versions:
- rhel-9
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional}
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tedude.validation}
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.acceptance-tier.functional}

View File

@ -1,7 +0,0 @@
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iEYEABECAAYFAl9q3H0ACgkQc9dwzaWQR7mXYwCg29C1KMe4i4oKiGBuTORPyFFD
DBIAoNsiIA+A17b4QeR4GCbRhWBEYvl5
=OKLE
-----END PGP SIGNATURE-----

7
hplip-3.21.2.tar.gz.asc Normal file
View File

@ -0,0 +1,7 @@
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iEYEABECAAYFAmApuOMACgkQc9dwzaWQR7kddgCeNSUemyt9lpIk8a37ItEiX7XO
xXYAnjgAIdzPYdmSMFJ5Bqv1JLTv7RiC
=oTOD
-----END PGP SIGNATURE-----

13
hplip-fab-import.patch Normal file
View File

@ -0,0 +1,13 @@
diff --git a/ui5/fabwindow.py b/ui5/fabwindow.py
index 0b95c94..631727c 100644
--- a/ui5/fabwindow.py
+++ b/ui5/fabwindow.py
@@ -518,7 +518,7 @@ class FABWindow(QMainWindow, Ui_MainWindow):
self.__tr("Import fax addresses from LDIF or vCard"),
#user_conf.workingDirectory(),
self.user_settings.working_dir,
- "vCard (*.vcf);;LDIF (*.ldif *.ldi)"))
+ "vCard (*.vcf);;LDIF (*.ldif *.ldi)")[0])
if result:
working_directory = to_unicode(os.path.dirname(result))

31
hplip-fedora-gui.patch Normal file
View File

@ -0,0 +1,31 @@
diff --git a/base/utils.py b/base/utils.py
index d493b54..401dc41 100644
--- a/base/utils.py
+++ b/base/utils.py
@@ -727,8 +727,8 @@ def canEnterGUIMode4(): # qt4
except ImportError:
try:
import ui5
- except ImportError as e:
- log.warn(e)
+ except ImportError:
+ log.error("hplip-gui not installed. GUI not available.")
return False
return True
@@ -746,6 +746,7 @@ def checkPyQtImport(): # qt3
try:
import ui
except ImportError:
+ log.error("hplip-gui not installed. GUI not available.")
return False
log.error("PyQt not installed. GUI not available. Exiting.")
@@ -800,6 +801,7 @@ def checkPyQtImport4():
import ui5
except ImportError:
log.debug('GUI not available.')
+ log.error('hplip-gui not installed. GUI not available.')
return False
return True

View File

@ -1,8 +1,8 @@
diff --git a/prnt/cups.py b/prnt/cups.py
index a9f410a..b3e7434 100644
index a9f410a..3783a60 100644
--- a/prnt/cups.py
+++ b/prnt/cups.py
@@ -489,49 +489,72 @@ def getPPDFile2(mq,model, ppds): # New PPD find
@@ -489,78 +489,77 @@ def getPPDFile2(mq,model, ppds): # New PPD find
#Check if common ppd name is already given in models.dat(This is needed because in case of devices having more than one derivatives
#will have diffrent model name strings in device ID, because of which we don't get the common ppd name for search)
family_check=isfamilydrv(ppds)
@ -55,6 +55,8 @@ index a9f410a..b3e7434 100644
- ((prop.hpijs_build and 'hpijs' in pdls) or (prop.hpcups_build and 'hpijs' not in pdls)) or \
- ('ps' in pdls) or ('pdf' in pdls):
- matches.append((f, [p for p in pdls if p and p != 'hpijs']))
- log.debug(matches)
- num_matches = len(matches)
+ for f in ppds:
+ # ignore foomatic and gutenprint drivers
+ if 'foomatic' in f or 'gutenprint' in f:
@ -89,7 +91,22 @@ index a9f410a..b3e7434 100644
+ if pdl in ['hpijs', 'hpcups']:
+ ppd_model=ppd_model.replace('-{}'.format(pdl), '')
+ continue
+
- if num_matches == 0:
- log.debug("No PPD found for model %s using new algorithm. Trying old algorithm..." % stripped_model)
- #Using Old algo, ignores the series keyword in ppd searching.
- matches2 = list(getPPDFile(stripModel(stripped_model), ppds).items())
- log.debug(matches2)
- num_matches2 = len(matches2)
- if num_matches2:
- for f, d in matches2:
- match = ppd_pat.match(f)
- if match is not None:
- log.debug("Found match: %s" % f)
- try:
- pdls = match.group(2).split('-')
- except AttributeError:
- pdls = []
+ if not models.PDL_TYPES.get(pdl):
+ log.debug('Unknown PDL named \'{}\' - can be a new PDL or '
+ 'just a part of device name. Assume it is '
@ -98,21 +115,33 @@ index a9f410a..b3e7434 100644
+ pdls.append(pdl)
+ ppd_model=ppd_model.replace('-{}'.format(pdl), '')
+
+ if ppd_model != wanted_model:
+ if ppd_model != wanted_model and ppd_model != '{}_series'.format(wanted_model):
+ continue
+
+ log.debug("Found match: %s" % f)
+
- if (prop.hpcups_build and 'hpijs' not in f) or \
- ((prop.hpijs_build and 'hpijs' in pdls) or (prop.hpcups_build and 'hpijs' not in pdls)) or \
- ('ps' in pdls) or ('pdf' in pdls):
- matches.append((f, [p for p in pdls if p and p != 'hpijs']))
+ if (prop.hpcups_build and 'hpijs' not in f) or \
+ ((prop.hpijs_build and 'hpijs' in driver_types) or (prop.hpcups_build and 'hpijs' not in driver_types)) or \
+ ('ps' in pdls) or ('pdf' in pdls):
+ matches.append((f, pdls, [d for d in driver_types if d and d != 'hpijs']))
+
+
log.debug(matches)
num_matches = len(matches)
@@ -570,7 +593,7 @@ def getPPDFile2(mq,model, ppds): # New PPD find
- log.debug(matches)
- num_matches = len(matches)
+
+ log.debug(matches)
+ num_matches = len(matches)
if num_matches == 0:
- log.error("No PPD found for model %s using old algorithm." % stripModel(stripped_model))
+ log.error("No PPD found for model %s." % stripModel(stripped_model))
return None
elif num_matches == 1:
@@ -570,7 +569,7 @@ def getPPDFile2(mq,model, ppds): # New PPD find
# > 1
log.debug("%d matches found. Searching based on PDL: Host > PS,PDF > PCL/Other" % num_matches)
for p in [models.PDL_TYPE_HOST, models.PDL_TYPE_PS,models.PDL_TYPE_PDF, models.PDL_TYPE_PCL]:
@ -121,7 +150,7 @@ index a9f410a..b3e7434 100644
for x in pdl_list:
# default to HOST-based PDLs, as newly supported PDLs will most likely be of this type
if models.PDL_TYPES.get(x, models.PDL_TYPE_HOST) == p:
@@ -579,8 +602,8 @@ def getPPDFile2(mq,model, ppds): # New PPD find
@@ -579,8 +578,8 @@ def getPPDFile2(mq,model, ppds): # New PPD find
log.debug("%d matches found. Searching based on Filters: HPCUPS > HPIJS" % num_matches)
for p in ["hpcups","hpijs"]:

View File

@ -0,0 +1,48 @@
diff --git a/setup.py b/setup.py
index 5d48aaa..88e663f 100755
--- a/setup.py
+++ b/setup.py
@@ -399,9 +399,19 @@ else: # INTERACTIVE_MODE
#log.warning("Cannot setup fax - device does not have fax feature.")
setup_fax = False
+ norm_model = models.normalizeModelName(model).lower()
+
+ # get out if the found model is standalone scanner, hp-setup is printer/fax setup tool
+ if 'scanjet' in norm_model:
+ log.error('The device {} is a standalone scanner. '
+ 'hp-setup is a printer/MFD setup tool, '
+ 'not scanner installation tool. '.format(model))
+ log.info(log.bold('Scanners do not need a installation, but they may '
+ 'require a binary plugin (install by \'hp-plugin -i\').'))
+ clean_exit(1)
+
# ******************************* PLUGIN
- norm_model = models.normalizeModelName(model).lower()
plugin = mq.get('plugin', PLUGIN_NONE)
if ignore_plugin_check is False and plugin > PLUGIN_NONE:
diff --git a/ui5/setupdialog.py b/ui5/setupdialog.py
index c6f234b..a5041c1 100644
--- a/ui5/setupdialog.py
+++ b/ui5/setupdialog.py
@@ -1326,6 +1326,18 @@ class SetupDialog(QDialog, Ui_Dialog):
self.mq = device.queryModelByURI(self.device_uri)
back_end, is_hp, bus, model, serial, dev_file, host, zc, port = device.parseDeviceURI(self.device_uri)
self.model = models.normalizeModelName(model).lower()
+ if 'scanjet' in self.model:
+ FailureUI(self,
+ self.__tr('<b>The device {} is a standalone '
+ 'scanner.</b> <p>\'hp-setup\' is a tool '
+ 'for installing printers and multifunction '
+ 'devices. Scanners supported by HPLIP '
+ 'work out-of-the-box after HPLIP installation, '
+ 'or they may require a binary plugin, which you '
+ 'can install by \'hp-plugin -i\'.</p>'.format(model)))
+ self.displayPage(PAGE_DEVICES)
+ return
+
self.showAddPrinterPage()
elif p == PAGE_ADD_PRINTER:

View File

@ -1,18 +1,18 @@
diff -up hplip-3.18.12/prnt/hpcups/HPCupsFilter.cpp.logdir hplip-3.18.12/prnt/hpcups/HPCupsFilter.cpp
--- hplip-3.18.12/prnt/hpcups/HPCupsFilter.cpp.logdir 2019-01-08 12:31:15.346315031 +0100
+++ hplip-3.18.12/prnt/hpcups/HPCupsFilter.cpp 2019-01-08 12:47:42.314131260 +0100
@@ -643,7 +643,7 @@ int HPCupsFilter::processRasterData(cups
diff -up hplip-3.21.2/prnt/hpcups/HPCupsFilter.cpp.logdir hplip-3.21.2/prnt/hpcups/HPCupsFilter.cpp
--- hplip-3.21.2/prnt/hpcups/HPCupsFilter.cpp.logdir 2021-02-19 07:46:48.334843864 +0100
+++ hplip-3.21.2/prnt/hpcups/HPCupsFilter.cpp 2021-02-19 07:48:18.052963216 +0100
@@ -656,7 +656,7 @@ int HPCupsFilter::processRasterData(cups
char hpPreProcessedRasterFile[MAX_FILE_PATH_LEN]; //temp file needed to store raster data with swaped pages.
- sprintf(hpPreProcessedRasterFile, "%s/hp_%s_cups_SwapedPagesXXXXXX",CUPS_TMP_DIR, m_JA.user_name);
+ snprintf(hpPreProcessedRasterFile, sizeof (hpPreProcessedRasterFile), "%s/hp_%s_cups_SwapedPagesXXXXXX",CUPS_TMP_DIR, m_JA.user_name);
image_processor_t* imageProcessor = imageProcessorCreate();
while (cupsRasterReadHeader2(cups_raster, &cups_header))
diff -up hplip-3.18.12/prnt/hpcups/SystemServices.cpp.logdir hplip-3.18.12/prnt/hpcups/SystemServices.cpp
--- hplip-3.18.12/prnt/hpcups/SystemServices.cpp.logdir 2018-12-03 08:07:13.000000000 +0100
+++ hplip-3.18.12/prnt/hpcups/SystemServices.cpp 2019-01-08 12:31:15.346315031 +0100
image_processor_t* imageProcessor=NULL;
IMAGE_PROCESSOR_ERROR result;
diff -up hplip-3.21.2/prnt/hpcups/SystemServices.cpp.logdir hplip-3.21.2/prnt/hpcups/SystemServices.cpp
--- hplip-3.21.2/prnt/hpcups/SystemServices.cpp.logdir 2021-02-15 00:55:21.000000000 +0100
+++ hplip-3.21.2/prnt/hpcups/SystemServices.cpp 2021-02-19 07:46:48.334843864 +0100
@@ -38,7 +38,7 @@ SystemServices::SystemServices(int iLogL
if (iLogLevel & SAVE_OUT_FILE)
{

22
hplip-repack.sh Executable file
View File

@ -0,0 +1,22 @@
#!/usr/bin/bash
VERSION=$1
if [ "${VERSION:="*"}" == "*" ]
then
echo "Define a version of hplip as an argument."
exit 1
fi
# extract the original tarball
tar -xaf hplip-$VERSION.tar.gz || exit 1
# remove unwanted files
rm hplip-$VERSION/prnt/hpcups/ErnieFilter.{cpp,h} hplip-$VERSION/prnt/hpijs/ernieplatform.h || exit 1
# compress into a new tarball
tar -cjvf hplip-$VERSION-repack.tar.gz hplip-$VERSION || exit 1
# upload a new source tarball
#fedpkg new-sources hplip-$VERSION-repack.tar.gz || exit 1

View File

@ -1,6 +1,6 @@
diff -up hplip-3.17.11/firmware.py.typo hplip-3.17.11/firmware.py
--- hplip-3.17.11/firmware.py.typo 2018-01-12 16:50:10.338366719 +0100
+++ hplip-3.17.11/firmware.py 2018-01-12 16:50:33.563184939 +0100
diff -up hplip-3.20.11/firmware.py.typo hplip-3.20.11/firmware.py
--- hplip-3.20.11/firmware.py.typo 2021-02-03 10:53:34.311743805 +0100
+++ hplip-3.20.11/firmware.py 2021-02-03 10:54:13.229386257 +0100
@@ -99,7 +99,7 @@ try:
if mode == GUI_MODE and (ui_toolkit == 'qt4' or ui_toolkit == 'qt5'):
if not utils.canEnterGUIMode4():

View File

@ -1,273 +1,96 @@
diff --git a/align.py b/align.py
index c5a66fe..9067676 100755
--- a/align.py
+++ b/align.py
@@ -241,8 +241,13 @@ try:
# log.error("Unable to load Qt4 support. Is it installed?")
# sys.exit(1)
QApplication, ui_package = utils.import_dialog(ui_toolkit)
- ui = import_module(ui_package + ".aligndialog")
+ try:
+ ui = import_module(ui_package + ".aligndialog")
+ except ModuleNotFoundError:
+ log.error('HPLIP GUI is not available - use interactive mode '
+ '(option \'-i\') or install hplip-gui package.')
+ sys.exit(1)
#try:
if 1:
diff --git a/base/queues.py b/base/queues.py
index 04c37b1..dec7fe9 100755
--- a/base/queues.py
+++ b/base/queues.py
@@ -375,8 +375,14 @@ def main_function(passwordObj = None, mode = GUI_MODE, ui_toolkit= UI_TOOLKIT_QT
sys.exit(1)
QApplication, ui_package = utils.import_dialog(ui_toolkit)
- ui = import_module(ui_package + ".queuesconf")
- setupdialog = import_module(ui_package + ".setupdialog")
diff --git a/base/module.py b/base/module.py
index dd3efa3..04ac5b8 100644
--- a/base/module.py
+++ b/base/module.py
@@ -432,6 +432,12 @@ class Module(object):
if show_usage is not None:
sys.exit(0)
+ if mode == GUI_MODE:
+ if not utils.canEnterGUIMode4():
+ log.warn("GUI mode not available - switching to interactive mode.")
+ mode = INTERACTIVE_MODE
+ ui_toolkit = 'none'
+
+ try:
+ ui = import_module(ui_package + ".queuesconf")
+ setupdialog = import_module(ui_package + ".setupdialog")
+ except ModuleNotFoundError:
+ log.error('HPLIP GUI is not available - use interactive mode '
+ '(option \'-i\') or install hplip-gui package.')
+ sys.exit(1)
app = QApplication(sys.argv)
dialog = ui.QueuesDiagnose(None, "","",QUEUES_MSG_SENDING,passwordObj)
self.mode = mode
return opts, device_uri, printer_name, mode, ui_toolkit, lang
diff --git a/base/utils.py b/base/utils.py
index cde819f..0d6e9ff 100644
index 98437a3..9b8813b 100644
--- a/base/utils.py
+++ b/base/utils.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# (c) Copyright 2001-2018 HP Development Company, L.P.
@@ -734,6 +734,13 @@ def checkPyQtImport(): # qt3
@@ -722,6 +722,15 @@ def canEnterGUIMode4(): # qt4
log.warn(e)
return False
+ try:
+ import ui4
+ except ImportError:
+ try:
+ import ui5
+ except ImportError as e:
+ log.warn(e)
+ return False
+
return True
@@ -734,6 +743,11 @@ def checkPyQtImport(): # qt3
if os.getenv('DISPLAY') and os.getenv('STARTED_FROM_MENU'):
no_qt_message_gtk()
+ # hplip-gui sub-package (Fedora)
+ try:
+ import ui
+ except ImportError:
+ log.error("hplip-gui not installed. GUI not available. Exiting.")
+ return False
+
log.error("PyQt not installed. GUI not available. Exiting.")
return False
@@ -784,7 +791,8 @@ def checkPyQtImport4():
import PyQt5
import ui5
else:
@@ -781,11 +795,13 @@ def checkPyQtImport4():
import PyQt4
import ui4
except ImportError:
- import PyQt5
- import ui5
- else:
- log.debug("HPLIP is not installed properly or is installed without graphical support. Please reinstall HPLIP again")
+ # hplip-gui sub-package (Fedora) requires python3-qt5
+ log.error("Install the hplip-gui package for graphical support.")
return False
- return False
+ try:
+ import PyQt5
+ import ui5
+ except ImportError:
+ log.debug('GUI not available.')
+ return False
+
return True
@@ -2456,6 +2464,7 @@ def checkPyQtImport45():
except ImportError as e:
log.debug(e)
+ log.error("Install the hplip-gui package for graphical support.")
raise ImportError("GUI Modules PyQt4 and PyQt5 are not installed")
@@ -2477,6 +2486,7 @@ def import_dialog(ui_toolkit):
return (QApplication, "ui4")
except ImportError as e:
log.error(e)
+ log.error("Unable to load Qt support. Is hplip-gui package installed?")
sys.exit(1)
elif ui_toolkit == "qt5":
try:
@@ -2485,9 +2495,7 @@ def import_dialog(ui_toolkit):
return (QApplication, "ui5")
except ImportError as e:
log.error(e)
- sys.exit(1)
- else:
- log.error("Unable to load Qt support. Is it installed?")
+ log.error("Unable to load Qt support. Is hplip-gui package installed?")
sys.exit(1)
diff --git a/clean.py b/clean.py
index 3d41f04..0141f23 100755
--- a/clean.py
+++ b/clean.py
@@ -193,8 +193,13 @@ try:
else:
QApplication, ui_package = utils.import_dialog(ui_toolkit)
- ui = import_module(ui_package + ".cleandialog")
+ try:
+ ui = import_module(ui_package + ".cleandialog")
+ except ModuleNotFoundError:
+ log.error('HPLIP GUI is not available - use interactive mode '
+ '(option \'-i\') or install hplip-gui package.')
+ sys.exit(1)
#try:
if 1:
diff --git a/diagnose_plugin.py b/diagnose_plugin.py
index e4e6ebd..1bcd8c3 100755
--- a/diagnose_plugin.py
+++ b/diagnose_plugin.py
@@ -94,7 +94,14 @@ if mode == GUI_MODE:
# sys.exit(1)
QApplication, ui_package = utils.import_dialog(ui_toolkit)
- ui = import_module(ui_package + ".plugindiagnose")
+
+ try:
+ ui = import_module(ui_package + ".plugindiagnose")
+ except ModuleNotFoundError:
+ log.error('HPLIP GUI is not available - use interactive mode '
+ '(option \'-i\') or install hplip-gui package.')
+ sys.exit(1)
+
from installer import pluginhandler
app = QApplication(sys.argv)
# def checkPyQtImport5():
diff --git a/fab.py b/fab.py
index 9bd6166..e11ebc4 100755
index 5577af5..194ceed 100755
--- a/fab.py
+++ b/fab.py
@@ -854,8 +854,13 @@ if mode == GUI_MODE:
else: # qt4
QApplication, ui_package = utils.import_dialog(ui_toolkit)
- ui = import_module(ui_package + ".fabwindow")
+ try:
+ ui = import_module(ui_package + ".fabwindow")
+ except ModuleNotFoundError:
+ log.error('HPLIP GUI is not available - use interactive mode '
+ '(option \'-i\') or install hplip-gui package.')
+ sys.exit(1)
log.set_module("hp-fab(qt4)")
diff --git a/firmware.py b/firmware.py
index 33e044d..a38058b 100755
--- a/firmware.py
+++ b/firmware.py
@@ -118,7 +118,13 @@ try:
# log.error("Unable to load Qt4 support. Is it installed?")
# sys.exit(1)
QApplication, ui_package = utils.import_dialog(ui_toolkit)
- ui = import_module(ui_package + ".firmwaredialog")
+
+ try:
+ ui = import_module(ui_package + ".firmwaredialog")
+ except ModuleNotFoundError:
+ log.error('HPLIP GUI is not available - use interactive mode '
+ '(option \'-i\') or install hplip-gui package.')
+ sys.exit(1)
if ui_toolkit == 'qt3':
try:
diff --git a/info.py b/info.py
index 6c28531..5b05eda 100755
--- a/info.py
+++ b/info.py
@@ -172,7 +172,13 @@ try:
else: # GUI mode
QApplication, ui_package = utils.import_dialog(ui_toolkit)
- ui = import_module(ui_package + ".infodialog")
+
+ try:
+ ui = import_module(ui_package + ".infodialog")
+ except ModuleNotFoundError:
+ log.error('HPLIP GUI is not available - use interactive mode '
+ '(option \'-i\') or install hplip-gui package.')
+ sys.exit(1)
if 1:
app = QApplication(sys.argv)
diff --git a/plugin.py b/plugin.py
index f54f726..58d6006 100755
--- a/plugin.py
+++ b/plugin.py
@@ -252,7 +252,14 @@ 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 is not available - use interactive mode '
+ '(option \'-i\') or install hplip-gui package.')
+ sys.exit(1)
+
if ui_toolkit == "qt5":
from PyQt5.QtWidgets import QMessageBox
elif ui_toolkit == "qt4":
diff --git a/sendfax.py b/sendfax.py
index 491c8f9..0815ee7 100755
--- a/sendfax.py
+++ b/sendfax.py
@@ -211,7 +211,13 @@ if mode == GUI_MODE:
# sys.exit(1)
QApplication, ui_package = utils.import_dialog(ui_toolkit)
- ui = import_module(ui_package + ".sendfaxdialog")
+
+ try:
+ ui = import_module(ui_package + ".sendfaxdialog")
+ except ModuleNotFoundError:
+ log.error('HPLIP GUI is not available - use interactive mode '
+ '(option \'-i\') or install hplip-gui package.')
+ sys.exit(1)
app = QApplication(sys.argv)
dlg = ui.SendFaxDialog(None, printer_name, device_uri, mod.args)
diff --git a/setup.py b/setup.py
index 2608f95..b09a8ef 100755
--- a/setup.py
+++ b/setup.py
@@ -310,7 +310,12 @@ if mode == GUI_MODE:
# clean_exit(1)
QApplication, ui_package = utils.import_dialog(ui_toolkit)
- ui = import_module(ui_package + ".setupdialog")
+ try:
+ ui = import_module(ui_package + ".setupdialog")
+ except ModuleNotFoundError:
+ log.error('HPLIP GUI is not available - use interactive mode '
+ '(option \'-i\') or install hplip-gui package.')
+ sys.exit(1)
app = QApplication(sys.argv)
log.debug("Sys.argv=%s printer_name=%s param=%s jd_port=%s device_uri=%s remove=%s" % (sys.argv, printer_name, param, jd_port, device_uri, remove))
diff --git a/testpage.py b/testpage.py
index a5ed2bc..2a707a1 100755
--- a/testpage.py
+++ b/testpage.py
@@ -77,7 +77,13 @@ try:
# log.error("Unable to load Qt4 support. Is it installed?")
# sys.exit(1)
QApplication, ui_package = utils.import_dialog(ui_toolkit)
- ui = import_module(ui_package + ".printtestpagedialog")
+
+ try:
+ ui = import_module(ui_package + ".printtestpagedialog")
+ except ModuleNotFoundError:
+ log.error('HPLIP GUI is not available - use interactive mode '
+ '(option \'-i\') or install hplip-gui package.')
+ sys.exit(1)
log.set_module("%s(UI)" % __mod__)
@@ -776,14 +776,15 @@ mod.setUsage(module.USAGE_FLAG_NONE)
opts, device_uri, printer_name, mode, ui_toolkit, loc = \
mod.parseStdOpts(handle_device_printer=False)
-if ui_toolkit == 'qt3':
- if not utils.canEnterGUIMode():
- log.error("%s GUI mode requires GUI support (try running with --qt4). Entering interactive mode." % __mod__)
- mode = INTERACTIVE_MODE
-else:
- if not utils.canEnterGUIMode4():
- log.error("%s GUI mode requires GUI support (try running with --qt3). Entering interactive mode." % __mod__)
- mode = INTERACTIVE_MODE
+if ui_toolkit != 'none':
+ if ui_toolkit == 'qt3':
+ if not utils.canEnterGUIMode():
+ log.error("%s GUI mode requires GUI support (try running with --qt4). Entering interactive mode." % __mod__)
+ mode = INTERACTIVE_MODE
+ else:
+ if not utils.canEnterGUIMode4():
+ log.error("%s GUI mode requires GUI support (try running with --qt3). Entering interactive mode." % __mod__)
+ mode = INTERACTIVE_MODE
if mode == GUI_MODE:

View File

@ -6,17 +6,28 @@
Summary: HP Linux Imaging and Printing Project
Name: hplip
Version: 3.20.11
Release: 2%{?dist}
Version: 3.21.2
Release: 6%{?dist}
License: GPLv2+ and MIT and BSD and IJG and Public Domain and GPLv2+ with exceptions and ISC
Url: https://developers.hp.com/hp-linux-imaging-and-printing
Source0: http://downloads.sourceforge.net/sourceforge/hplip/hplip-%{version}.tar.gz
# Original source tarball
# Source0: http://downloads.sourceforge.net/sourceforge/hplip/hplip-%%{version}.tar.gz
#
# Repacked source tarball without redundant files - always repack
# the original tarball once a new version arrives by:
#
# ./hplip-repack.sh <version>
#
Source0: hplip-%{version}-repack.tar.gz
Source1: hpcups-update-ppds.sh
Source2: copy-deviceids.py
Source3: %{name}.appdata.xml
Source4: hp-laserjet_cp_1025nw.ppd.gz
Source5: hp-laserjet_professional_p_1102w.ppd.gz
Source6: hplip-repack.sh
Patch1: hplip-pstotiff-is-rubbish.patch
Patch2: hplip-strstr-const.patch
Patch3: hplip-ui-optional.patch
@ -168,6 +179,19 @@ Patch58: hplip-timeb-removed.patch
# non-sudoers cannot authenticate
# reported upstream https://bugs.launchpad.net/hplip/+bug/1904888
Patch59: hplip-check-userperms.patch
# 1919556 - hp-fab crashed: QFileDialog.getOpenFileName is not used correctly
# getOpenFileName returns a tuple, but hp-fab expects a simple variable
# reported upstream as https://bugs.launchpad.net/hplip/+bug/1914743
Patch60: hplip-fab-import.patch
# if an user tries to install scanner via hp-setup (printer/fax utility)
# it fails further down - break out earlier with a message
# reported upstream as https://bugs.launchpad.net/hplip/+bug/1916114
Patch61: hplip-hpsetup-noscanjets.patch
%if 0%{?fedora} || 0%{?rhel} <= 8
# mention hplip-gui if you want to have GUI
Patch1000: hplip-fedora-gui.patch
%endif
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
@ -372,8 +396,6 @@ done
# hplip appdata
%patch26 -p1 -b .appdata
rm prnt/hpcups/ErnieFilter.{cpp,h} prnt/hpijs/ernieplatform.h
# hp-check shows 'CUPS incompatible or not running' even if CUPS is running (bug #1456467)
%patch27 -p1 -b .check-cups
@ -451,6 +473,16 @@ rm prnt/hpcups/ErnieFilter.{cpp,h} prnt/hpijs/ernieplatform.h
%patch58 -p1 -b .timed-removed
# 1899410 - non-sudoers cannot authenticate because of bad username in prompt
%patch59 -p1 -b .check-userperms
# 1919556 - hp-fab crashed: QFileDialog.getOpenFileName is not used correctly
%patch60 -p1 -b .fab-import
# if an user tries to install scanner via hp-setup (printer/fax utility)
# it fails further down - break out earlier with a message
%patch61 -p1 -b .hpsetup-noscanjets
%if 0%{?fedora} || 0%{?rhel} <= 8
# mention hplip-gui should be installed if you want GUI
%patch1000 -p1 -b .fedora-gui
%endif
sed -i.duplex-constraints \
-e 's,\(UIConstraints.* \*Duplex\),//\1,' \
@ -536,6 +568,7 @@ rm -f %{buildroot}%{_bindir}/foomatic-rip \
%if 0%{?rhel} > 8
rm -rf %{buildroot}%{_bindir}/hp-check \
%{buildroot}%{_bindir}/hp-devicesettings \
%{buildroot}%{_bindir}/hp-diagnose_plugin \
%{buildroot}%{_bindir}/hp-faxsetup \
%{buildroot}%{_bindir}/hp-linefeedcal \
%{buildroot}%{_bindir}/hp-makecopies \
@ -552,6 +585,7 @@ rm -rf %{buildroot}%{_bindir}/hp-check \
%{buildroot}%{_datadir}/hplip/base/imageprocessing.py* \
%{buildroot}%{_datadir}/hplip/check.py* \
%{buildroot}%{_datadir}/hplip/devicesettings.py* \
%{buildroot}%{_datadir}/hplip/diagnose_plugin.py* \
%{buildroot}%{_datadir}/hplip/faxsetup.py* \
%{buildroot}%{_datadir}/hplip/linefeedcal.py* \
%{buildroot}%{_datadir}/hplip/makecopies.py* \
@ -639,11 +673,6 @@ rm -f %{buildroot}%{_unitdir}/hplip-printer@.service
# window), so don't ship the launcher yet.
rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop
# hp-setup needs to have cups service enabled and running for setups of queues
%pre
%{_bindir}/systemctl start cups &>/dev/null ||:
%{_bindir}/systemctl enable cups &>/dev/null ||:
%post
# timeout is to prevent possible freeze during update
%{_bindir}/timeout 10m -k 15m %{_bindir}/hpcups-update-ppds &>/dev/null ||:
@ -661,7 +690,6 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop
%{_bindir}/hp-clean
%{_bindir}/hp-colorcal
%{_bindir}/hp-config_usb_printer
%{_bindir}/hp-diagnose_plugin
%{_bindir}/hp-diagnose_queues
%{_bindir}/hp-fab
%{_bindir}/hp-firmware
@ -695,7 +723,6 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop
%{_datadir}/hplip/clean.py*
%{_datadir}/hplip/colorcal.py*
%{_datadir}/hplip/config_usb_printer.py*
%{_datadir}/hplip/diagnose_plugin.py*
%{_datadir}/hplip/diagnose_queues.py*
%{_datadir}/hplip/fab.py*
%{_datadir}/hplip/fax
@ -761,6 +788,7 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop
%files gui
%{_bindir}/hp-check
%{_bindir}/hp-devicesettings
%{_bindir}/hp-diagnose_plugin
%{_bindir}/hp-faxsetup
%{_bindir}/hp-linefeedcal
%{_bindir}/hp-makecopies
@ -776,6 +804,7 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop
%{_datadir}/icons/hicolor/*/apps/*
%{_datadir}/hplip/check.py*
%{_datadir}/hplip/devicesettings.py*
%{_datadir}/hplip/diagnose_plugin.py*
%{_datadir}/hplip/faxsetup.py*
%{_datadir}/hplip/linefeedcal.py*
%{_datadir}/hplip/makecopies.py*
@ -797,6 +826,43 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop
%config(noreplace) %{_sysconfdir}/sane.d/dll.d/hpaio
%changelog
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 3.21.2-6
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Wed Jun 16 2021 Mohan Boddu <mboddu@redhat.com> - 3.21.2-5
- Rebuilt for RHEL 9 BETA for openssl 3.0
Related: rhbz#1971065
* Wed Jun 09 2021 Zdenek Dohnal <zdohnal@redhat.com> - 3.21.2-4
- add hplip-repack.sh as a source
* Wed Jun 09 2021 Zdenek Dohnal <zdohnal@redhat.com> - 3.21.2-3
- 1969767 - remove redundant files
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 3.21.2-2
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Fri Feb 19 2021 Zdenek Dohnal <zdohnal@redhat.com> - 3.21.2-1
- 1929977 - hplip-3.21.2 is available
* Fri Feb 19 2021 Zdenek Dohnal <zdohnal@redhat.com> - 3.20.11-6
- get out of hp-setup if the device is a standalone scanner
* Thu Feb 18 2021 Zdenek Dohnal <zdohnal@redhat.com> - 3.20.11-6
- remove the old search algorithm
* Fri Feb 05 2021 Zdenek Dohnal <zdohnal@redhat.com> - 3.20.11-5
- 1925259 - %pre scriptlet enables and starts cups.service, which is unnecessary
- 1919556 - hp-fab crashed: QFileDialog.getOpenFileName is not used correctly
* Tue Feb 02 2021 Zdenek Dohnal <zdohnal@redhat.com> - 3.20.11-4
- 1912147 - Enable matching for '<model>_series' drivers in PPD search algorithm
- rework optional gui messages
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.20.11-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Thu Jan 14 2021 Zdenek Dohnal <zdohnal@redhat.com> - 3.20.11-2
- apply eln changes

View File

@ -1 +1 @@
SHA512 (hplip-3.20.11.tar.gz) = f583fb4140a29c5e21956c3e51fe3620baa65d33b40447af419d7fc61473a1148a1873216a84e89be785b155ee8e9aebd5e3eb19d2ded82b8415b1a35de1b55d
SHA512 (hplip-3.21.2-repack.tar.gz) = d39469676d518bee0c36a0fff0e74f140c685148217fcab07d71dc3809b2114e3cfea10968937d0844fb0518c74a1653b346d6e64320fa9b969e5b40a425422b