diff --git a/.gitignore b/.gitignore index 344f1b9..0197a9f 100644 --- a/.gitignore +++ b/.gitignore @@ -101,3 +101,4 @@ 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 diff --git a/0025-Remove-all-ImageProcessor-functionality-which-is-clo.patch b/0025-Remove-all-ImageProcessor-functionality-which-is-clo.patch index 6a975cd..1582480 100644 --- a/0025-Remove-all-ImageProcessor-functionality-which-is-clo.patch +++ b/0025-Remove-all-ImageProcessor-functionality-which-is-clo.patch @@ -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 #include -@@ -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; } diff --git a/hplip-3.20.9.tar.gz.asc b/hplip-3.20.9.tar.gz.asc deleted file mode 100644 index 244c435..0000000 --- a/hplip-3.20.9.tar.gz.asc +++ /dev/null @@ -1,7 +0,0 @@ ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.4.11 (GNU/Linux) - -iEYEABECAAYFAl9q3H0ACgkQc9dwzaWQR7mXYwCg29C1KMe4i4oKiGBuTORPyFFD -DBIAoNsiIA+A17b4QeR4GCbRhWBEYvl5 -=OKLE ------END PGP SIGNATURE----- diff --git a/hplip-3.21.2.tar.gz.asc b/hplip-3.21.2.tar.gz.asc new file mode 100644 index 0000000..c99a1cd --- /dev/null +++ b/hplip-3.21.2.tar.gz.asc @@ -0,0 +1,7 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.11 (GNU/Linux) + +iEYEABECAAYFAmApuOMACgkQc9dwzaWQR7kddgCeNSUemyt9lpIk8a37ItEiX7XO +xXYAnjgAIdzPYdmSMFJ5Bqv1JLTv7RiC +=oTOD +-----END PGP SIGNATURE----- diff --git a/hplip-find-driver.patch b/hplip-find-driver.patch index 4f11bb8..f991967 100644 --- a/hplip-find-driver.patch +++ b/hplip-find-driver.patch @@ -1,8 +1,8 @@ diff --git a/prnt/cups.py b/prnt/cups.py -index a9f410a..733891b 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..733891b 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..733891b 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 ' @@ -102,17 +119,29 @@ index a9f410a..733891b 100644 + 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..733891b 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"]: diff --git a/hplip-hpsetup-noscanjets.patch b/hplip-hpsetup-noscanjets.patch new file mode 100644 index 0000000..5c956a0 --- /dev/null +++ b/hplip-hpsetup-noscanjets.patch @@ -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('The device {} is a standalone ' ++ 'scanner.

\'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\'.

'.format(model))) ++ self.displayPage(PAGE_DEVICES) ++ return ++ + self.showAddPrinterPage() + + elif p == PAGE_ADD_PRINTER: diff --git a/hplip-logdir.patch b/hplip-logdir.patch index e18bb5a..4b517a5 100644 --- a/hplip-logdir.patch +++ b/hplip-logdir.patch @@ -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) { diff --git a/hplip.spec b/hplip.spec index 8910dfd..4e1628b 100644 --- a/hplip.spec +++ b/hplip.spec @@ -6,8 +6,8 @@ Summary: HP Linux Imaging and Printing Project Name: hplip -Version: 3.20.11 -Release: 5%{?dist} +Version: 3.21.2 +Release: 1%{?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 @@ -172,6 +172,10 @@ Patch59: hplip-check-userperms.patch # 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 @@ -462,6 +466,9 @@ rm prnt/hpcups/ErnieFilter.{cpp,h} prnt/hpijs/ernieplatform.h %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 @@ -810,6 +817,15 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop %config(noreplace) %{_sysconfdir}/sane.d/dll.d/hpaio %changelog +* Fri Feb 19 2021 Zdenek Dohnal - 3.21.2-1 +- 1929977 - hplip-3.21.2 is available + +* Fri Feb 19 2021 Zdenek Dohnal - 3.20.11-6 +- get out of hp-setup if the device is a standalone scanner + +* Thu Feb 18 2021 Zdenek Dohnal - 3.20.11-6 +- remove the old search algorithm + * Fri Feb 05 2021 Zdenek Dohnal - 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 diff --git a/sources b/sources index 6cdec0f..e254a6d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (hplip-3.20.11.tar.gz) = f583fb4140a29c5e21956c3e51fe3620baa65d33b40447af419d7fc61473a1148a1873216a84e89be785b155ee8e9aebd5e3eb19d2ded82b8415b1a35de1b55d +SHA512 (hplip-3.21.2.tar.gz) = 73ba37275cfe34a58b81c9656514e15da67c1a69af5471ad132a1538d324efe640879cb7e60c359915607e41b63e653e7ae757661e553235f6e83e378ab46474