diff --git a/hp-laserjet_cp_1025nw.ppd.gz b/hp-laserjet_cp_1025nw.ppd.gz new file mode 100644 index 0000000000000000000000000000000000000000..ab80803c1dfc0ddc254e4c7f0c5f94ea30c88d25 Binary files /dev/null and b/hp-laserjet_cp_1025nw.ppd.gz differ diff --git a/hp-laserjet_professional_p_1102w.ppd.gz b/hp-laserjet_professional_p_1102w.ppd.gz new file mode 100644 index 0000000000000000000000000000000000000000..b7167118f9bd2bda4bc731a1019516138072fa55 Binary files /dev/null and b/hp-laserjet_professional_p_1102w.ppd.gz differ diff --git a/hp-plugin.in b/hp-plugin.in new file mode 100644 index 0000000000000000000000000000000000000000..48ab3b93bb5d5efb04cd3bea036019dffb90d74a --- /dev/null +++ b/hp-plugin.in @@ -0,0 +1,62 @@ +#!/usr/bin/bash + +# get version from base hplip rpm - it is always in the second column +VER=$(@bindir@/rpm -q hplip | @bindir@/awk -F '-' '{print $2}') + +if test "x$VER" = "x" +then + @bindir@/echo "Version was not acquired - exiting..." + exit 1 +fi + +# plugin name +PLUGIN_FILE="hplip-${VER}-plugin.run" + +download() +{ + SOURCE="$1" + + @bindir@/curl --create-dirs -O --output-dir ~/.hplip ${SOURCE} +} + +# link to the plugin +PLUGIN_SOURCE="https://www.openprinting.org/download/printdriver/auxfiles/HP/plugins/${PLUGIN_FILE}" +FALLBACK_SOURCE="https://developers.hp.com/sites/default/files/${PLUGIN_FILE}" + +# create a hidden hplip dir to store a file indicating the plugin version after successful install +# the directory can be used by other hplip tools, so we don't have to remove it if the failure happens +if [ ! -d ~/.hplip ] +then + @bindir@/mkdir ~/.hplip || (@bindir@/echo "Cannot create the ~/.hplip dir, exiting" && exit 1) +fi + +for link in ${PLUGIN_SOURCE} ${FALLBACK_SOURCE} +do + download ${link} + + if test "x$(file --mime ~/.hplip/${PLUGIN_FILE} | grep 'text/x-shellscript')" = "xtext/x-shellscript" + then + break + fi +done + +if test "x$(file --mime ~/.hplip/${PLUGIN_FILE} | grep 'text/x-shellscript')" = "x" +then + @bindir@/echo "The downloaded file does not exist or is not a shell script - error during downloading, exiting..." + exit 1 +fi + +@bindir@/bash ~/.hplip/${PLUGIN_FILE} + +if [ $? -ne 0 ] +then + @bindir@/echo "Plugin installation failed, exiting..." + @bindir@/rm -f ~/.hplip/${PLUGIN_FILE} &> /dev/null + exit 1 +fi + +@bindir@/rm -f ~/.hplip/${PLUGIN_FILE} &> /dev/null +@bindir@/rm -f ~/.hplip/plugin-installed-* &> /dev/null +@bindir@/touch ~/.hplip/plugin-installed-$VER + +exit 0 diff --git a/hplip-3.23.12.tar.gz b/hplip-3.23.12.tar.gz deleted file mode 100644 index 98ea463bc8ac2bf98a7e3110f33865147130b743..0000000000000000000000000000000000000000 Binary files a/hplip-3.23.12.tar.gz and /dev/null differ diff --git a/hplip-3.23.8.tar.gz b/hplip-3.24.4.tar.gz similarity index 76% rename from hplip-3.23.8.tar.gz rename to hplip-3.24.4.tar.gz index 77b416a754d0b72e1ebce2e0b7f515b331812143..e001905407da0d09328ee4bd43adadb31aca81ac 100644 Binary files a/hplip-3.23.8.tar.gz and b/hplip-3.24.4.tar.gz differ diff --git a/hplip-add-ppd-crash.patch b/hplip-add-ppd-crash.patch new file mode 100644 index 0000000000000000000000000000000000000000..798630a90d290b8162e77c046fc071cfbaa5288c --- /dev/null +++ b/hplip-add-ppd-crash.patch @@ -0,0 +1,30 @@ +diff -up hplip-3.23.3/setup.py.add-ppd-crash hplip-3.23.3/setup.py +--- hplip-3.23.3/setup.py.add-ppd-crash 2023-03-28 09:26:11.000000000 +0200 ++++ hplip-3.23.3/setup.py 2023-05-29 13:55:03.443497903 +0200 +@@ -553,6 +553,9 @@ else: # INTERACTIVE_MODE + + if file_path.endswith('.gz'): + nickname = gzip.GzipFile(file_path, 'r').read(4096) ++ if sys.version_info[0] > 2: ++ nickname = nickname.decode('utf-8') ++ + else: + nickname = open(file_path, 'r').read(4096) + +diff -up hplip-3.23.3/ui5/setupdialog.py.add-ppd-crash hplip-3.23.3/ui5/setupdialog.py +--- hplip-3.23.3/ui5/setupdialog.py.add-ppd-crash 2023-05-29 13:55:03.443497903 +0200 ++++ hplip-3.23.3/ui5/setupdialog.py 2023-05-29 13:57:19.014700721 +0200 +@@ -765,10 +765,9 @@ class SetupDialog(QDialog, Ui_Dialog): + pass + + def OtherPPDButton_clicked(self, b): +- ppd_file = to_unicode(QFileDialog.getOpenFileName(self, self.__tr("Select PPD File"), +- sys_conf.get( +- 'dirs', 'ppd'), +- self.__tr("PPD Files (*.ppd *.ppd.gz);;All Files (*)"))) ++ ppd_file = QFileDialog.getOpenFileName(self, self.__tr("Select PPD File"), ++ sys_conf.get('dirs', 'ppd'), ++ self.__tr("PPD Files (*.ppd *.ppd.gz);;All Files (*)"))[0] + + if ppd_file and os.path.exists(ppd_file): + self.print_ppd = (ppd_file, cups.getPPDDescription(ppd_file)) diff --git a/hplip-appdata.patch b/hplip-appdata.patch new file mode 100644 index 0000000000000000000000000000000000000000..6ad46a331ce29f6bc40991c12dae8da490829c94 --- /dev/null +++ b/hplip-appdata.patch @@ -0,0 +1,19 @@ +diff -up hplip-3.17.9/hplip.desktop.in.appdata hplip-3.17.9/hplip.desktop.in +--- hplip-3.17.9/hplip.desktop.in.appdata 2017-10-04 16:04:26.594881663 +0200 ++++ hplip-3.17.9/hplip.desktop.in 2017-10-04 16:05:59.638113656 +0200 +@@ -1,11 +1,11 @@ + [Desktop Entry] + Encoding=UTF-8 + Type=Application +-Name=HP Device Manager +-GenericName=Printer Management Application +-Comment=View device status, ink levels and perform maintenance. ++Name=HPLIP Graphical Tools ++GenericName=Printer Graphical Tools ++Comment=View device status, ink levels and perform maintenance etc. + Exec=hp-toolbox +-Icon=@abs_datadir@/hplip/data/images/128x128/hp_logo.png ++Icon=hp_logo + Terminal=false + Categories=Application;Utility; + X-KDE-StartupNotify=false diff --git a/hplip-clean-ldl.patch b/hplip-clean-ldl.patch new file mode 100644 index 0000000000000000000000000000000000000000..89553eca081f20bdde07c6e22ff8f6c1ce4204da --- /dev/null +++ b/hplip-clean-ldl.patch @@ -0,0 +1,44 @@ +diff --git a/base/device.py b/base/device.py +index 6d7add9..bf27307 100644 +--- a/base/device.py ++++ b/base/device.py +@@ -2264,7 +2264,8 @@ class Device(object): + self.callback() + + if total_bytes_to_write != bytes_out: +- raise Error(ERROR_DEVICE_IO_ERROR) ++ raise Error(ERROR_DEVICE_IO_ERROR, 'Number of written ' ++ 'bytes by hpmudext mismatch with expected amount.') + + return bytes_out + +diff --git a/base/g.py b/base/g.py +index 9856662..0aa0e2e 100644 +--- a/base/g.py ++++ b/base/g.py +@@ -398,9 +398,11 @@ ERROR_STRINGS = { + + + class Error(Exception): +- def __init__(self, opt=ERROR_INTERNAL): ++ def __init__(self, opt=ERROR_INTERNAL, msg=None): + self.opt = opt + self.msg = ERROR_STRINGS.get(opt, ERROR_STRINGS[ERROR_INTERNAL]) ++ if msg: ++ self.msg = '{} - {}'.format(self.msg, msg) + log.debug("Exception: %d (%s)" % (opt, self.msg)) + Exception.__init__(self, self.msg, opt) + +diff --git a/prnt/ldl.py b/prnt/ldl.py +index e3f77f7..8b28e7f 100644 +--- a/prnt/ldl.py ++++ b/prnt/ldl.py +@@ -145,7 +145,7 @@ def buildLIDILPacket(packet_type, command=0, operation=0, other={}): + p = '$\x00\x10\x00\x08\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff$' + + elif packet_type == PACKET_TYPE_RESET_LIDIL: +- p = '$\x00\x10\x00\x06\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff$' ++ p = b'$\x00\x10\x00\x06\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff$' + + elif packet_type == PACKET_TYPE_COMMAND: + diff --git a/hplip-colorlaserjet-mfp-m278-m281.patch b/hplip-colorlaserjet-mfp-m278-m281.patch deleted file mode 100644 index 2ce7870326cb0f687c18fb38622ee29cf80d3860..0000000000000000000000000000000000000000 --- a/hplip-colorlaserjet-mfp-m278-m281.patch +++ /dev/null @@ -1,63 +0,0 @@ -diff -up hplip-3.17.11/data/models/models.dat.colorlaserjet-mfp-m278-m281 hplip-3.17.11/data/models/models.dat ---- hplip-3.17.11/data/models/models.dat.colorlaserjet-mfp-m278-m281 2017-11-23 13:10:17.000000000 +0100 -+++ hplip-3.17.11/data/models/models.dat 2018-01-19 08:24:21.554788787 +0100 -@@ -58516,6 +58516,59 @@ usb-pid=3c2a - usb-vid=3f0 - wifi-config=3 - -+[hp_colorlaserjet_mfp_m278-m281] -+align-type=0 -+clean-type=0 -+color-cal-type=0 -+copy-type=0 -+embedded-server-type=1 -+fax-type=7 -+fw-download=False -+icon=hp_color_laserjet_cm1312_mfp.png -+io-mfp-mode=1 -+io-mode=1 -+io-support=14 -+job-storage=0 -+linefeed-cal-type=0 -+model1=HP Color LaserJet MFP M278-281 -+monitor-type=0 -+panel-check-type=0 -+pcard-type=0 -+plugin=1 -+plugin-reason=64 -+power-settings=0 -+ppd-name=hp-color_laserjet_pro_mfp_m277 -+pq-diag-type=0 -+r-type=0 -+r0-agent1-kind=4 -+r0-agent1-sku=CF400A/CF400X -+r0-agent1-type=1 -+r0-agent2-kind=4 -+r0-agent2-sku=CF401A -+r0-agent2-type=4 -+r0-agent3-kind=4 -+r0-agent3-sku=CF403A -+r0-agent3-type=5 -+r0-agent4-kind=4 -+r0-agent4-sku=CF402A -+r0-agent4-type=6 -+scan-src=3 -+scan-type=5 -+status-battery-check=0 -+status-dynamic-counters=0 -+status-type=10 -+support-released=True -+support-subtype=48c3 -+support-type=2 -+support-ver=3.15.4 -+tech-class=Postscript -+family-class=Undefined -+tech-subclass=Normal -+tech-type=4 -+usb-pid=3c2a -+usb-vid=3f0 -+wifi-config=3 -+ - [hp_color_laserjet_m553] - align-type=0 - clean-type=0 diff --git a/hplip-configure-python.patch b/hplip-configure-python.patch new file mode 100644 index 0000000000000000000000000000000000000000..2ae762037f5a60b138ecc259a76595c7e8687f37 --- /dev/null +++ b/hplip-configure-python.patch @@ -0,0 +1,52 @@ +diff -up hplip-3.20.9/configure.in.configure-python hplip-3.20.9/configure.in +--- hplip-3.20.9/configure.in.configure-python 2020-09-23 07:24:27.000000000 +0200 ++++ hplip-3.20.9/configure.in 2020-10-02 07:27:09.082331431 +0200 +@@ -604,17 +604,29 @@ if test "$class_driver" = "no" && test " + fi + fi + +-SAVE_CPPFLAGS="$CPPFLAGS" +-CFLAGS=`python-config --includes` +-if [ $? -eq 0 ] +-then +- echo $FLAGS +-else +-CFLAGS=`python3-config --includes` +- if [ $? -eq 0 ] +- then +- echo $FLAGS +- fi ++AC_PATH_PROG(python3_config_path, python3-config, [AC_MSG_ERROR([python3-config not installed], 6)]) ++ ++PYTHON_INCLUDES=`$python3_config_path --includes` ++if test "X$PYTHON_INCLUDES" = "X" ; then ++ AC_MSG_ERROR([Cannot get Python includes via python3-config], 6) ++fi ++ ++PYTHON_LIBS=`$python3_config_path --libs` ++if test "X$PYTHON_LIBS" = "X" ; then ++ AC_MSG_ERROR([Cannot get Python libs via python3-config], 6) ++fi ++ ++SAVE_CFLAGS="$CFLAGS" ++SAVE_LIBS="$LIBS" ++ ++CFLAGS="$CFLAGS $PYTHON_INCLUDES" ++LIBS="$LIBS $PYTHON_LIBS" ++ ++AC_TRY_LINK(,[ ], AC_MSG_RESULT(yes); python_includes="ok", AC_MSG_ERROR([no: PYTHON DISABLED], 6)) ++ ++if test "X$python_includes" != "Xok" ; then ++ CFLAGS="$SAVE_CFLAGS" ++ LIBS="$SAVE_LIBS" + fi + + #CFLAGS=`(python-config --includes)` +@@ -631,7 +643,6 @@ if test "$class_driver" = "no" && test " + AS_IF([test "x$FOUND_HEADER" != "xyes"], + [AC_MSG_ERROR([cannot find python-devel support], 6)]) + fi +-CFLAGS="$save_CFLAGS" + + if test "$hpijs_only_build" = "no" && test "$scan_build" = "yes" && test "$hpcups_only_build" = "no"; then + AC_CHECK_LIB([sane], [sane_open], [LIBS="$LIBS"], [AC_MSG_ERROR([cannot find sane-backends-devel support (or --disable-scan-build)], 12)]) diff --git a/hplip-covscan.patch b/hplip-covscan.patch new file mode 100644 index 0000000000000000000000000000000000000000..6c885816593263e9de1f35a68c966aa331c59124 --- /dev/null +++ b/hplip-covscan.patch @@ -0,0 +1,615 @@ +diff -up hplip-3.23.3/common/utils.c.covscan hplip-3.23.3/common/utils.c +--- hplip-3.23.3/common/utils.c.covscan 2023-03-28 09:26:11.000000000 +0200 ++++ hplip-3.23.3/common/utils.c 2023-05-29 13:58:10.969395214 +0200 +@@ -1,5 +1,9 @@ ++#ifndef _GNU_SOURCE ++#define _GNU_SOURCE ++#endif ++ + #include "utils.h" +-#include "string.h" ++#include + #include + #include + #include +diff -up hplip-3.23.3/io/hpmud/hpmud.c.covscan hplip-3.23.3/io/hpmud/hpmud.c +--- hplip-3.23.3/io/hpmud/hpmud.c.covscan 2023-03-28 09:26:11.000000000 +0200 ++++ hplip-3.23.3/io/hpmud/hpmud.c 2023-05-29 13:58:10.970395208 +0200 +@@ -759,6 +759,7 @@ enum HPMUD_RESULT hpmud_get_dstat(HPMUD_ + } + + strncpy(ds->uri, msp->device[dd].uri, sizeof(ds->uri)); ++ ds->uri[sizeof(ds->uri)-1] = '\0'; + ds->io_mode = msp->device[dd].io_mode; + ds->channel_cnt = msp->device[dd].channel_cnt; + ds->mlc_up = msp->device[dd].mlc_up; +diff -up hplip-3.23.3/io/hpmud/jd.c.covscan hplip-3.23.3/io/hpmud/jd.c +--- hplip-3.23.3/io/hpmud/jd.c.covscan 2023-03-28 09:26:11.000000000 +0200 ++++ hplip-3.23.3/io/hpmud/jd.c 2023-05-29 13:58:10.970395208 +0200 +@@ -31,6 +31,7 @@ + #endif + + #include ++#include + #include "hpmud.h" + #include "hpmudi.h" + +diff -up hplip-3.23.3/io/hpmud/model.c.covscan hplip-3.23.3/io/hpmud/model.c +--- hplip-3.23.3/io/hpmud/model.c.covscan 2023-05-29 13:58:10.958395279 +0200 ++++ hplip-3.23.3/io/hpmud/model.c 2023-05-29 13:58:10.970395208 +0200 +@@ -117,6 +117,7 @@ static int ReadConfig() + if (rcbuf[0] == '[') + { + strncpy(section, rcbuf, sizeof(section)); /* found new section */ ++ section[sizeof(section)-1] = '\0'; + continue; + } + +@@ -125,6 +126,7 @@ static int ReadConfig() + if ((strncasecmp(section, "[dirs]", 6) == 0) && (strcasecmp(key, "home") == 0)) + { + strncpy(homedir, value, sizeof(homedir)); ++ homedir[sizeof(homedir)-1] = '\0'; + break; /* done */ + } + } +diff -up hplip-3.23.3/io/hpmud/musb.c.covscan hplip-3.23.3/io/hpmud/musb.c +--- hplip-3.23.3/io/hpmud/musb.c.covscan 2023-03-28 09:26:11.000000000 +0200 ++++ hplip-3.23.3/io/hpmud/musb.c 2023-05-29 13:58:10.970395208 +0200 +@@ -776,7 +776,7 @@ static int device_id(int fd, unsigned ch + len = size-1; /* leave byte for zero termination */ + if (len > 2) + len -= 2; +- memcpy(buffer, buffer+2, len); /* remove length */ ++ memmove(buffer, buffer+2, len); /* remove length */ + buffer[len]=0; + DBG("read actual device_id successfully fd=%d len=%d\n", fd, len); + +diff -up hplip-3.23.3/io/hpmud/pp.c.covscan hplip-3.23.3/io/hpmud/pp.c +--- hplip-3.23.3/io/hpmud/pp.c.covscan 2023-03-28 09:26:11.000000000 +0200 ++++ hplip-3.23.3/io/hpmud/pp.c 2023-05-29 13:58:10.970395208 +0200 +@@ -632,7 +632,7 @@ static int device_id(int fd, char *buffe + len = size-1; /* leave byte for zero termination */ + if (len > 2) + len -= 2; +- memcpy(buffer, buffer+2, len); /* remove length */ ++ memmove(buffer, buffer+2, len); /* remove length */ + buffer[len]=0; + + DBG("read actual device_id successfully fd=%d len=%d\n", fd, len); +diff -up hplip-3.23.3/Makefile.am.covscan hplip-3.23.3/Makefile.am +--- hplip-3.23.3/Makefile.am.covscan 2023-05-29 13:58:10.944395361 +0200 ++++ hplip-3.23.3/Makefile.am 2023-05-29 13:58:10.969395214 +0200 +@@ -3,7 +3,7 @@ + # + # (c) 2004-2015 Copyright HP Development Company, LP + # Author: David Suffield, Naga Samrat Chowdary Narla, Sarbeswar Meher +-INCLUDES = -Iip -Iio/hpmud -Iscan/sane -Iprnt/hpijs -Icommon/ ++INCLUDES = -Iip -Iio/hpmud -Iscan/sane -Iprnt/hpijs -Icommon/ -Iprotocol + CFLAGS+= -DCONFDIR=\"$(hplip_confdir)\" + CXXFLAGS+= -DCONFDIR=\"$(hplip_confdir)\" + +@@ -310,7 +310,7 @@ dist_pcard_DATA = pcard/__init__.py pcar + pcardextdir = $(pyexecdir) + pcardext_LTLIBRARIES = pcardext.la + pcardext_la_LDFLAGS = -module -avoid-version +-pcardext_la_SOURCES = pcard/pcardext/pcardext.c pcard/fat.c ++pcardext_la_SOURCES = pcard/pcardext/pcardext.c pcard/fat.c pcard/pcardext/pcardext.h + pcardext_la_CFLAGS = -I$(PYTHONINCLUDEDIR) + + # prnt +@@ -322,7 +322,7 @@ lib_LTLIBRARIES += libhpipp.la + #hpipp_LTLIBRARIES = hpipp.la + #hpipp_la_LDFLAGS = -module -avoid-version + libhpipp_la_SOURCES = protocol/hp_ipp.c protocol/hp_ipp.h protocol/hp_ipp_i.h +-libhpipp_la_CFLAGS = -DCONFDIR=\"$(hplip_confdir)\" ++libhpipp_la_CFLAGS = -DCONFDIR=\"$(hplip_confdir)\" -D_GNU_SOURCE + libhpipp_la_LDFLAGS = -version-info 0:1:0 + libhpipp_la_LIBADD = libhpmud.la + +diff -up hplip-3.23.3/pcard/fat.c.covscan hplip-3.23.3/pcard/fat.c +--- hplip-3.23.3/pcard/fat.c.covscan 2023-03-28 09:26:11.000000000 +0200 ++++ hplip-3.23.3/pcard/fat.c 2023-05-29 13:58:10.971395203 +0200 +@@ -519,14 +519,17 @@ int FatFreeSpace(void) + + int FatDiskAttributes( PHOTO_CARD_ATTRIBUTES * pa ) + { +- strncpy( pa->OEMID, bpb.OEMID, 8 ); ++ strncpy(pa->OEMID, bpb.OEMID, sizeof(pa->OEMID)); ++ pa->OEMID[sizeof(pa->OEMID)-1] = '\0'; + pa->BytesPerSector = bpb.BytesPerSector; + pa->SectorsPerCluster = bpb.SectorsPerCluster; + pa->ReservedSectors = bpb.ReservedSectors; + pa->SectorsPerFat = bpb.SectorsPerFat; + pa->RootEntries = bpb.RootEntries; +- strncpy( pa->SystemID, (char *)bpb.SystemID, 8 ); +- strncpy( pa->VolumeLabel, (char *)bpb.VolumeLabel, 11 ); ++ strncpy(pa->SystemID, (char *)bpb.SystemID, sizeof(pa->SystemID)); ++ pa->SystemID[sizeof(pa->SystemID)-1] = '\0'; ++ strncpy(pa->VolumeLabel, (char *)bpb.VolumeLabel, sizeof(pa->VolumeLabel)); ++ pa->VolumeLabel[sizeof(pa->VolumeLabel)-1] = '\0'; + pa->WriteProtect = da.WriteProtect; + + return 0; +@@ -741,6 +744,7 @@ int FatSetCWD(char *dir) + return 1; + + strncpy(cwd.Name, fa.Name, sizeof(cwd.Name)); ++ cwd.Name[sizeof(cwd.Name)-1] = '\0'; + cwd.StartSector = ConvertClusterToSector(fa.StartCluster); + cwd.CurrSector = cwd.StartSector; + cwd.StartCluster = fa.StartCluster; +diff -up hplip-3.23.3/prnt/hpijs/context2.cpp.covscan hplip-3.23.3/prnt/hpijs/context2.cpp +--- hplip-3.23.3/prnt/hpijs/context2.cpp.covscan 2023-03-28 09:26:11.000000000 +0200 ++++ hplip-3.23.3/prnt/hpijs/context2.cpp 2023-05-29 13:58:10.971395203 +0200 +@@ -1302,6 +1302,7 @@ DRIVER_ERROR PrintContext::SelectDevice + if(0 == strnlen((const char *)pSS->strDevID, DevIDBuffSize)) + { + strncpy((char *)pSS->strDevID,szDeviceId,DevIDBuffSize); ++ pSS->strDevID[sizeof(pSS->strDevID)-1] = '\0'; + } + thePrinter = pPFI->CreatePrinter (pSS, familyHandle); + if (thePrinter->constructor_error != NO_ERROR) +diff -up hplip-3.23.3/prnt/hpijs/systemservices.cpp.covscan hplip-3.23.3/prnt/hpijs/systemservices.cpp +--- hplip-3.23.3/prnt/hpijs/systemservices.cpp.covscan 2023-03-28 09:26:27.000000000 +0200 ++++ hplip-3.23.3/prnt/hpijs/systemservices.cpp 2023-05-29 13:58:10.971395203 +0200 +@@ -396,7 +396,10 @@ void SystemServices::AdjustIO(IO_MODE IM + IOMode.bDevID =IM.bDevID && IOMode.bDevID; + + if (model) ++ { + strncpy(strModel,model, sizeof(strModel)); ++ strModel[sizeof(strModel)-1] = '\0'; ++ } + } + + APDK_END_NAMESPACE +diff -up hplip-3.23.3/prnt/hpps/hppsfilter.c.covscan hplip-3.23.3/prnt/hpps/hppsfilter.c +--- hplip-3.23.3/prnt/hpps/hppsfilter.c.covscan 2023-03-28 09:26:11.000000000 +0200 ++++ hplip-3.23.3/prnt/hpps/hppsfilter.c 2023-05-29 13:58:10.972395197 +0200 +@@ -274,13 +274,13 @@ static void WriteHeader(char **argument) + /* Writing Header Information + argument[1] = JOB ID , argument[2]= USERNAME, argument[3] = TITLE */ + hpwrite("\x1b%-12345X@PJL JOBNAME=", strlen("\x1b%-12345X@PJL JOBNAME=")); +- sprintf(buffer, "hplip_%s_%s\x0a", argument[2], argument[1]); ++ snprintf(buffer, MAX_BUFFER-1, "hplip_%s_%s\x0a", argument[2], argument[1]); + hpwrite(buffer, strlen(buffer)); + memset(buffer, 0, sizeof(buffer)); +- sprintf(buffer, "@PJL SET USERNAME=\"%s\"\x0a", argument[2]); ++ snprintf(buffer, MAX_BUFFER-1, "@PJL SET USERNAME=\"%s\"\x0a", argument[2]); + hpwrite(buffer, strlen(buffer)); + memset(buffer, 0, sizeof(buffer)); +- sprintf(buffer, "@PJL SET JOBNAME=\"%s\"\x0a", argument[3]); ++ snprintf(buffer, MAX_BUFFER-1, "@PJL SET JOBNAME=\"%s\"\x0a", argument[3]); + hpwrite(buffer, strlen(buffer)); + fprintf(stderr, "HP PS filter func = WriteHeader : WRITING PJL HEADER INFO\n"); + return; +diff -up hplip-3.23.3/protocol/hp_ipp.h.covscan hplip-3.23.3/protocol/hp_ipp.h +--- hplip-3.23.3/protocol/hp_ipp.h.covscan 2023-05-29 13:58:10.972395197 +0200 ++++ hplip-3.23.3/protocol/hp_ipp.h 2023-05-29 13:59:03.645085468 +0200 +@@ -168,6 +168,11 @@ HPIPP_RESULT parseResponseHeader(char* h + HPIPP_RESULT prepend_http_header(raw_ipp *raw_request,const char *resource); + enum HPMUD_RESULT sendUSBRequest(char *buf, int size, raw_ipp *responseptr, char * device_uri); + enum HPMUD_RESULT sendUSBFileRequest(char *buf, int size, int fileHandle,raw_ipp *responseptr, char *device_uri); ++void _releaseCupsInstance(); ++int addCupsPrinter(char *name, char *device_uri, char *location, char *ppd_file, char *model, char *info); ++int delCupsPrinter(char *pr_name); ++int setDefaultCupsPrinter(char *pr_name); ++int controlCupsPrinter(char *pr_name, int op); + + ipp_t * createFaxDetailRequest(const char *printer_name); + ipp_t * getDeviceFaxModemAttributes(char* device_uri,char* printer_name, int *count); +diff -up hplip-3.23.3/scan/sane/bb_ledm.c.covscan hplip-3.23.3/scan/sane/bb_ledm.c +--- hplip-3.23.3/scan/sane/bb_ledm.c.covscan 2023-03-28 09:26:11.000000000 +0200 ++++ hplip-3.23.3/scan/sane/bb_ledm.c 2023-05-29 13:58:10.972395197 +0200 +@@ -26,6 +26,7 @@ + # include "http.h" + # include "xml.h" + # include ++# include + + # include + +diff -up hplip-3.23.3/scan/sane/common.h.covscan hplip-3.23.3/scan/sane/common.h +--- hplip-3.23.3/scan/sane/common.h.covscan 2023-05-29 13:58:10.727396637 +0200 ++++ hplip-3.23.3/scan/sane/common.h 2023-05-29 13:58:10.972395197 +0200 +@@ -36,7 +36,7 @@ + #define _STRINGIZE(x) #x + #define STRINGIZE(x) _STRINGIZE(x) + +-#define BUG(args...) {syslog(LOG_ERR, __FILE__ " " STRINGIZE(__LINE__) ": " args); DBG(2, __FILE__ " " STRINGIZE(__LINE__) ": " args);} ++#define BUG_SCAN(args...) {syslog(LOG_ERR, __FILE__ " " STRINGIZE(__LINE__) ": " args); DBG(2, __FILE__ " " STRINGIZE(__LINE__) ": " args);} + #define BUG_DUMP(data, size) bugdump((data), (size)) + #define BUG_SZ(args...) {syslog(LOG_ERR, args); DBG(2, args);} + +diff -up hplip-3.23.3/scan/sane/escl.c.covscan hplip-3.23.3/scan/sane/escl.c +--- hplip-3.23.3/scan/sane/escl.c.covscan 2023-03-28 09:26:11.000000000 +0200 ++++ hplip-3.23.3/scan/sane/escl.c 2023-05-29 13:58:10.972395197 +0200 +@@ -849,7 +849,7 @@ SANE_Status escl_control_option(SANE_Han + //DBG8("escl_control_option (option=%s) action=%d\n", ps->option[option].name, action); + if (stat != SANE_STATUS_GOOD) + { +- BUG("control_option failed: option=%s action=%s\n", ps->option[option].name, action==SANE_ACTION_GET_VALUE ? "get" : action==SANE_ACTION_SET_VALUE ? "set" : "auto"); ++ BUG_SCAN("control_option failed: option=%s action=%s\n", ps->option[option].name, action==SANE_ACTION_GET_VALUE ? "get" : action==SANE_ACTION_SET_VALUE ? "set" : "auto"); + } + + return stat; +@@ -1159,7 +1159,7 @@ void escl_close(SANE_Handle handle) + + if (ps == NULL || ps != session) + { +- BUG("invalid sane_close\n"); ++ BUG_SCAN("invalid sane_close\n"); + return; + } + +diff -up hplip-3.23.3/scan/sane/http.c.covscan hplip-3.23.3/scan/sane/http.c +--- hplip-3.23.3/scan/sane/http.c.covscan 2023-03-28 09:26:11.000000000 +0200 ++++ hplip-3.23.3/scan/sane/http.c 2023-05-29 13:58:10.973395191 +0200 +@@ -36,6 +36,7 @@ + #include + #include + #include ++#include + #include "hpmud.h" + #include "http.h" + +diff -up hplip-3.23.3/scan/sane/io.c.covscan hplip-3.23.3/scan/sane/io.c +--- hplip-3.23.3/scan/sane/io.c.covscan 2023-03-28 09:26:11.000000000 +0200 ++++ hplip-3.23.3/scan/sane/io.c 2023-05-29 13:58:10.973395191 +0200 +@@ -50,7 +50,7 @@ int __attribute__ ((visibility ("hidden" + + if (dbus_error_is_set(&dbus_err)) + { +- BUG("dBus Connection Error (%s)!\n", dbus_err.message); ++ BUG_SCAN("dBus Connection Error (%s)!\n", dbus_err.message); + dbus_error_free(&dbus_err); + } + +@@ -79,7 +79,7 @@ int __attribute__ ((visibility ("hidden" + + if (NULL == msg) + { +- BUG("dbus message is NULL!\n"); ++ BUG_SCAN("dbus message is NULL!\n"); + return 0; + } + +@@ -94,7 +94,7 @@ int __attribute__ ((visibility ("hidden" + + if (!dbus_connection_send(dbus_conn, msg, NULL)) + { +- BUG("dbus message send failed!\n"); ++ BUG_SCAN("dbus message send failed!\n"); + return 0; + } + +diff -up hplip-3.23.3/scan/sane/ledm.c.covscan hplip-3.23.3/scan/sane/ledm.c +--- hplip-3.23.3/scan/sane/ledm.c.covscan 2023-03-28 09:26:11.000000000 +0200 ++++ hplip-3.23.3/scan/sane/ledm.c 2023-05-29 13:58:10.973395191 +0200 +@@ -813,7 +813,7 @@ SANE_Status ledm_control_option(SANE_Han + + if (stat != SANE_STATUS_GOOD) + { +- BUG("control_option failed: option=%s action=%s\n", ps->option[option].name, action==SANE_ACTION_GET_VALUE ? "get" : action==SANE_ACTION_SET_VALUE ? "set" : "auto"); ++ BUG_SCAN("control_option failed: option=%s action=%s\n", ps->option[option].name, action==SANE_ACTION_GET_VALUE ? "get" : action==SANE_ACTION_SET_VALUE ? "set" : "auto"); + } + + return stat; +@@ -1078,7 +1078,7 @@ void ledm_close(SANE_Handle handle) + + if (ps == NULL || ps != session) + { +- BUG("invalid sane_close\n"); ++ BUG_SCAN("invalid sane_close\n"); + return; + } + +diff -up hplip-3.23.3/scan/sane/marvell.c.covscan hplip-3.23.3/scan/sane/marvell.c +--- hplip-3.23.3/scan/sane/marvell.c.covscan 2023-03-28 09:26:11.000000000 +0200 ++++ hplip-3.23.3/scan/sane/marvell.c 2023-05-29 13:58:10.976395173 +0200 +@@ -134,7 +134,7 @@ static int get_ip_data(struct marvell_se + + if (!ps->ip_handle) + { +- BUG("invalid ipconvert state\n"); ++ BUG_SCAN("invalid ipconvert state\n"); + goto bugout; + } + +@@ -335,7 +335,7 @@ static struct marvell_session *create_se + + if ((ps = malloc(sizeof(struct marvell_session))) == NULL) + { +- BUG("malloc failed: %m\n"); ++ BUG_SCAN("malloc failed: %m\n"); + return NULL; + } + memset(ps, 0, sizeof(struct marvell_session)); +@@ -402,7 +402,7 @@ SANE_Status marvell_open(SANE_String_Con + + if (session) + { +- BUG("session in use\n"); ++ BUG_SCAN("session in use\n"); + return SANE_STATUS_DEVICE_BUSY; + } + +@@ -431,7 +431,7 @@ SANE_Status marvell_open(SANE_String_Con + + if (hpmud_open_device(session->uri, ma.mfp_mode, &session->dd) != HPMUD_R_OK) + { +- BUG("unable to open device %s\n", session->uri); ++ BUG_SCAN("unable to open device %s\n", session->uri); + goto bugout; + + free(session); +@@ -441,7 +441,7 @@ SANE_Status marvell_open(SANE_String_Con + + if (hpmud_open_channel(session->dd, HPMUD_S_MARVELL_SCAN_CHANNEL, &session->cd) != HPMUD_R_OK) + { +- BUG("unable to open %s channel %s\n", HPMUD_S_MARVELL_SCAN_CHANNEL, session->uri); ++ BUG_SCAN("unable to open %s channel %s\n", HPMUD_S_MARVELL_SCAN_CHANNEL, session->uri); + stat = SANE_STATUS_DEVICE_BUSY; + goto bugout; + } +@@ -554,7 +554,7 @@ void marvell_close(SANE_Handle handle) + + if (ps == NULL || ps != session) + { +- BUG("invalid sane_close\n"); ++ BUG_SCAN("invalid sane_close\n"); + return; + } + +@@ -849,7 +849,7 @@ SANE_Status marvell_control_option(SANE_ + stat = SANE_STATUS_GOOD; + break; + } +- BUG("value=%d brymin=%d brymax=%d\n", *int_value, ps->bryRange.min, ps->bryRange.max); ++ BUG_SCAN("value=%d brymin=%d brymax=%d\n", *int_value, ps->bryRange.min, ps->bryRange.max); + } + else + { /* Set default. */ +@@ -866,7 +866,7 @@ SANE_Status marvell_control_option(SANE_ + + if (stat != SANE_STATUS_GOOD) + { +- BUG("control_option failed: option=%s action=%s\n", ps->option[option].name, ++ BUG_SCAN("control_option failed: option=%s action=%s\n", ps->option[option].name, + action==SANE_ACTION_GET_VALUE ? "get" : action==SANE_ACTION_SET_VALUE ? "set" : "auto"); + } + +@@ -905,7 +905,7 @@ SANE_Status marvell_start(SANE_Handle ha + + if (set_extents(ps)) + { +- BUG("invalid extents: tlx=%d brx=%d tly=%d bry=%d minwidth=%d minheight%d maxwidth=%d maxheight=%d\n", ++ BUG_SCAN("invalid extents: tlx=%d brx=%d tly=%d bry=%d minwidth=%d minheight%d maxwidth=%d maxheight=%d\n", + ps->currentTlx, ps->currentTly, ps->currentBrx, ps->currentBry, ps->min_width, ps->min_height, ps->tlxRange.max, ps->tlyRange.max); + stat = SANE_STATUS_INVAL; + goto bugout; +@@ -963,7 +963,7 @@ SANE_Status marvell_start(SANE_Handle ha + /* Open image processor. */ + if ((ret = ipOpen(pXform-xforms, xforms, 0, &ps->ip_handle)) != IP_DONE) + { +- BUG("unable open image processor: err=%d\n", ret); ++ BUG_SCAN("unable open image processor: err=%d\n", ret); + stat = SANE_STATUS_INVAL; + goto bugout; + } +@@ -1023,7 +1023,7 @@ SANE_Status marvell_read(SANE_Handle han + + if(ret & (IP_INPUT_ERROR | IP_FATAL_ERROR)) + { +- BUG("ipConvert error=%x\n", ret); ++ BUG_SCAN("ipConvert error=%x\n", ret); + goto bugout; + } + +diff -up hplip-3.23.3/scan/sane/sclpml.c.covscan hplip-3.23.3/scan/sane/sclpml.c +--- hplip-3.23.3/scan/sane/sclpml.c.covscan 2023-03-28 09:26:11.000000000 +0200 ++++ hplip-3.23.3/scan/sane/sclpml.c 2023-05-29 13:58:10.976395173 +0200 +@@ -30,6 +30,7 @@ + #include + #include + #include ++#include + #include "sane.h" + #include "saneopts.h" + #include "common.h" +@@ -2090,7 +2091,7 @@ void sclpml_close(SANE_Handle handle) + DBG(8, "sane_hpaio_close(): %s %d\n", __FILE__, __LINE__); + if (hpaio == NULL || hpaio != session) + { +- BUG("invalid sane_close\n"); ++ BUG_SCAN("invalid sane_close\n"); + return; + } + +diff -up hplip-3.23.3/scan/sane/soap.c.covscan hplip-3.23.3/scan/sane/soap.c +--- hplip-3.23.3/scan/sane/soap.c.covscan 2023-03-28 09:26:11.000000000 +0200 ++++ hplip-3.23.3/scan/sane/soap.c 2023-05-29 13:58:10.977395167 +0200 +@@ -142,7 +142,7 @@ static int get_ip_data(struct soap_sessi + + if (!ps->ip_handle) + { +- BUG("invalid ipconvert state\n"); ++ BUG_SCAN("invalid ipconvert state\n"); + goto bugout; + } + +@@ -219,7 +219,7 @@ static struct soap_session *create_sessi + + if ((ps = malloc(sizeof(struct soap_session))) == NULL) + { +- BUG("malloc failed: %m\n"); ++ BUG_SCAN("malloc failed: %m\n"); + return NULL; + } + memset(ps, 0, sizeof(struct soap_session)); +@@ -418,7 +418,7 @@ SANE_Status soap_open(SANE_String_Const + + if (session) + { +- BUG("session in use\n"); ++ BUG_SCAN("session in use\n"); + return SANE_STATUS_DEVICE_BUSY; + } + +@@ -434,7 +434,7 @@ SANE_Status soap_open(SANE_String_Const + + if (hpmud_open_device(session->uri, ma.mfp_mode, &session->dd) != HPMUD_R_OK) + { +- BUG("unable to open device %s\n", session->uri); ++ BUG_SCAN("unable to open device %s\n", session->uri); + goto bugout; + + free(session); +@@ -519,7 +519,7 @@ void soap_close(SANE_Handle handle) + + if (ps == NULL || ps != session) + { +- BUG("invalid sane_close\n"); ++ BUG_SCAN("invalid sane_close\n"); + return; + } + +@@ -824,7 +824,7 @@ SANE_Status soap_control_option(SANE_Han + + if (stat != SANE_STATUS_GOOD) + { +- BUG("control_option failed: option=%s action=%s\n", ps->option[option].name, ++ BUG_SCAN("control_option failed: option=%s action=%s\n", ps->option[option].name, + action==SANE_ACTION_GET_VALUE ? "get" : action==SANE_ACTION_SET_VALUE ? "set" : "auto"); + } + +@@ -862,7 +862,7 @@ SANE_Status soap_start(SANE_Handle handl + ps->user_cancel = 0; + if (set_extents(ps)) + { +- BUG("invalid extents: tlx=%d brx=%d tly=%d bry=%d minwidth=%d minheight%d maxwidth=%d maxheight=%d\n", ++ BUG_SCAN("invalid extents: tlx=%d brx=%d tly=%d bry=%d minwidth=%d minheight%d maxwidth=%d maxheight=%d\n", + ps->currentTlx, ps->currentTly, ps->currentBrx, ps->currentBry, ps->min_width, ps->min_height, ps->tlxRange.max, ps->tlyRange.max); + stat = SANE_STATUS_INVAL; + goto bugout; +@@ -913,7 +913,7 @@ SANE_Status soap_start(SANE_Handle handl + /* Open image processor. */ + if ((ret = ipOpen(pXform-xforms, xforms, 0, &ps->ip_handle)) != IP_DONE) + { +- BUG("unable open image processor: err=%d\n", ret); ++ BUG_SCAN("unable open image processor: err=%d\n", ret); + stat = SANE_STATUS_INVAL; + goto bugout; + } +@@ -955,7 +955,7 @@ SANE_Status soap_start(SANE_Handle handl + + if (ret & (IP_INPUT_ERROR | IP_FATAL_ERROR | IP_DONE)) + { +- BUG("ipConvert error=%x\n", ret); ++ BUG_SCAN("ipConvert error=%x\n", ret); + stat = SANE_STATUS_IO_ERROR; + goto bugout; + } +@@ -1007,7 +1007,7 @@ SANE_Status soap_read(SANE_Handle handle + + if(ret & (IP_INPUT_ERROR | IP_FATAL_ERROR)) + { +- BUG("ipConvert error=%x\n", ret); ++ BUG_SCAN("ipConvert error=%x\n", ret); + goto bugout; + } + +diff -up hplip-3.23.3/scan/sane/soapht.c.covscan hplip-3.23.3/scan/sane/soapht.c +--- hplip-3.23.3/scan/sane/soapht.c.covscan 2023-03-28 09:26:11.000000000 +0200 ++++ hplip-3.23.3/scan/sane/soapht.c 2023-05-29 13:58:10.977395167 +0200 +@@ -136,7 +136,7 @@ static int get_ip_data(struct soap_sessi + + if (!ps->ip_handle) + { +- BUG("invalid ipconvert state\n"); ++ BUG_SCAN("invalid ipconvert state\n"); + goto bugout; + } + +@@ -435,7 +435,7 @@ static struct soap_session *create_sessi + + if ((ps = malloc(sizeof(struct soap_session))) == NULL) + { +- BUG("malloc failed: %m\n"); ++ BUG_SCAN("malloc failed: %m\n"); + return NULL; + } + memset(ps, 0, sizeof(struct soap_session)); +@@ -459,7 +459,7 @@ SANE_Status soapht_open(SANE_String_Cons + + if (session) + { +- BUG("session in use\n"); ++ BUG_SCAN("session in use\n"); + return SANE_STATUS_DEVICE_BUSY; + } + +@@ -475,7 +475,7 @@ SANE_Status soapht_open(SANE_String_Cons + + if (hpmud_open_device(session->uri, ma.mfp_mode, &session->dd) != HPMUD_R_OK) + { +- BUG("unable to open device %s\n", session->uri); ++ BUG_SCAN("unable to open device %s\n", session->uri); + goto bugout; + + free(session); +@@ -554,7 +554,7 @@ void soapht_close(SANE_Handle handle) + + if (ps == NULL || ps != session) + { +- BUG("invalid sane_close\n"); ++ BUG_SCAN("invalid sane_close\n"); + return; + } + +@@ -904,7 +904,7 @@ SANE_Status soapht_control_option(SANE_H + + if (stat != SANE_STATUS_GOOD) + { +- BUG("control_option failed: option=%s action=%s\n", ps->option[option].name, ++ BUG_SCAN("control_option failed: option=%s action=%s\n", ps->option[option].name, + action==SANE_ACTION_GET_VALUE ? "get" : action==SANE_ACTION_SET_VALUE ? "set" : "auto"); + } + +@@ -946,7 +946,7 @@ SANE_Status soapht_start(SANE_Handle han + + if (set_extents(ps)) + { +- BUG("invalid extents: tlx=%d brx=%d tly=%d bry=%d minwidth=%d minheight%d maxwidth=%d maxheight=%d\n", ++ BUG_SCAN("invalid extents: tlx=%d brx=%d tly=%d bry=%d minwidth=%d minheight%d maxwidth=%d maxheight=%d\n", + ps->currentTlx, ps->currentTly, ps->currentBrx, ps->currentBry, ps->min_width, ps->min_height, ps->tlxRange.max, ps->tlyRange.max); + stat = SANE_STATUS_INVAL; + goto bugout; +@@ -1032,7 +1032,7 @@ SANE_Status soapht_start(SANE_Handle han + /* Open image processor. */ + if ((ret = ipOpen(pXform-xforms, xforms, 0, &ps->ip_handle)) != IP_DONE) + { +- BUG("unable open image processor: err=%d\n", ret); ++ BUG_SCAN("unable open image processor: err=%d\n", ret); + stat = SANE_STATUS_INVAL; + goto bugout; + } +@@ -1075,7 +1075,7 @@ SANE_Status soapht_start(SANE_Handle han + + if (ret & (IP_INPUT_ERROR | IP_FATAL_ERROR | IP_DONE)) + { +- BUG("ipConvert error=%x\n", ret); ++ BUG_SCAN("ipConvert error=%x\n", ret); + stat = SANE_STATUS_IO_ERROR; + goto bugout; + } +@@ -1124,7 +1124,7 @@ SANE_Status soapht_read(SANE_Handle hand + + if(ret & (IP_INPUT_ERROR | IP_FATAL_ERROR)) + { +- BUG("ipConvert error=%x\n", ret); ++ BUG_SCAN("ipConvert error=%x\n", ret); + goto bugout; + } + diff --git a/hplip-dialog-infinite-loop.patch b/hplip-dialog-infinite-loop.patch new file mode 100644 index 0000000000000000000000000000000000000000..cfd635b9605b3a06d6b90f0af547eaf8dfee378d --- /dev/null +++ b/hplip-dialog-infinite-loop.patch @@ -0,0 +1,25 @@ +diff --git a/ui5/devmgr5.py b/ui5/devmgr5.py +index c23957a..48b248f 100644 +--- a/ui5/devmgr5.py ++++ b/ui5/devmgr5.py +@@ -2300,14 +2300,15 @@ class PasswordDialog(QDialog): + # XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + + def showPasswordUI(prompt): ++ dlg = None ++ + try: + dlg = PasswordDialog(prompt, None) ++ except Exception as e: ++ log.error('Unable to open password dialog due following error:\n {}'.format(e)) + +- if dlg.exec_() == QDialog.Accepted: +- return (dlg.getUsername(), dlg.getPassword()) +- +- finally: +- pass ++ if dlg and dlg.exec_() == QDialog.Accepted: ++ return (dlg.getUsername(), dlg.getPassword()) + + return ("", "") + diff --git a/hplip-find-driver.patch b/hplip-find-driver.patch new file mode 100644 index 0000000000000000000000000000000000000000..f99196756822695a37c571561568665e2b5d3c7b --- /dev/null +++ b/hplip-find-driver.patch @@ -0,0 +1,163 @@ +diff --git a/prnt/cups.py b/prnt/cups.py +index a9f410a..3783a60 100644 +--- a/prnt/cups.py ++++ b/prnt/cups.py +@@ -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) +- family_class=getFamilyClassName(model) ++ + model = models.normalizeModelName(model) +- if family_check==0: +- ppd_name = mq.get('ppd-name',0) +- else: +- ppd_name = mq.get('family-ppd',0) + +- if ppd_name == 0: +- stripped_model = stripModel2(model) +- else: +- stripped_model = stripModel2(ppd_name) ++ ppd_name = mq.get('{}'.format('family-ppd' if family_check else 'ppd-name'), 0) ++ ++ stripped_model = stripModel2(ppd_name) if ppd_name else stripModel2(model) ++ ++ wanted_model = getFamilyClassName(model) if family_check else stripped_model + + log.debug("Matching PPD list to model %s..." % stripped_model) + + matches = [] +- if family_check ==0 : +- for f in ppds: +- match = ppd_pat.match(f) +- if match is not None: +- if match.group(1) == stripped_model: +- log.debug("Found match: %s" % f) +- try: +- pdls = match.group(2).split('-') +- except AttributeError: +- pdls = [] +- 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'])) +- else: +- for f in ppds: +- match = ppd_pat1.match(f) +- if match is not None: +- if match.group(1) == family_class: +- log.debug("Found match: %s" % f) +- try: +- pdls = match.group(2).split('-') +- except AttributeError: +- pdls = [] +- 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'])) +- log.debug(matches) +- num_matches = len(matches) ++ for f in ppds: ++ # ignore foomatic and gutenprint drivers ++ if 'foomatic' in f or 'gutenprint' in f: ++ continue ++ ++ # see if driver type is in driver name ++ driver_types = [] ++ if 'hpcups' in f: ++ driver_types.append('hpcups') ++ if 'hpijs' in f: ++ driver_types.append('hpijs') ++ ++ ++ ppd_filename = f.rsplit('/', 1)[1].split('.')[0].replace('hp-', '') ++ ++ if not ppd_filename: ++ continue ++ ++ # we need to sanitize the end of filename - there can be a driver type (-hpijs, -hpcups), ++ # pdl name (-zjstream, -pdf, -ps etc.) or the device can just have '-' in their name ++ # (HP Photosmart Premium C309g-m). ++ # So if we don't know the name after '-', take it as part of device name. ++ # If we know them either like driver type of PDL, remove the string from ppd name ++ # so we can compare it with stripped model ++ pdl_candidates = [] ++ pdl_candidates = ppd_filename.split('-')[1:] ++ ++ pdls = [] ++ ppd_model = ppd_filename ++ ++ for pdl in pdl_candidates: ++ 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 ' ++ 'a part of device name.'.format(pdl)) ++ else: ++ pdls.append(pdl) ++ ppd_model=ppd_model.replace('-{}'.format(pdl), '') ++ ++ 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) ++ ++ 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]: +- for f, pdl_list in matches: ++ for f, pdl_list, driver_list in matches: + 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 +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"]: +- for f, pdl_list in matches: +- if p in f: ++ for f, pdl_list, driver_list in matches: ++ if p in driver_list: + log.debug("Selecting PPD: %s" % (f)) + return (f, '') + diff --git a/hplip-fix-Wreturn-type-warning.patch b/hplip-fix-Wreturn-type-warning.patch new file mode 100644 index 0000000000000000000000000000000000000000..aa40e1a0299d7c64546dff8169e05d4841150ac2 --- /dev/null +++ b/hplip-fix-Wreturn-type-warning.patch @@ -0,0 +1,100 @@ +--- hplip-3.20.3/scan/sane/hpaio.c.orig 2020-03-25 01:24:15.558732638 +0000 ++++ hplip-3.20.3/scan/sane/hpaio.c 2020-03-25 02:48:36.097054366 +0000 +@@ -406,20 +406,34 @@ extern SANE_Status sane_hpaio_open(SANE_ + + extern void sane_hpaio_close(SANE_Handle handle) + { +- if (strcmp(*((char **)handle), "MARVELL") == 0) +- return marvell_close(handle); +- if (strcmp(*((char **)handle), "SOAP") == 0) +- return soap_close(handle); +- if (strcmp(*((char **)handle), "SOAPHT") == 0) +- return soapht_close(handle); +- if (strcmp(*((char **)handle), "LEDM") == 0) +- return ledm_close(handle); +- if (strcmp(*((char **)handle), "SCL-PML") == 0) +- return sclpml_close(handle); +- if (strcmp(*((char **)handle), "ESCL") == 0) +- return escl_close(handle); +- if (strcmp(*((char **)handle), "ORBLITE") == 0) +- return orblite_close(handle); ++ if (strcmp(*((char **)handle), "MARVELL") == 0) { ++ marvell_close(handle); ++ return; ++ } ++ if (strcmp(*((char **)handle), "SOAP") == 0) { ++ soap_close(handle); ++ return; ++ } ++ if (strcmp(*((char **)handle), "SOAPHT") == 0) { ++ soapht_close(handle); ++ return; ++ } ++ if (strcmp(*((char **)handle), "LEDM") == 0) { ++ ledm_close(handle); ++ return; ++ } ++ if (strcmp(*((char **)handle), "SCL-PML") == 0) { ++ sclpml_close(handle); ++ return; ++ } ++ if (strcmp(*((char **)handle), "ESCL") == 0) { ++ escl_close(handle); ++ return; ++ } ++ if (strcmp(*((char **)handle), "ORBLITE") == 0) { ++ orblite_close(handle); ++ return; ++ } + } /* sane_hpaio_close() */ + + extern const SANE_Option_Descriptor * sane_hpaio_get_option_descriptor(SANE_Handle handle, SANE_Int option) +@@ -539,20 +553,34 @@ extern SANE_Status sane_hpaio_read(SANE_ + /* Note, sane_cancel is called normally not just during IO abort situations. */ + extern void sane_hpaio_cancel( SANE_Handle handle ) + { +- if (strcmp(*((char **)handle), "MARVELL") == 0) +- return marvell_cancel(handle); +- if (strcmp(*((char **)handle), "SOAP") == 0) +- return soap_cancel(handle); +- if (strcmp(*((char **)handle), "SOAPHT") == 0) +- return soapht_cancel(handle); +- if (strcmp(*((char **)handle), "LEDM") == 0) +- return ledm_cancel(handle); +- if (strcmp(*((char **)handle), "SCL-PML") == 0) +- return sclpml_cancel(handle); +- if (strcmp(*((char **)handle), "ESCL") == 0) +- return escl_cancel(handle); +- if (strcmp(*((char **)handle), "ORBLITE") == 0) +- return orblite_cancel(handle); ++ if (strcmp(*((char **)handle), "MARVELL") == 0) { ++ marvell_cancel(handle); ++ return; ++ } ++ if (strcmp(*((char **)handle), "SOAP") == 0) { ++ soap_cancel(handle); ++ return; ++ } ++ if (strcmp(*((char **)handle), "SOAPHT") == 0) { ++ soapht_cancel(handle); ++ return; ++ } ++ if (strcmp(*((char **)handle), "LEDM") == 0) { ++ ledm_cancel(handle); ++ return; ++ } ++ if (strcmp(*((char **)handle), "SCL-PML") == 0) { ++ sclpml_cancel(handle); ++ return; ++ } ++ if (strcmp(*((char **)handle), "ESCL") == 0) { ++ escl_cancel(handle); ++ return; ++ } ++ if (strcmp(*((char **)handle), "ORBLITE") == 0) { ++ orblite_cancel(handle); ++ return; ++ } + } /* sane_hpaio_cancel() */ + + extern SANE_Status sane_hpaio_set_io_mode(SANE_Handle handle, SANE_Bool nonBlocking) diff --git a/hplip-fix-parsing-lpstat.patch b/hplip-fix-parsing-lpstat.patch new file mode 100644 index 0000000000000000000000000000000000000000..d6028ab82cebf299d754c2032b73492d809e32ac --- /dev/null +++ b/hplip-fix-parsing-lpstat.patch @@ -0,0 +1,13 @@ +diff --git a/base/queues.py b/base/queues.py +index 2f56c8a..0818574 100755 +--- a/base/queues.py ++++ b/base/queues.py +@@ -101,7 +101,7 @@ def parseQueues(mode): + try: + match = LPSTAT_PATTERN.search(p) + printer_name = match.group(1) +- device_uri = match.group(2) ++ device_uri = match.group(3) + cups_printers.append((printer_name, device_uri)) + except AttributeError: + pass diff --git a/hplip-gpgdir-perms.patch b/hplip-gpgdir-perms.patch new file mode 100644 index 0000000000000000000000000000000000000000..51475de6845dd39ec73e6fdb59693f6e88a42d9b --- /dev/null +++ b/hplip-gpgdir-perms.patch @@ -0,0 +1,13 @@ +diff --git a/base/validation.py b/base/validation.py +index 96e65be..35f22eb 100644 +--- a/base/validation.py ++++ b/base/validation.py +@@ -58,7 +58,7 @@ class GPG_Verification(DigiSign_Verification): + + if not os.path.exists(self.__gpg_dir): + try: +- os.mkdir(self.__gpg_dir, 0o755) ++ os.mkdir(self.__gpg_dir, 0o700) + except OSError: + log.error("Failed to create %s" % self.__gpg_dir) + self.__change_owner() diff --git a/hplip-hpaio-gcc14.patch b/hplip-hpaio-gcc14.patch new file mode 100644 index 0000000000000000000000000000000000000000..f7d195ed10cfe28abb2e48e8a9d5f55c0765c345 --- /dev/null +++ b/hplip-hpaio-gcc14.patch @@ -0,0 +1,114 @@ +diff --git a/scan/sane/hpaio.c b/scan/sane/hpaio.c +index 57d1dde..3475929 100644 +--- a/scan/sane/hpaio.c ++++ b/scan/sane/hpaio.c +@@ -379,7 +379,7 @@ extern SANE_Status sane_hpaio_get_devices(const SANE_Device ***deviceList, SANE_ + ResetDeviceList(&DeviceList); + DevDiscovery(localOnly); + *deviceList = (const SANE_Device **)DeviceList; +- SANE_Device*** devList; ++ const SANE_Device*** devList; + orblite_get_devices(devList, localOnly); + + return SANE_STATUS_GOOD; +diff --git a/scan/sane/orblite.c b/scan/sane/orblite.c +index 2eb7aba..4eaa468 100644 +--- a/scan/sane/orblite.c ++++ b/scan/sane/orblite.c +@@ -64,28 +64,28 @@ SANE_Option_Descriptor DefaultOrbOptions[] = { + SANE_NAME_SCAN_TL_X, SANE_TITLE_SCAN_TL_X, SANE_DESC_SCAN_TL_X, // name, title, desc + SANE_TYPE_FIXED, SANE_UNIT_MM, sizeof(SANE_Fixed),// type, unit, size + SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT, // cap(ability) +- SANE_CONSTRAINT_RANGE, (SANE_Char**)&SANE_rangeLeft // constraint_type, constraint ++ SANE_CONSTRAINT_RANGE, (const SANE_Char**)&SANE_rangeLeft // constraint_type, constraint + }, + + { + SANE_NAME_SCAN_TL_Y, SANE_TITLE_SCAN_TL_Y, SANE_DESC_SCAN_TL_Y, // name, title, desc + SANE_TYPE_FIXED, SANE_UNIT_MM, sizeof(SANE_Fixed),// type, unit, size + SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT, // cap(ability) +- SANE_CONSTRAINT_RANGE, (SANE_Char**)&SANE_rangeTop // constraint_type, constraint ++ SANE_CONSTRAINT_RANGE, (const SANE_Char**)&SANE_rangeTop // constraint_type, constraint + }, + + { + SANE_NAME_SCAN_BR_X, SANE_TITLE_SCAN_BR_X, SANE_DESC_SCAN_BR_X, // name, title, desc + SANE_TYPE_FIXED, SANE_UNIT_MM, sizeof(SANE_Fixed),// type, unit, size + SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT, // cap(ability) +- SANE_CONSTRAINT_RANGE, (SANE_Char**)&SANE_rangeRight // constraint_type, constraint ++ SANE_CONSTRAINT_RANGE, (const SANE_Char**)&SANE_rangeRight // constraint_type, constraint + }, + + { + SANE_NAME_SCAN_BR_Y, SANE_TITLE_SCAN_BR_Y, SANE_DESC_SCAN_BR_Y, // name, title, desc + SANE_TYPE_FIXED, SANE_UNIT_MM, sizeof(SANE_Fixed),// type, unit, size + SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT, // cap(ability) +- SANE_CONSTRAINT_RANGE, (SANE_Char**)&SANE_rangeBottom // constraint_type, constraint ++ SANE_CONSTRAINT_RANGE, (const SANE_Char**)&SANE_rangeBottom // constraint_type, constraint + }, + + // optResolution, // resolution group +@@ -93,7 +93,7 @@ SANE_Option_Descriptor DefaultOrbOptions[] = { + SANE_NAME_SCAN_RESOLUTION, SANE_TITLE_SCAN_RESOLUTION, SANE_DESC_SCAN_RESOLUTION, // name, title, desc + SANE_TYPE_INT, SANE_UNIT_DPI, sizeof(SANE_Word), // type, unit, size, + SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT, // cap(ability) +- SANE_CONSTRAINT_WORD_LIST, (SANE_Char**)SANE_resolutions // constraint type, constraint ++ SANE_CONSTRAINT_WORD_LIST, (const SANE_Char**)SANE_resolutions // constraint type, constraint + }, + + // optMode, // color/depth group +@@ -101,7 +101,7 @@ SANE_Option_Descriptor DefaultOrbOptions[] = { + SANE_NAME_SCAN_MODE, SANE_TITLE_SCAN_MODE, SANE_DESC_SCAN_MODE, // name, title, desc + SANE_TYPE_STRING, SANE_UNIT_NONE, 256, // type, unit, size, + SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT, // cap(ability) +- SANE_CONSTRAINT_STRING_LIST, (SANE_Char**)SANE_modes // constraint type, constraint ++ SANE_CONSTRAINT_STRING_LIST, (const SANE_Char**)SANE_modes // constraint type, constraint + }, + + // optSource, +@@ -109,7 +109,7 @@ SANE_Option_Descriptor DefaultOrbOptions[] = { + SANE_NAME_SCAN_SOURCE, SANE_TITLE_SCAN_SOURCE, SANE_DESC_SCAN_SOURCE, // name, title, desc + SANE_TYPE_STRING, SANE_UNIT_NONE, 256, // type, unit, size, + SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT, // cap(ability) +- SANE_CONSTRAINT_STRING_LIST, (SANE_Char**)SANE_sources // constraint type, constraint ++ SANE_CONSTRAINT_STRING_LIST, (const SANE_Char**)SANE_sources // constraint type, constraint + }, + + // optPaperSize, +@@ -117,7 +117,7 @@ SANE_Option_Descriptor DefaultOrbOptions[] = { + SANE_NAME_PAPER_SIZE, SANE_TITLE_PAPER_SIZE, SANE_DESC_PAPER_SIZE, // name, title, desc + SANE_TYPE_STRING, SANE_UNIT_NONE, 256, // type, unit, size, + SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT, // cap(ability) +- SANE_CONSTRAINT_STRING_LIST, (SANE_Char**)SANE_paper_sizes // constraint type, constraint ++ SANE_CONSTRAINT_STRING_LIST, (const SANE_Char**)SANE_paper_sizes // constraint type, constraint + }, + + // optPaperSize, +@@ -125,7 +125,7 @@ SANE_Option_Descriptor DefaultOrbOptions[] = { + SANE_NAME_PAPER_SIZE, SANE_TITLE_PAPER_SIZE, SANE_DESC_PAPER_SIZE, // name, title, desc + SANE_TYPE_INT, SANE_UNIT_DPI, sizeof(SANE_Word), // type, unit, size, + SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT, // cap(ability) +- SANE_CONSTRAINT_WORD_LIST, (SANE_Char**)SANE_resolutions // constraint type, constraint ++ SANE_CONSTRAINT_WORD_LIST, (const SANE_Char**)SANE_resolutions // constraint type, constraint + }, + #ifdef NOTDEF + // default template +@@ -274,6 +274,7 @@ orblite_open (SANE_String_Const devicename, SANE_Handle * handle) + SANE_Auth_Callback authorize; + const SANE_Device *** device_list; + SANE_Bool local_only; ++ void * temp_handle; + + + // Allocate handle, set all handle values to zero +@@ -305,7 +306,9 @@ orblite_open (SANE_String_Const devicename, SANE_Handle * handle) + if (stat != SANE_STATUS_GOOD) + return stat; + +- stat = g_handle->bb_orblite_open(devicename, &g_handle); ++ temp_handle = g_handle; ++ stat = g_handle->bb_orblite_open(devicename, &temp_handle); ++ g_handle = temp_handle; + if (stat == SANE_STATUS_GOOD) + *handle = g_handle; + diff --git a/hplip-hpcups-crash.patch b/hplip-hpcups-crash.patch new file mode 100644 index 0000000000000000000000000000000000000000..28f34f7b06fbd77284c9ce3b2b67f4f75133dd0c --- /dev/null +++ b/hplip-hpcups-crash.patch @@ -0,0 +1,13 @@ +diff --git a/prnt/hpcups/Compressor.cpp b/prnt/hpcups/Compressor.cpp +index 7fbbcd0..a29955e 100644 +--- a/prnt/hpcups/Compressor.cpp ++++ b/prnt/hpcups/Compressor.cpp +@@ -29,7 +29,7 @@ + \*****************************************************************************/ + #include "Compressor.h" + +-Compressor::Compressor (unsigned int RasterSize, bool useseed) : SeedRow(NULL), UseSeedRow(useseed), inputsize(RasterSize), seeded(false) ++Compressor::Compressor (unsigned int RasterSize, bool useseed) : SeedRow(NULL), compressBuf(NULL), UseSeedRow(useseed), inputsize(RasterSize), seeded(false) + { + constructor_error = NO_ERROR; + iRastersReady = 0; diff --git a/hplip-hpfirmware-timeout.patch b/hplip-hpfirmware-timeout.patch new file mode 100644 index 0000000000000000000000000000000000000000..77db559664ac76897a068dd36f1110742ae88171 --- /dev/null +++ b/hplip-hpfirmware-timeout.patch @@ -0,0 +1,24 @@ +diff --git a/config_usb_printer.py b/config_usb_printer.py +index 946a2d4..8db097e 100755 +--- a/config_usb_printer.py ++++ b/config_usb_printer.py +@@ -28,6 +28,7 @@ __doc__ = "Udev invokes this tool. Tool detects the plugin, Smart Install (C/DVD + # Std Lib + import sys + import os ++import time + + # Local + from base.g import * +@@ -181,9 +182,10 @@ try: + # ******************************* RUNNING FIRMWARE DOWNLOAD TO DEVICE FOR SUPPORTED PRINTER'S + fw_download_req = mq.get('fw-download', False) + if fw_download_req: +- fw_cmd = "hp-firmware -y3 -s %s"%param ++ fw_cmd = "hp-firmware -n -y3 -s %s"%param + log.info(fw_cmd) + fw_sts, fw_out = utils.run(fw_cmd) ++ time.sleep(5) + if fw_sts == 0: + log.debug("Firmware downloaded to %s "%device_uri) + else: diff --git a/hplip-hplj-3052.patch b/hplip-hplj-3052.patch new file mode 100644 index 0000000000000000000000000000000000000000..c65efac3c112a7aee55b78529a9e12e660b82bba --- /dev/null +++ b/hplip-hplj-3052.patch @@ -0,0 +1,21 @@ +diff --git a/scan/scanext/scanext.c b/scan/scanext/scanext.c +index ff57987..f607220 100755 +--- a/scan/scanext/scanext.c ++++ b/scan/scanext/scanext.c +@@ -407,16 +407,6 @@ static PyObject *setOption (_ScanDevice * self, PyObject * args) + int n; + multipick = 1; + +-if(1) +-{ +-SANE_Bool b = SANE_TRUE; +- sane_control_option (self->h, 9, SANE_ACTION_SET_VALUE, (void *)&b, &i); +-} +-else +-{ +-SANE_Bool b = SANE_FALSE; +- sane_control_option (self->h, 9, SANE_ACTION_SET_VALUE, (void *)&b, &i); +-} + if (!PyArg_ParseTuple (args, "iO", &n, &value)) + raiseError("Invalid arguments."); + diff --git a/hplip-hpmud-string-parse.patch b/hplip-hpmud-string-parse.patch new file mode 100644 index 0000000000000000000000000000000000000000..58bf5dd3e2797e8df0af698e01108b9164716be7 --- /dev/null +++ b/hplip-hpmud-string-parse.patch @@ -0,0 +1,16 @@ +diff --git a/io/hpmud/model.c b/io/hpmud/model.c +index 4ea8990..72c630b 100644 +--- a/io/hpmud/model.c ++++ b/io/hpmud/model.c +@@ -420,7 +420,10 @@ static int ParseFile(char *datFile, char *model, char *attr, int attrSize, int * + strncpy(section, rcbuf+1, sizeof(section)); /* found new section */ + n = strlen(section); + section[n-2]=0; /* remove ']' and CR */ +- if (strcasecmp(model, section) == 0) ++ if (strcasecmp(model, section) == 0 || ++ (section[0] == 'h' && section[1] == 'p' && ++ section[2] == '_' && ++ strcasecmp(model, section + 3) == 0)) + { + /* Found model match. */ + *bytes_read = ResolveAttributes(fp, attr, attrSize); diff --git a/hplip-hpsetup-noscanjets.patch b/hplip-hpsetup-noscanjets.patch new file mode 100644 index 0000000000000000000000000000000000000000..52a469075d449d4ef045fc4cc7f3fa252a47be79 --- /dev/null +++ b/hplip-hpsetup-noscanjets.patch @@ -0,0 +1,46 @@ +diff -up hplip-3.23.3/setup.py.hpsetup-noscanjets hplip-3.23.3/setup.py +--- hplip-3.23.3/setup.py.hpsetup-noscanjets 2023-05-29 14:16:26.148133678 +0200 ++++ hplip-3.23.3/setup.py 2023-05-29 14:16:26.220133253 +0200 +@@ -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 -up hplip-3.23.3/ui5/setupdialog.py.hpsetup-noscanjets hplip-3.23.3/ui5/setupdialog.py +--- hplip-3.23.3/ui5/setupdialog.py.hpsetup-noscanjets 2023-05-29 14:16:26.220133253 +0200 ++++ hplip-3.23.3/ui5/setupdialog.py 2023-05-29 14:18:12.475041454 +0200 +@@ -1391,6 +1391,18 @@ class SetupDialog(QDialog, Ui_Dialog): + 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-keyserver.patch b/hplip-keyserver.patch new file mode 100644 index 0000000000000000000000000000000000000000..9b457f18882d95187daa18bcdc81d4d36f6d38ac --- /dev/null +++ b/hplip-keyserver.patch @@ -0,0 +1,56 @@ +diff --git a/base/tui.py b/base/tui.py +index 99bda7b..0f90f92 100644 +--- a/base/tui.py ++++ b/base/tui.py +@@ -241,6 +241,7 @@ class ProgressMeter(object): + sys.stdout.write(y) + + sys.stdout.flush() ++ sys.stdout.write('\n') + self.prev_length = len(y) + self.spinner_pos = (self.spinner_pos + 1) % 8 + +diff --git a/base/validation.py b/base/validation.py +index ee6b05a..5e955dc 100644 +--- a/base/validation.py ++++ b/base/validation.py +@@ -42,8 +42,11 @@ class DigiSign_Verification(object): + + + class GPG_Verification(DigiSign_Verification): +- def __init__(self, pgp_site = 'pgp.mit.edu', key = 0x4ABA2F66DBD5A95894910E0673D770CDA59047B9): +- self.__pgp_site = pgp_site ++ def __init__(self, keyservers = ['keyserver.ubuntu.com', ++ 'pgp.surf.nl', ++ 'pgp.mit.edu'], ++ key = 0x4ABA2F66DBD5A95894910E0673D770CDA59047B9): ++ self.__keyservers = keyservers + self.__key = key + self.__gpg = utils.which('gpg',True) + +@@ -82,13 +85,18 @@ class GPG_Verification(DigiSign_Verification): + + + def __acquire_gpg_key(self): +- +- cmd = '%s --homedir %s --no-permission-warning --keyserver %s --recv-keys 0x%X' \ +- % (self.__gpg, self.__gpg_dir, self.__pgp_site, self.__key) +- +- log.info("Receiving digital keys: %s" % cmd) +- status, output = utils.run(cmd) +- log.debug(output) ++ for kserver in self.__keyservers: ++ cmd = '%s --homedir %s --no-permission-warning --keyserver %s --recv-keys 0x%X' \ ++ % (self.__gpg, self.__gpg_dir, kserver, self.__key) ++ ++ log.info("Receiving digital keys: %s" % cmd) ++ status, output = utils.run(cmd) ++ log.debug(output) ++ ++ if not status: ++ break ++ log.info("Receiving keys from {} failed, trying the next keyserver." ++ .format(kserver)) + + self.__change_owner(True) + diff --git a/hplip-locale-format.patch b/hplip-locale-format.patch new file mode 100644 index 0000000000000000000000000000000000000000..32fba1e95b64617b15ba52b2f0bfc64ddfa61610 --- /dev/null +++ b/hplip-locale-format.patch @@ -0,0 +1,13 @@ +diff --git a/base/utils.py b/base/utils.py +index e2de550..55848b8 100644 +--- a/base/utils.py ++++ b/base/utils.py +@@ -474,7 +474,7 @@ def sort_dict_by_value(d): + + + def commafy(val): +- return locale.format("%s", val, grouping=True) ++ return locale.format_string("%s", val, grouping=True) + + + def format_bytes(s, show_bytes=False): diff --git a/hplip-logging-segfault.patch b/hplip-logging-segfault.patch new file mode 100644 index 0000000000000000000000000000000000000000..4d7d2f0555ccf4dc76afbbc43c4ebb6242d882d8 --- /dev/null +++ b/hplip-logging-segfault.patch @@ -0,0 +1,13 @@ +diff --git a/io/hpmud/musb.c b/io/hpmud/musb.c +index 755493e..6d9c7fc 100644 +--- a/io/hpmud/musb.c ++++ b/io/hpmud/musb.c +@@ -1454,7 +1454,7 @@ enum HPMUD_RESULT __attribute__ ((visibility ("hidden"))) musb_raw_channel_write + BUG("unable to write data %s: %d second io timeout\n", msp->device[pc->dindex].uri, sec_timeout); + } + else +- BUG("unable to write data (len = %d) %s: %m\n", msp->device[pc->dindex].uri, len); ++ BUG("unable to write data (len = %d) %s: %m\n", len, msp->device[pc->dindex].uri); + goto bugout; + } + if(len == 0 && size > 0) diff --git a/hplip-m278-m281-needs-plugin.patch b/hplip-m278-m281-needs-plugin.patch new file mode 100644 index 0000000000000000000000000000000000000000..2a0783cda46131bbddc3a0e0c92dbbb1a150e614 --- /dev/null +++ b/hplip-m278-m281-needs-plugin.patch @@ -0,0 +1,15 @@ +diff --git a/data/models/models.dat b/data/models/models.dat +index 4b21c1a..76c4cc0 100644 +--- a/data/models/models.dat ++++ b/data/models/models.dat +@@ -64063,8 +64063,8 @@ model11=HP Color LaserJet Pro MFP M280c2 + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-color_laserjet_mfp_m278-m281-ps.ppd + family-ppd=hp-postscript-laserjet-pro.ppd diff --git a/hplip-missing-drivers.patch b/hplip-missing-drivers.patch new file mode 100644 index 0000000000000000000000000000000000000000..bb9b7597855d24c046bfbe69cd9f1440780c583f --- /dev/null +++ b/hplip-missing-drivers.patch @@ -0,0 +1,602 @@ +diff -up hplip-3.22.2/cups_drv.inc.missing-drivers hplip-3.22.2/cups_drv.inc +--- hplip-3.22.2/cups_drv.inc.missing-drivers 2022-02-23 08:42:29.000000000 +0100 ++++ hplip-3.22.2/cups_drv.inc 2022-03-10 09:11:00.337315604 +0100 +@@ -411,6 +411,7 @@ cups_ppd_printers = \ + ppd/hpcups/hp-laserjet_cm1418fnw-pcl3.ppd.gz \ + ppd/hpcups/hp-laserjet_cp1025.ppd.gz \ + ppd/hpcups/hp-laserjet_cp1025nw.ppd.gz \ ++ ppd/hpcups/hp-laserjet_cp_1025nw.ppd.gz \ + ppd/hpcups/hp-laserjet_m1005.ppd.gz \ + ppd/hpcups/hp-laserjet_m101-m106.ppd.gz \ + ppd/hpcups/hp-laserjet_m109-m112.ppd.gz \ +@@ -527,6 +528,7 @@ cups_ppd_printers = \ + ppd/hpcups/hp-laserjet_professional_p1607dn.ppd.gz \ + ppd/hpcups/hp-laserjet_professional_p1608dn.ppd.gz \ + ppd/hpcups/hp-laserjet_professional_p1609dn.ppd.gz \ ++ ppd/hpcups/hp-laserjet_professional_p1102w.ppd.gz \ + ppd/hpcups/hp-laserjet_professional_p_1102w.ppd.gz \ + ppd/hpcups/hp-laserjet_tank_1020.ppd.gz \ + ppd/hpcups/hp-laserjet_tank_150x.ppd.gz \ +diff -up hplip-3.22.2/data/models/models.dat.missing-drivers hplip-3.22.2/data/models/models.dat +--- hplip-3.22.2/data/models/models.dat.missing-drivers 2022-03-10 09:10:13.601066235 +0100 ++++ hplip-3.22.2/data/models/models.dat 2022-03-10 09:10:13.622066347 +0100 +@@ -2104,7 +2104,7 @@ usb-pid=411 + usb-vid=3f0 + wifi-config=0 + +-[hp_laserjet_100_colormfp_m175] ++[hp_laserjet_100_colormfp_m175nw] + align-type=0 + clean-type=0 + color-cal-type=0 +@@ -2119,14 +2119,6 @@ io-support=14 + job-storage=0 + linefeed-cal-type=0 + model1=HP LaserJet 100 Color MFP M175 +-model2=HP LaserJet 100 Color MFP M175a +-model3=HP LaserJet 100 Color MFP M175b +-model4=HP LaserJet 100 Color MFP M175c +-model5=HP LaserJet 100 Color MFP M175e +-model6=HP LaserJet 100 Color MFP M175nw +-model7=HP LaserJet 100 Color MFP M175p +-model8=HP LaserJet 100 Color MFP M175q +-model9=HP LaserJet 100 Color MFP M175r + ppd-name=hp-laserjet_100_color_mfp_m175-ps.ppd + monitor-type=0 + panel-check-type=0 +@@ -2165,6 +2157,378 @@ usb-pid=62a + usb-vid=3f0 + wifi-config=3 + ++[hp_laserjet_100_colormfp_m175r] ++align-type=0 ++clean-type=0 ++color-cal-type=0 ++copy-type=0 ++embedded-server-type=1 ++fax-type=0 ++fw-download=False ++icon=hp_color_laserjet_cm1312_mfp.png ++io-mfp-mode=3 ++io-mode=1 ++io-support=14 ++job-storage=0 ++linefeed-cal-type=0 ++model1=HP LaserJet 100 Color MFP M175 ++ppd-name=hp-laserjet_100_color_mfp_m175-ps.ppd ++monitor-type=0 ++panel-check-type=0 ++pcard-type=0 ++plugin=1 ++plugin-reason=64 ++power-settings=0 ++pq-diag-type=0 ++r-type=0 ++r0-agent1-kind=4 ++r0-agent1-sku=CE310A ++r0-agent1-type=1 ++r0-agent2-kind=4 ++r0-agent2-sku=CE311A ++r0-agent2-type=4 ++r0-agent3-kind=4 ++r0-agent3-sku=CE313A ++r0-agent3-type=5 ++r0-agent4-kind=4 ++r0-agent4-sku=CE312A ++r0-agent4-type=6 ++scan-src=3 ++scan-type=5 ++status-battery-check=0 ++status-dynamic-counters=0 ++status-type=10 ++support-released=True ++support-subtype=219b2b ++support-type=2 ++support-ver=3.11.7 ++tech-class=Postscript ++family-class=Undefined ++tech-subclass=Normal ++tech-type=4 ++usb-pid=62a ++usb-vid=3f0 ++wifi-config=3 ++ ++[hp_laserjet_100_colormfp_m175q] ++align-type=0 ++clean-type=0 ++color-cal-type=0 ++copy-type=0 ++embedded-server-type=1 ++fax-type=0 ++fw-download=False ++icon=hp_color_laserjet_cm1312_mfp.png ++io-mfp-mode=3 ++io-mode=1 ++io-support=14 ++job-storage=0 ++linefeed-cal-type=0 ++model1=HP LaserJet 100 Color MFP M175 ++ppd-name=hp-laserjet_100_color_mfp_m175-ps.ppd ++monitor-type=0 ++panel-check-type=0 ++pcard-type=0 ++plugin=1 ++plugin-reason=64 ++power-settings=0 ++pq-diag-type=0 ++r-type=0 ++r0-agent1-kind=4 ++r0-agent1-sku=CE310A ++r0-agent1-type=1 ++r0-agent2-kind=4 ++r0-agent2-sku=CE311A ++r0-agent2-type=4 ++r0-agent3-kind=4 ++r0-agent3-sku=CE313A ++r0-agent3-type=5 ++r0-agent4-kind=4 ++r0-agent4-sku=CE312A ++r0-agent4-type=6 ++scan-src=3 ++scan-type=5 ++status-battery-check=0 ++status-dynamic-counters=0 ++status-type=10 ++support-released=True ++support-subtype=219b2b ++support-type=2 ++support-ver=3.11.7 ++tech-class=Postscript ++family-class=Undefined ++tech-subclass=Normal ++tech-type=4 ++usb-pid=62a ++usb-vid=3f0 ++wifi-config=3 ++ ++[hp_laserjet_100_colormfp_m175p] ++align-type=0 ++clean-type=0 ++color-cal-type=0 ++copy-type=0 ++embedded-server-type=1 ++fax-type=0 ++fw-download=False ++icon=hp_color_laserjet_cm1312_mfp.png ++io-mfp-mode=3 ++io-mode=1 ++io-support=14 ++job-storage=0 ++linefeed-cal-type=0 ++model1=HP LaserJet 100 Color MFP M175 ++ppd-name=hp-laserjet_100_color_mfp_m175-ps.ppd ++monitor-type=0 ++panel-check-type=0 ++pcard-type=0 ++plugin=1 ++plugin-reason=64 ++power-settings=0 ++pq-diag-type=0 ++r-type=0 ++r0-agent1-kind=4 ++r0-agent1-sku=CE310A ++r0-agent1-type=1 ++r0-agent2-kind=4 ++r0-agent2-sku=CE311A ++r0-agent2-type=4 ++r0-agent3-kind=4 ++r0-agent3-sku=CE313A ++r0-agent3-type=5 ++r0-agent4-kind=4 ++r0-agent4-sku=CE312A ++r0-agent4-type=6 ++scan-src=3 ++scan-type=5 ++status-battery-check=0 ++status-dynamic-counters=0 ++status-type=10 ++support-released=True ++support-subtype=219b2b ++support-type=2 ++support-ver=3.11.7 ++tech-class=Postscript ++family-class=Undefined ++tech-subclass=Normal ++tech-type=4 ++usb-pid=62a ++usb-vid=3f0 ++wifi-config=3 ++ ++[hp_laserjet_100_colormfp_m175e] ++align-type=0 ++clean-type=0 ++color-cal-type=0 ++copy-type=0 ++embedded-server-type=1 ++fax-type=0 ++fw-download=False ++icon=hp_color_laserjet_cm1312_mfp.png ++io-mfp-mode=3 ++io-mode=1 ++io-support=2 ++job-storage=0 ++linefeed-cal-type=0 ++model1=HP LaserJet 100 Color MFP M175 ++ppd-name=hp-laserjet_100_color_mfp_m175-ps.ppd ++monitor-type=0 ++panel-check-type=0 ++pcard-type=0 ++plugin=1 ++plugin-reason=64 ++power-settings=0 ++pq-diag-type=0 ++r-type=0 ++r0-agent1-kind=4 ++r0-agent1-sku=CE310A ++r0-agent1-type=1 ++r0-agent2-kind=4 ++r0-agent2-sku=CE311A ++r0-agent2-type=4 ++r0-agent3-kind=4 ++r0-agent3-sku=CE313A ++r0-agent3-type=5 ++r0-agent4-kind=4 ++r0-agent4-sku=CE312A ++r0-agent4-type=6 ++scan-src=3 ++scan-type=5 ++status-battery-check=0 ++status-dynamic-counters=0 ++status-type=10 ++support-released=True ++support-subtype=219b2b ++support-type=2 ++support-ver=3.11.7 ++tech-class=Postscript ++family-class=Undefined ++tech-subclass=Normal ++tech-type=4 ++usb-pid=62a ++usb-vid=3f0 ++wifi-config=-1 ++ ++[hp_laserjet_100_colormfp_m175a] ++align-type=0 ++clean-type=0 ++color-cal-type=0 ++copy-type=0 ++embedded-server-type=1 ++ppd-name=hp-laserjet_100_color_mfp_m175-ps.ppd ++family-ppd=hp-postscript-laserjet-pro.ppd ++fax-type=0 ++fw-download=False ++icon=hp_color_laserjet_cm1312_mfp.png ++io-mfp-mode=3 ++io-mode=1 ++io-support=2 ++job-storage=0 ++linefeed-cal-type=0 ++model1=HP LaserJet 100 Color MFP M175 ++monitor-type=0 ++panel-check-type=0 ++pcard-type=0 ++plugin=1 ++plugin-reason=64 ++power-settings=0 ++pq-diag-type=0 ++r-type=0 ++r0-agent1-kind=4 ++r0-agent1-sku=CE310A ++r0-agent1-type=1 ++r0-agent2-kind=4 ++r0-agent2-sku=CE311A ++r0-agent2-type=4 ++r0-agent3-kind=4 ++r0-agent3-sku=CE313A ++r0-agent3-type=5 ++r0-agent4-kind=4 ++r0-agent4-sku=CE312A ++r0-agent4-type=6 ++scan-src=3 ++scan-type=5 ++status-battery-check=0 ++status-dynamic-counters=0 ++status-type=10 ++support-released=True ++support-subtype=219b2b ++support-type=2 ++support-ver=3.11.7 ++tech-class=Postscript ++family-class=Undefined ++tech-subclass=Normal ++tech-type=4 ++usb-pid=62a ++usb-vid=3f0 ++wifi-config=-1 ++ ++[hp_laserjet_100_colormfp_m175c] ++align-type=0 ++clean-type=0 ++color-cal-type=0 ++copy-type=0 ++embedded-server-type=1 ++fax-type=0 ++fw-download=False ++icon=hp_color_laserjet_cm1312_mfp.png ++io-mfp-mode=3 ++io-mode=1 ++io-support=2 ++job-storage=0 ++linefeed-cal-type=0 ++model1=HP LaserJet 100 Color MFP M175 ++ppd-name=hp-laserjet_100_color_mfp_m175-ps.ppd ++monitor-type=0 ++panel-check-type=0 ++pcard-type=0 ++plugin=1 ++plugin-reason=64 ++power-settings=0 ++pq-diag-type=0 ++r-type=0 ++r0-agent1-kind=4 ++r0-agent1-sku=CE310A ++r0-agent1-type=1 ++r0-agent2-kind=4 ++r0-agent2-sku=CE311A ++r0-agent2-type=4 ++r0-agent3-kind=4 ++r0-agent3-sku=CE313A ++r0-agent3-type=5 ++r0-agent4-kind=4 ++r0-agent4-sku=CE312A ++r0-agent4-type=6 ++scan-src=3 ++scan-type=5 ++status-battery-check=0 ++status-dynamic-counters=0 ++status-type=10 ++support-released=True ++support-subtype=219b2b ++support-type=2 ++support-ver=3.11.7 ++tech-class=Postscript ++family-class=Undefined ++tech-subclass=Normal ++tech-type=4 ++usb-pid=62a ++usb-vid=3f0 ++wifi-config=-1 ++ ++[hp_laserjet_100_colormfp_m175b] ++align-type=0 ++clean-type=0 ++color-cal-type=0 ++copy-type=0 ++embedded-server-type=1 ++fax-type=0 ++fw-download=False ++icon=hp_color_laserjet_cm1312_mfp.png ++io-mfp-mode=3 ++io-mode=1 ++io-support=2 ++job-storage=0 ++linefeed-cal-type=0 ++model1=HP LaserJet 100 Color MFP M175 ++ppd-name=hp-laserjet_100_color_mfp_m175-ps.ppd ++monitor-type=0 ++panel-check-type=0 ++pcard-type=0 ++plugin=1 ++plugin-reason=64 ++power-settings=0 ++pq-diag-type=0 ++r-type=0 ++r0-agent1-kind=4 ++r0-agent1-sku=CE310A ++r0-agent1-type=1 ++r0-agent2-kind=4 ++r0-agent2-sku=CE311A ++r0-agent2-type=4 ++r0-agent3-kind=4 ++r0-agent3-sku=CE313A ++r0-agent3-type=5 ++r0-agent4-kind=4 ++r0-agent4-sku=CE312A ++r0-agent4-type=6 ++scan-src=3 ++scan-type=5 ++status-battery-check=0 ++status-dynamic-counters=0 ++status-type=10 ++support-released=True ++support-subtype=219b2b ++support-type=2 ++support-ver=3.11.7 ++tech-class=Postscript ++family-class=Undefined ++tech-subclass=Normal ++tech-type=4 ++usb-pid=62a ++usb-vid=3f0 ++wifi-config=-1 ++ + [officejet_100_mobile_l411] + align-type=-1 + clean-type=1 +@@ -17867,6 +18231,58 @@ usb-pid=2c17 + usb-vid=3f0 + wifi-config=0 + ++[hp_laserjet_cp_1025nw] ++align-type=0 ++clean-type=0 ++color-cal-type=0 ++copy-type=0 ++embedded-server-type=1 ++fax-type=0 ++fw-download=False ++icon=hp_color_laserjet_cp2025.png ++io-mfp-mode=1 ++io-mode=1 ++io-support=14 ++job-storage=0 ++linefeed-cal-type=0 ++model1=HP LaserJet Pro CP 1025nw Color Printer Series ++monitor-type=0 ++panel-check-type=0 ++pcard-type=0 ++plugin=1 ++plugin-reason=1 ++power-settings=0 ++pq-diag-type=0 ++r-type=0 ++r0-agent1-kind=4 ++r0-agent1-sku=CE310A ++r0-agent1-type=1 ++r0-agent2-kind=4 ++r0-agent2-sku=CE311A ++r0-agent2-type=4 ++r0-agent3-kind=4 ++r0-agent3-sku=CE313A ++r0-agent3-type=5 ++r0-agent4-kind=4 ++r0-agent4-sku=CE312A ++r0-agent4-type=6 ++scan-src=0 ++scan-type=0 ++status-battery-check=0 ++status-dynamic-counters=0 ++status-type=8 ++support-released=True ++support-subtype=219b2b ++support-type=2 ++support-ver=3.12.4 ++tech-class=LJZjsColor ++family-class=LJ-Class4 ++tech-subclass=Advanced ++tech-type=4 ++usb-pid=112a ++usb-vid=3f0 ++wifi-config=3 ++ + [hp_laserjet_cp1025nw] + align-type=0 + clean-type=0 +@@ -18468,6 +18884,49 @@ usb-pid=3011 + usb-vid=3f0 + wifi-config=0 + ++[hp_laserjet_professional_p1102w] ++align-type=0 ++clean-type=0 ++color-cal-type=0 ++copy-type=0 ++embedded-server-type=0 ++fax-type=0 ++fw-download=False ++icon=HP_LaserJet_1012.png ++io-mfp-mode=6 ++io-mode=1 ++io-support=10 ++job-storage=0 ++linefeed-cal-type=0 ++model1=HP LaserJet Professional P1102w Printer ++monitor-type=0 ++panel-check-type=0 ++pcard-type=0 ++plugin=1 ++plugin-reason=1 ++power-settings=0 ++pq-diag-type=0 ++r-type=0 ++r0-agent1-kind=4 ++r0-agent1-sku=85A ++r0-agent1-type=1 ++scan-src=0 ++scan-type=0 ++status-battery-check=0 ++status-dynamic-counters=0 ++status-type=8 ++support-released=True ++support-subtype=219b2b ++support-type=2 ++support-ver=3.10.4 ++tech-class=LJZjsMono ++family-class=LJ-Class4 ++tech-subclass=NoAutoDuplex ++tech-type=3 ++usb-pid=32a ++usb-vid=3f0 ++wifi-config=3 ++ + [hp_laserjet_professional_p1102] + align-type=0 + clean-type=0 +diff -up hplip-3.22.2/Makefile.in.missing-drivers hplip-3.22.2/Makefile.in +--- hplip-3.22.2/Makefile.in.missing-drivers 2022-02-23 08:42:31.000000000 +0100 ++++ hplip-3.22.2/Makefile.in 2022-03-10 09:11:45.915558795 +0100 +@@ -1613,6 +1613,7 @@ am__dist_ppd_DATA_DIST = prnt/ps/hp-lase + ppd/hpcups/hp-laserjet_cm1418fnw-pcl3.ppd.gz \ + ppd/hpcups/hp-laserjet_cp1025.ppd.gz \ + ppd/hpcups/hp-laserjet_cp1025nw.ppd.gz \ ++ ppd/hpcups/hp-laserjet_cp_1025nw.ppd.gz \ + ppd/hpcups/hp-laserjet_m1005.ppd.gz \ + ppd/hpcups/hp-laserjet_m101-m106.ppd.gz \ + ppd/hpcups/hp-laserjet_m109-m112.ppd.gz \ +@@ -1729,6 +1730,7 @@ am__dist_ppd_DATA_DIST = prnt/ps/hp-lase + ppd/hpcups/hp-laserjet_professional_p1607dn.ppd.gz \ + ppd/hpcups/hp-laserjet_professional_p1608dn.ppd.gz \ + ppd/hpcups/hp-laserjet_professional_p1609dn.ppd.gz \ ++ ppd/hpcups/hp-laserjet_professional_p1102w.ppd.gz \ + ppd/hpcups/hp-laserjet_professional_p_1102w.ppd.gz \ + ppd/hpcups/hp-laserjet_tank_1020.ppd.gz \ + ppd/hpcups/hp-laserjet_tank_150x.ppd.gz \ +@@ -4090,6 +4092,7 @@ dist_unrel_DATA = + @HPLIP_CLASS_DRIVER_FALSE@ ppd/hpcups/hp-laserjet_cm1418fnw-pcl3.ppd.gz \ + @HPLIP_CLASS_DRIVER_FALSE@ ppd/hpcups/hp-laserjet_cp1025.ppd.gz \ + @HPLIP_CLASS_DRIVER_FALSE@ ppd/hpcups/hp-laserjet_cp1025nw.ppd.gz \ ++@HPLIP_CLASS_DRIVER_FALSE@ ppd/hpcups/hp-laserjet_cp_1025nw.ppd.gz \ + @HPLIP_CLASS_DRIVER_FALSE@ ppd/hpcups/hp-laserjet_m1005.ppd.gz \ + @HPLIP_CLASS_DRIVER_FALSE@ ppd/hpcups/hp-laserjet_m101-m106.ppd.gz \ + @HPLIP_CLASS_DRIVER_FALSE@ ppd/hpcups/hp-laserjet_m109-m112.ppd.gz \ +@@ -4206,6 +4209,7 @@ dist_unrel_DATA = + @HPLIP_CLASS_DRIVER_FALSE@ ppd/hpcups/hp-laserjet_professional_p1607dn.ppd.gz \ + @HPLIP_CLASS_DRIVER_FALSE@ ppd/hpcups/hp-laserjet_professional_p1608dn.ppd.gz \ + @HPLIP_CLASS_DRIVER_FALSE@ ppd/hpcups/hp-laserjet_professional_p1609dn.ppd.gz \ ++@HPLIP_CLASS_DRIVER_FALSE@ ppd/hpcups/hp-laserjet_professional_p1102w.ppd.gz \ + @HPLIP_CLASS_DRIVER_FALSE@ ppd/hpcups/hp-laserjet_professional_p_1102w.ppd.gz \ + @HPLIP_CLASS_DRIVER_FALSE@ ppd/hpcups/hp-laserjet_tank_1020.ppd.gz \ + @HPLIP_CLASS_DRIVER_FALSE@ ppd/hpcups/hp-laserjet_tank_150x.ppd.gz \ +diff -up hplip-3.22.2/prnt/drv/hpcups.drv.in.missing-drivers hplip-3.22.2/prnt/drv/hpcups.drv.in +--- hplip-3.22.2/prnt/drv/hpcups.drv.in.missing-drivers 2022-03-10 09:10:13.554065984 +0100 ++++ hplip-3.22.2/prnt/drv/hpcups.drv.in 2022-03-10 09:10:13.629066384 +0100 +@@ -22693,6 +22693,14 @@ Group "RLT/HP Real Life Technologies" + Attribute "Product" "" "(HP LaserJet Professional p1102s Printer)" + } + { ++ ModelName "HP LaserJet Professional p1102w" ++ Attribute "NickName" "" "HP LaserJet Professional p1102w, hpcups $Version, requires proprietary plugin" ++ Attribute "ShortNickName" "" "HP LaserJet Professional p1102w hpijs" ++ Attribute "1284DeviceID" "" "MFG:Hewlett-Packard;MDL:hp laserjet professional p1102w;DES:hp laserjet professional p1102w;" ++ PCFileName "hp-laserjet_professional_p1102w.ppd" ++ Attribute "Product" "" "(HP LaserJet Professional p1102w Printer)" ++ } ++ { + ModelName "HP LaserJet Professional p1106" + Attribute "NickName" "" "HP LaserJet Professional p1106, hpcups $Version" + Attribute "ShortNickName" "" "HP LJ Pro p1106 hpijs" +@@ -23126,6 +23134,14 @@ Group "RLT/HP Real Life Technologies" + PCFileName "hp-laserjet_cp1025nw.ppd" + Attribute "Product" "" "(HP LaserJet Pro cp1025nw Color Printer Series)" + } ++ { ++ ModelName "HP LaserJet Cp 1025nw" ++ Attribute "NickName" "" "HP LaserJet Cp 1025nw, hpcups $Version, requires proprietary plugin" ++ Attribute "ShortNickName" "" "HP LaserJet Cp 1025nw hpijs" ++ Attribute "1284DeviceID" "" "MFG:Hewlett-Packard;MDL:hp laserjet cp 1025nw;DES:hp laserjet cp 1025nw;" ++ PCFileName "hp-laserjet_cp_1025nw.ppd" ++ Attribute "Product" "" "(HP LaserJet Pro Cp 1025nw Color Printer Series)" ++ } + } + } // End LJZjsColor (for proprietary plugin) + diff --git a/hplip-missing-links.patch b/hplip-missing-links.patch new file mode 100644 index 0000000000000000000000000000000000000000..0deab1f32aaf48fbb054d30abd7d802e6fc0dc5a --- /dev/null +++ b/hplip-missing-links.patch @@ -0,0 +1,12 @@ +diff -up hplip-3.21.12/installer/pluginhandler.py.missing-links hplip-3.21.12/installer/pluginhandler.py +--- hplip-3.21.12/installer/pluginhandler.py.missing-links 2022-01-12 16:55:39.761934879 +0100 ++++ hplip-3.21.12/installer/pluginhandler.py 2022-01-12 17:22:33.367435334 +0100 +@@ -167,7 +167,7 @@ class PluginHandle(object): + continue + if link != "": + if not utils.check_library(link): +- self.__plugin_state = PLUGIN_FILES_CORRUPTED ++ pass + + + def __getPluginInformation(self, callback=None): diff --git a/hplip-model-mismatch.patch b/hplip-model-mismatch.patch new file mode 100644 index 0000000000000000000000000000000000000000..1dbe3c0756e894cd769e2a1d366c5d9b6f9bc86f --- /dev/null +++ b/hplip-model-mismatch.patch @@ -0,0 +1,64 @@ +diff --git a/io/hpmud/jd.c b/io/hpmud/jd.c +index 20df27a..7ed4918 100644 +--- a/io/hpmud/jd.c ++++ b/io/hpmud/jd.c +@@ -208,7 +208,22 @@ enum HPMUD_RESULT __attribute__ ((visibility ("hidden"))) jd_open(mud_device *pd + { + /* Make sure uri model matches device id model. */ + hpmud_get_uri_model(pd->uri, uri_model, sizeof(uri_model)); ++ ++ /* remove possible hp_ string */ ++ if (strncasecmp(uri_model, "HP_", 3) == 0) ++ { ++ memmove(uri_model, uri_model + 3, 127); ++ uri_model[127] = '\0'; ++ } ++ + hpmud_get_model(pd->id, model, sizeof(model)); ++ /* remove possible hp_ string */ ++ if (strncasecmp(model, "HP_", 3) == 0) ++ { ++ memmove(model, model + 3, 127); ++ model[127] = '\0'; ++ } ++ + if (strcasecmp(uri_model, model) != 0) + { + stat = HPMUD_R_INVALID_URI; /* different device plugged in */ +diff --git a/io/hpmud/model.c b/io/hpmud/model.c +index d546ec1..adb3d87 100644 +--- a/io/hpmud/model.c ++++ b/io/hpmud/model.c +@@ -407,7 +407,10 @@ static int ParseFile(char *datFile, char *model, char *attr, int attrSize, int * + char rcbuf[255]; + char section[128]; + char file[128]; +- int found=0, n; ++ int found=0; ++ size_t n; ++ ++ size_t model_len = strlen(model); + + if ((fp = fopen(datFile, "r")) == NULL) + goto bugout; +@@ -422,10 +425,17 @@ static int ParseFile(char *datFile, char *model, char *attr, int attrSize, int * + strncpy(section, rcbuf+1, sizeof(section)); /* found new section */ + n = strlen(section); + section[n-2]=0; /* remove ']' and CR */ ++ n -= 2; + if (strcasecmp(model, section) == 0 || +- (section[0] == 'h' && section[1] == 'p' && +- section[2] == '_' && +- strcasecmp(model, section + 3) == 0)) ++ (section[0] == 'h' && ++ section[1] == 'p' && ++ section[2] == '_' && ++ strcasecmp(model, section + 3) == 0) || ++ (n > model_len && ++ strncasecmp(section, model, model_len) == 0 && ++ strncasecmp(section + model_len, "_series", strlen("_series")) == 0 ++ ) ++ ) + { + /* Found model match. */ + *bytes_read = ResolveAttributes(fp, attr, attrSize); diff --git a/hplip-no-asm.patch b/hplip-no-asm.patch new file mode 100644 index 0000000000000000000000000000000000000000..1240c17da14efdf54a4a2b7867542d2baec97df2 --- /dev/null +++ b/hplip-no-asm.patch @@ -0,0 +1,36 @@ +diff -up hplip-3.9.8/ip/xfax.c.no-asm hplip-3.9.8/ip/xfax.c +--- hplip-3.9.8/ip/xfax.c.no-asm 2009-08-04 22:37:28.000000000 +0100 ++++ hplip-3.9.8/ip/xfax.c 2009-08-25 14:44:04.502202418 +0100 +@@ -1680,19 +1680,6 @@ static BOOL bits_flush_to_eol ( + & ((1u<gb_cache; \ +- \ +- asm ("extract %1,%2,%0" \ +- : "=d" (par_result) \ +- : "dI" (g->gb_cache_cnt - n_bits), "dI" (n_bits), "0" (par_result)); \ +-} +- +-#endif + + + +diff -up hplip-3.9.8/scan/sane/common.h.no-asm hplip-3.9.8/scan/sane/common.h +--- hplip-3.9.8/scan/sane/common.h.no-asm 2009-08-25 16:35:14.577203106 +0100 ++++ hplip-3.9.8/scan/sane/common.h 2009-08-25 16:35:29.948216281 +0100 +@@ -53,8 +53,6 @@ + + #define BACKEND_NAME hpaio + +-#define BREAKPOINT __asm( "int3" ) +- + #define OK 1 + #define ERROR 0 + #define MAX_LIST_SIZE 32 +diff -up hplip-3.9.8/scan/sane/hpaio.c.no-asm hplip-3.9.8/scan/sane/hpaio.c diff --git a/hplip-no-libhpmud-libm-warnings.patch b/hplip-no-libhpmud-libm-warnings.patch new file mode 100644 index 0000000000000000000000000000000000000000..160b70e0b56aee8aa78455accbb10f27526cbda2 --- /dev/null +++ b/hplip-no-libhpmud-libm-warnings.patch @@ -0,0 +1,108 @@ +diff --git a/scan/sane/escl.c b/scan/sane/escl.c +index 9fbbcaf..bc9e0b5 100644 +--- a/scan/sane/escl.c ++++ b/scan/sane/escl.c +@@ -37,18 +37,12 @@ static int bb_load(struct escl_session *ps, const char *so) + int stat=1; + + /* Load hpmud manually with symbols exported. Otherwise the plugin will not find it. */ +- if ((ps->hpmud_handle = load_library("libhpmud.so.0")) == NULL) +- { +- if ((ps->hpmud_handle = load_library("libhpmud.so.0")) == NULL) +- goto bugout; +- } ++ if ((ps->hpmud_handle = load_library("libhpmud.so.0")) == NULL) ++ goto bugout; + + /* Load math library manually with symbols exported (Ubuntu 8.04). Otherwise the plugin will not find it. */ +- if ((ps->math_handle = load_library("libm.so")) == NULL) +- { +- if ((ps->math_handle = load_library("libm.so.6")) == NULL) +- goto bugout; +- } ++ if ((ps->math_handle = load_library("libm.so.6")) == NULL) ++ goto bugout; + if ((ps->bb_handle = load_plugin_library(UTILS_SCAN_PLUGIN_LIBRARY, so)) == NULL) + { + SendScanEvent(ps->uri, EVENT_PLUGIN_FAIL); +diff --git a/scan/sane/marvell.c b/scan/sane/marvell.c +index 236f7c9..793104c 100644 +--- a/scan/sane/marvell.c ++++ b/scan/sane/marvell.c +@@ -60,18 +60,12 @@ static int bb_load(struct marvell_session *ps, const char *so) + int stat=1; + + /* Load hpmud manually with symbols exported. Otherwise the plugin will not find it. */ +- if ((ps->hpmud_handle = load_library("libhpmud.so")) == NULL) +- { +- if ((ps->hpmud_handle = load_library("libhpmud.so.0")) == NULL) +- goto bugout; +- } ++ if ((ps->hpmud_handle = load_library("libhpmud.so.0")) == NULL) ++ goto bugout; + + /* Load math library manually with symbols exported (Ubuntu 8.04). Otherwise the plugin will not find it. */ +- if ((ps->math_handle = load_library("libm.so")) == NULL) +- { +- if ((ps->math_handle = load_library("libm.so.6")) == NULL) +- goto bugout; +- } ++ if ((ps->math_handle = load_library("libm.so.6")) == NULL) ++ goto bugout; + + if ((ps->bb_handle = load_plugin_library(UTILS_SCAN_PLUGIN_LIBRARY, so)) == NULL) + { +diff --git a/scan/sane/soap.c b/scan/sane/soap.c +index 0d22e52..dcd8c7c 100644 +--- a/scan/sane/soap.c ++++ b/scan/sane/soap.c +@@ -68,18 +68,12 @@ static int bb_load(struct soap_session *ps, const char *so) + int stat=1; + + /* Load hpmud manually with symbols exported. Otherwise the plugin will not find it. */ +- if ((ps->hpmud_handle = load_library("libhpmud.so")) == NULL) +- { +- if ((ps->hpmud_handle = load_library("libhpmud.so.0")) == NULL) +- goto bugout; +- } ++ if ((ps->hpmud_handle = load_library("libhpmud.so.0")) == NULL) ++ goto bugout; + + /* Load math library manually with symbols exported (Ubuntu 8.04). Otherwise the plugin will not find it. */ +- if ((ps->math_handle = load_library("libm.so")) == NULL) +- { +- if ((ps->math_handle = load_library("libm.so.6")) == NULL) +- goto bugout; +- } ++ if ((ps->math_handle = load_library("libm.so.6")) == NULL) ++ goto bugout; + + if ((ps->bb_handle = load_plugin_library(UTILS_SCAN_PLUGIN_LIBRARY, so)) == NULL) + { +diff --git a/scan/sane/soapht.c b/scan/sane/soapht.c +index 139100d..74e8391 100644 +--- a/scan/sane/soapht.c ++++ b/scan/sane/soapht.c +@@ -62,18 +62,12 @@ static int bb_load(struct soap_session *ps, const char *so) + int stat=1; + + /* Load hpmud manually with symbols exported. Otherwise the plugin will not find it. */ +- if ((ps->hpmud_handle = load_library("libhpmud.so.0")) == NULL) +- { +- if ((ps->hpmud_handle = load_library("libhpmud.so.0")) == NULL) +- goto bugout; +- } ++ if ((ps->hpmud_handle = load_library("libhpmud.so.0")) == NULL) ++ goto bugout; + + /* Load math library manually with symbols exported (Ubuntu 8.04). Otherwise the plugin will not find it. */ +- if ((ps->math_handle = load_library("libm.so")) == NULL) +- { +- if ((ps->math_handle = load_library("libm.so.6")) == NULL) +- goto bugout; +- } ++ if ((ps->math_handle = load_library("libm.so.6")) == NULL) ++ goto bugout; + + if ((ps->bb_handle = load_plugin_library(UTILS_SCAN_PLUGIN_LIBRARY, so)) == NULL) + { diff --git a/hplip-pcardext-disable.patch b/hplip-pcardext-disable.patch new file mode 100644 index 0000000000000000000000000000000000000000..adcac1d8a5b407aa76da844206b65a1823e6c91a --- /dev/null +++ b/hplip-pcardext-disable.patch @@ -0,0 +1,34 @@ +The pcardext Python extension cannot be loaded because it has not been +ported to Python 3: + +>>> import pcardext +Traceback (most recent call last): + File "", line 1, in +ImportError: /usr/lib64/python3.11/site-packages/pcardext.so: undefined symbol: PyString_AsStringAndSize +>>> + +Stop building this extension because it breaks the build if the +compiler lacks support for implicit function declarations. + +Bug: + +Submitted upstream: + +diff --git a/Makefile.am b/Makefile.am +index ddac16a9dd514008..15d953af9150c09e 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -306,13 +306,6 @@ if !HPLIP_CLASS_DRIVER + pcarddir = $(hplipdir)/pcard + dist_pcard_DATA = pcard/__init__.py pcard/photocard.py + +-# pcardext +-pcardextdir = $(pyexecdir) +-pcardext_LTLIBRARIES = pcardext.la +-pcardext_la_LDFLAGS = -module -avoid-version +-pcardext_la_SOURCES = pcard/pcardext/pcardext.c pcard/fat.c pcard/pcardext/pcardext.h +-pcardext_la_CFLAGS = -I$(PYTHONINCLUDEDIR) +- + # prnt + prntdir = $(hplipdir)/prnt + dist_prnt_DATA = prnt/cups.py prnt/__init__.py prnt/ldl.py prnt/pcl.py prnt/colorcal.py diff --git a/hplip-plugin-curl.patch b/hplip-plugin-curl.patch new file mode 100644 index 0000000000000000000000000000000000000000..023e52881205e17aa84ff9428df77f23bf5b3bd9 --- /dev/null +++ b/hplip-plugin-curl.patch @@ -0,0 +1,58 @@ +diff --git a/installer/pluginhandler.py b/installer/pluginhandler.py +index 56683fb..031ceec 100755 +--- a/installer/pluginhandler.py ++++ b/installer/pluginhandler.py +@@ -185,14 +185,16 @@ class PluginHandle(object): + if self.__plugin_conf_file.startswith('file://'): + status, filename = utils.download_from_network(self.__plugin_conf_file, local_conf, True) + else: +- wget = utils.which("wget", True) +- if wget: +- status, output = utils.run("%s --tries=3 --timeout=60 --output-document=%s %s --cache=off" %(wget, local_conf, self.__plugin_conf_file)) ++ curl = utils.which("curl", True) ++ if curl: ++ cmd = "%s --retry 3 --max-time 10 --output %s --location %s" %(curl, local_conf, self.__plugin_conf_file) ++ log.debug(cmd) ++ status, output = utils.run(cmd) + if status: + log.error("Plugin download failed with error code = %d" %status) + return status, url, check_sum + else: +- log.error("Please install wget package to download the plugin.") ++ log.error("Please install curl package to download the plugin.") + return status, url, check_sum + except IOError as e: + log.error("I/O Error: %s" % e.strerror) +@@ -284,18 +284,18 @@ class PluginHandle(object): + if src.startswith('file://'): + status, filename = utils.download_from_network(src, plugin_file, True) + else: +- wget = utils.which("wget", True) +- if wget: +- cmd = "%s --cache=off -P %s %s" % (wget,self.__plugin_path,src) ++ curl = utils.which("curl", True) ++ if curl: ++ cmd = "%s --create-dirs -O --output-dir %s %s" % (curl,self.__plugin_path,src) + log.debug(cmd) + status, output = utils.run(cmd) +- log.debug("wget returned: %d" % status) ++ log.debug("curl returned: %d" % status) + + #Check whether plugin is accessible in Openprinting.org website otherwise dowload plugin from alternate location. + if status != 0 or os_utils.getFileSize(plugin_file) <= 0: + src = os.path.join(PLUGIN_FALLBACK_LOCATION, self.__plugin_name) + log.info("Plugin is not accessible. Trying to download it from fallback location: [%s]" % src) +- cmd = "%s --cache=off -P %s %s" % (wget,self.__plugin_path,src) ++ cmd = "%s --create-dirs -O --output-dir %s %s" % (curl,self.__plugin_path,src) + log.debug(cmd) + status, output = utils.run(cmd) + +@@ -323,7 +323,7 @@ class PluginHandle(object): + if digsig_url.startswith('file://'): + status, filename = utils.download_from_network(digsig_url, digsig_file, True) + else: +- cmd = "%s --cache=off -P %s %s" % (wget,self.__plugin_path,digsig_url) ++ cmd = "%s --create-dirs -O --output-dir %s %s" % (curl, self.__plugin_path,digsig_url) + log.debug(cmd) + status, output = utils.run(cmd) + except IOError as e: diff --git a/hplip-plugin-script.patch b/hplip-plugin-script.patch new file mode 100644 index 0000000000000000000000000000000000000000..9b3c1962146c3fa759ab7400047ed99933968b5c --- /dev/null +++ b/hplip-plugin-script.patch @@ -0,0 +1,28 @@ +diff --git a/Makefile.am b/Makefile.am +index bb4195c..ddac16a 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -680,6 +680,12 @@ if HPLIP_CLASS_DRIVER + filterdir=$(cupsfilterdir) + printpluginsdir=$(cupsfilterdir) + ++# ++# HP Plugin ++# ++ ++pkgplugindir=$(bindir) ++pkgplugin_DATA=hp-plugin + + dist_filter_DATA = hpcups hpps dat2drv + dist_printplugins_DATA = prnt/plugins/hbpl1-arm32.so prnt/plugins/hbpl1-arm64.so prnt/plugins/hbpl1-x86_32.so prnt/plugins/hbpl1-x86_64.so prnt/plugins/lj-arm32.so prnt/plugins/lj-arm64.so prnt/plugins/lj-x86_32.so prnt/plugins/lj-x86_64.so +diff --git a/configure.in b/configure.in +index f8f1a28..7fa5d12 100644 +--- a/configure.in ++++ b/configure.in +@@ -801,5 +801,5 @@ AC_SUBST(udev_sysfs_rules) + AC_SUBST(epm_class_driver) + AC_SUBST(epm_class_install) + +-AC_CONFIG_FILES(Makefile hplip.conf hplip.desktop hp-uiscan.desktop hplip-systray.desktop prnt/drv/hpijs.drv prnt/drv/hpcups.drv hplip.list data/policykit/com.hp.hplip.service) ++AC_CONFIG_FILES(Makefile hplip.conf hplip.desktop hp-uiscan.desktop hplip-systray.desktop prnt/drv/hpijs.drv prnt/drv/hpcups.drv hplip.list data/policykit/com.hp.hplip.service hp-plugin) + AC_OUTPUT diff --git a/hplip-plugin-udevissues.patch b/hplip-plugin-udevissues.patch new file mode 100644 index 0000000000000000000000000000000000000000..3a35c6b021b7f134edccda0ec9ffe50ae8bc0e2a --- /dev/null +++ b/hplip-plugin-udevissues.patch @@ -0,0 +1,26 @@ +diff --git a/installer/pluginhandler.py b/installer/pluginhandler.py +index 1af8d85..5c498ab 100755 +--- a/installer/pluginhandler.py ++++ b/installer/pluginhandler.py +@@ -403,7 +403,20 @@ class PluginHandle(object): + log.error("Target file %s does not exist. File copy failed." % trg) + continue + else: +- os.chmod(trg, stat.S_IRWXU | stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH) ++ if trg == '/etc/udev/rules.d/S99-2000S1.rules' or \ ++ trg == '/etc/udev/rules.d/40-libsane.rules': ++ os.chmod(trg, 0o644) ++ with open(trg, 'r') as udev_f: ++ content = udev_f.read() ++ ++ content = content.replace('libsane_rules_end', 'libsane_usb_rules_end') ++ content = content.replace('GROUP="scanner", ', '') ++ ++ with open(trg, 'w') as udev_f: ++ udev_f.write(content) ++ ++ else: ++ os.chmod(trg, stat.S_IRWXU | stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH) + + if link: + if os.path.exists(link): diff --git a/hplip-pserror-c99.patch b/hplip-pserror-c99.patch new file mode 100644 index 0000000000000000000000000000000000000000..747af3abfe8cee23f7e888c99e7d033930793b83 --- /dev/null +++ b/hplip-pserror-c99.patch @@ -0,0 +1,17 @@ +prnt/pserror.c: Replace an implicit int with an explicit int + +Submitted upstream: + +diff --git a/prnt/hpps/pserror.c b/prnt/hpps/pserror.c +index 114d7e1b5fa364fb..493b49c27917a7e6 100644 +--- a/prnt/hpps/pserror.c ++++ b/prnt/hpps/pserror.c +@@ -24,7 +24,7 @@ extern char *program ; /* Defined by main program, giving program name */ + void message(int flags, char *format, ...) + { + va_list args ; +- static column = 0 ; /* current screen column for message wrap */ ++ static int column = 0 ; /* current screen column for message wrap */ + char msgbuf[MAX_MESSAGE] ; /* buffer in which to put the message */ + char *bufptr = msgbuf ; /* message buffer pointer */ + diff --git a/hplip-repack.sh b/hplip-repack.sh new file mode 100644 index 0000000000000000000000000000000000000000..a67e7eea98712a81cfc105ecafe008669df07b01 --- /dev/null +++ b/hplip-repack.sh @@ -0,0 +1,32 @@ +#!/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 - license-related ones reported here https://bugs.launchpad.net/hplip/+bug/2028938 +rm hplip-$VERSION/locatedriver + +# compress into a new tarball +tar -cjvf hplip-$VERSION-repack.tar.gz hplip-$VERSION || exit 1 + +# check whether plugin is available +wget -O hplip-plugin.run https://www.openprinting.org/download/printdriver/auxfiles/HP/plugins/hplip-$1-plugin.run || wget -O hplip-plugin.run https://developers.hp.com/sites/default/files/hplip-$1-plugin.run || exit 1 + +# check whether the file is sane +file --mime hplip-plugin.run | grep 'x-shellscript' || exit 1 + +echo "hplip-${VERSION}-repack.tar.gz is prepared for uploading..." + +exit 0 + +# upload a new source tarball +#fedpkg new-sources hplip-$VERSION-repack.tar.gz || exit 1 diff --git a/hplip-revert-plugins.patch b/hplip-revert-plugins.patch new file mode 100644 index 0000000000000000000000000000000000000000..823fb14defde686ccfaaade554b92835b3a4ee91 --- /dev/null +++ b/hplip-revert-plugins.patch @@ -0,0 +1,1178 @@ +diff -up hplip-3.20.9/data/models/models.dat.revert-plugins hplip-3.20.9/data/models/models.dat +--- hplip-3.20.9/data/models/models.dat.revert-plugins 2020-10-02 07:44:26.873416731 +0200 ++++ hplip-3.20.9/data/models/models.dat 2020-10-02 08:49:32.418280169 +0200 +@@ -2123,7 +2123,7 @@ ppd-name=hp-laserjet_100_color_mfp_m175- + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=64 + power-settings=0 + pq-diag-type=0 +@@ -3373,7 +3373,7 @@ model1=HP LaserJet Pro MFP M125r + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=65 + power-settings=0 + pq-diag-type=0 +@@ -3416,7 +3416,7 @@ model1=HP LaserJet Pro MFP M125s + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=65 + power-settings=0 + pq-diag-type=0 +@@ -3459,7 +3459,7 @@ model1=HP LaserJet Pro MFP M125a + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=65 + power-settings=0 + pq-diag-type=0 +@@ -3502,7 +3502,7 @@ model1=HP LaserJet Pro MFP M125nw + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=65 + power-settings=0 + pq-diag-type=0 +@@ -3545,7 +3545,7 @@ model1=HP LaserJet Pro MFP M125rnw + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=65 + power-settings=0 + pq-diag-type=0 +@@ -3588,7 +3588,7 @@ model1=HP LaserJet Pro MFP M125nr + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=65 + power-settings=0 + pq-diag-type=0 +@@ -3631,7 +3631,7 @@ model1=HP LaserJet Pro MFP M126a + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=65 + power-settings=0 + pq-diag-type=0 +@@ -3674,7 +3674,7 @@ model1=HP LaserJet Pro MFP M126nw + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=65 + power-settings=0 + pq-diag-type=0 +@@ -3717,7 +3717,7 @@ model1=HP LaserJet Pro MFP M127fp + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=65 + power-settings=0 + pq-diag-type=0 +@@ -3760,7 +3760,7 @@ model1=HP LaserJet Pro MFP M127fn + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=65 + power-settings=0 + pq-diag-type=0 +@@ -3846,7 +3846,7 @@ model1=HP LaserJet Pro MFP M128fn + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=65 + power-settings=0 + pq-diag-type=0 +@@ -3889,7 +3889,7 @@ model1=HP LaserJet Pro MFP M128fp + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=65 + power-settings=0 + pq-diag-type=0 +@@ -3932,7 +3932,7 @@ model1=HP LaserJet Pro MFP M128fw + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=65 + power-settings=0 + pq-diag-type=0 +@@ -4225,7 +4225,7 @@ model1=HP Color LaserJet Pro MPF M177fw + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=65 + power-settings=0 + pq-diag-type=0 +@@ -4277,8 +4277,8 @@ model1=HP LaserJet Pro 200 color MFP M27 + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-laserjet_200_colormfp_m276-ps.ppd + family-ppd=hp-postscript-laserjet-pro.ppd +@@ -4331,8 +4331,8 @@ model1=HP LaserJet 200 Color MFP M275s + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-laserjet_200_colormfp_m275-ps.ppd + family-ppd=hp-postscript-laserjet-pro.ppd +@@ -4385,8 +4385,8 @@ model1=HP LaserJet 200 Color MFP M275u + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-laserjet_200_colormfp_m275-ps.ppd + family-ppd=hp-postscript-laserjet-pro.ppd +@@ -4439,8 +4439,8 @@ model1=HP LaserJet 200 Color MFP M275t + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-laserjet_200_colormfp_m275-ps.ppd + family-ppd=hp-postscript-laserjet-pro.ppd +@@ -4492,8 +4492,8 @@ linefeed-cal-type=0 + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-laserjet_200_colormfp_m276-ps.ppd + family-ppd=hp-postscript-laserjet-pro.ppd +@@ -4545,8 +4545,8 @@ linefeed-cal-type=0 + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-laserjet_200_colormfp_m276-ps.ppd + family-ppd=hp-postscript-laserjet-pro.ppd +@@ -4598,8 +4598,8 @@ linefeed-cal-type=0 + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-laserjet_200_colormfp_m276-ps.ppd + family-ppd=hp-postscript-laserjet-pro.ppd +@@ -4652,8 +4652,8 @@ model1=HP LaserJet Pro 200 color MFP M27 + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-laserjet_200_colormfp_m276-ps.ppd + family-ppd=hp-postscript-laserjet-pro.ppd +@@ -4705,8 +4705,8 @@ linefeed-cal-type=0 + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-laserjet_200_colormfp_m276-ps.ppd + family-ppd=hp-postscript-laserjet-pro.ppd +@@ -4758,8 +4758,8 @@ linefeed-cal-type=0 + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-laserjet_200_colormfp_m276-ps.ppd + family-ppd=hp-postscript-laserjet-pro.ppd +@@ -4811,8 +4811,8 @@ linefeed-cal-type=0 + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-laserjet_200_colormfp_m276-ps.ppd + family-ppd=hp-postscript-laserjet-pro.ppd +@@ -4864,8 +4864,8 @@ linefeed-cal-type=0 + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-laserjet_200_colormfp_m276-ps.ppd + family-ppd=hp-postscript-laserjet-pro.ppd +@@ -4917,8 +4917,8 @@ linefeed-cal-type=0 + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-laserjet_200_colormfp_m276-ps.ppd + family-ppd=hp-postscript-laserjet-pro.ppd +@@ -4970,8 +4970,8 @@ linefeed-cal-type=0 + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-laserjet_200_colormfp_m276-ps.ppd + family-ppd=hp-postscript-laserjet-pro.ppd +@@ -5023,8 +5023,8 @@ linefeed-cal-type=0 + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-laserjet_200_colormfp_m276-ps.ppd + family-ppd=hp-postscript-laserjet-pro.ppd +@@ -5077,8 +5077,8 @@ model1=HP LaserJet 200 Color MFP M275nw + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-laserjet_200_colormfp_m275-ps.ppd + family-ppd=hp-postscript-laserjet-pro.ppd +@@ -6214,7 +6214,7 @@ model1=HP LaserJet Pro MFP M225rdn + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=2112 + power-settings=0 + ppd-name=hp-laserjet_pro_mfp_m225_m226-ps.ppd +@@ -6257,7 +6257,7 @@ model1=HP LaserJet Pro MFP M225dw + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=2112 + power-settings=0 + ppd-name=hp-laserjet_pro_mfp_m225_m226-ps.ppd +@@ -6298,7 +6298,7 @@ model1=HP LaserJet Pro MFP M225dn + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=2112 + power-settings=0 + ppd-name=hp-laserjet_pro_mfp_m225_m226-ps.ppd +@@ -6339,7 +6339,7 @@ model1=HP LaserJet Pro MFP M226dw + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=2112 + power-settings=0 + ppd-name=hp-laserjet_pro_mfp_m225_m226-ps.ppd +@@ -6381,7 +6381,7 @@ model1=HP LaserJet Pro MFP M226dn + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=2112 + power-settings=0 + ppd-name=hp-laserjet_pro_mfp_m225_m226-ps.ppd +@@ -6830,8 +6830,8 @@ model1=HP LaserJet 300 Color MFP M375nw + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-lj_300_400_color_mfp_m375_m475-ps.ppd + family-ppd=hp-postscript-laserjet-pro.ppd +@@ -8227,8 +8227,8 @@ model1=HP LaserJet 400 Color MFP M475dw + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-lj_300_400_color_mfp_m375_m475-ps.ppd + family-ppd=hp-postscript-laserjet-pro.ppd +@@ -8371,8 +8371,8 @@ model1=HP LaserJet 400 MFP M425dw + monitor-type=1 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-laserjet_400_mfp_m425-ps.ppd + family-ppd=hp-postscript-laserjet-pro.ppd +@@ -8416,8 +8416,8 @@ model1=HP Laserjet 400 MFP M425dn + monitor-type=1 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-laserjet_400_mfp_m425-ps.ppd + family-ppd=hp-postscript-laserjet-pro.ppd +@@ -8804,8 +8804,8 @@ model1=HP LaserJet 400 Color MFP M475dn + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-lj_300_400_color_mfp_m375_m475-ps.ppd + family-ppd=hp-postscript-laserjet-pro.ppd +@@ -9115,8 +9115,8 @@ model1=HP LaserJet Pro MFP M435nw + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + pq-diag-type=0 + r-type=0 +@@ -9738,8 +9738,8 @@ model1=HP Color Laserjet Pro MFP M476dw + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-color_laserjet_pro_mfp_m476-ps.ppd + family-ppd=hp-postscript-laserjet-pro.ppd +@@ -9780,8 +9780,8 @@ model1=HP Color Laserjet Pro MFP M476nw + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-color_laserjet_pro_mfp_m476-ps.ppd + family-ppd=hp-postscript-laserjet-pro.ppd +@@ -9822,8 +9822,8 @@ model1=HP Color Laserjet Pro MFP M476dn + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-color_laserjet_pro_mfp_m476-ps.ppd + family-ppd=hp-postscript-laserjet-pro.ppd +@@ -10118,8 +10118,8 @@ model1=HP LaserJet Pro 500 color MFP M57 + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-laserjet_500_color_mfp_m570-ps.ppd + family-ppd=hp-postscript-laserjet-pro.ppd +@@ -10172,8 +10172,8 @@ model1=HP LaserJet Pro 500 color MFP M57 + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-laserjet_500_color_mfp_m570-ps.ppd + family-ppd=hp-postscript-laserjet-pro.ppd +@@ -10747,8 +10747,8 @@ model1=HP LaserJet Pro M521dn Multifunct + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-laserjet_mfp_m521-ps.ppd + family-ppd=hp-postscript-laserjet.ppd +@@ -10792,8 +10792,8 @@ model1=HP LaserJet Pro M521dw Multifunct + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-laserjet_mfp_m521-ps.ppd + family-ppd=hp-postscript-laserjet.ppd +@@ -18353,7 +18353,7 @@ model1=HP LaserJet Pro CP1025 Color Prin + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=1 + power-settings=0 + pq-diag-type=0 +@@ -18989,7 +18989,7 @@ model1=HP LaserJet Professional P 1102w + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=1 + power-settings=0 + pq-diag-type=0 +@@ -19032,7 +19032,7 @@ model1=HP Laserjet Professional P1106w P + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=1 + power-settings=0 + pq-diag-type=0 +@@ -19075,7 +19075,7 @@ model1=HP Laserjet Professional P1106 Pr + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=1 + power-settings=0 + pq-diag-type=0 +@@ -19118,7 +19118,7 @@ model1=HP LaserJet Professional P1107 Pr + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=1 + power-settings=0 + pq-diag-type=0 +@@ -19161,7 +19161,7 @@ model1=HP LaserJet Professional P1107w P + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=1 + power-settings=0 + pq-diag-type=0 +@@ -19204,7 +19204,7 @@ model1=HP Laserjet Professional P1108w P + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=1 + power-settings=0 + pq-diag-type=0 +@@ -19247,7 +19247,7 @@ model1=HP Laserjet Professional P1108 Pr + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=1 + power-settings=0 + pq-diag-type=0 +@@ -19290,7 +19290,7 @@ model1=HP LaserJet Professional P1109w P + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=1 + power-settings=0 + pq-diag-type=0 +@@ -19333,7 +19333,7 @@ model1=HP LaserJet Professional P1109 Pr + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=1 + power-settings=0 + pq-diag-type=0 +@@ -19683,7 +19683,7 @@ model2=HP LaserJet Professional M1132s M + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=65 + power-settings=0 + pq-diag-type=0 +@@ -19726,7 +19726,7 @@ model1=HP Laserjet Professional M1136 Mu + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=65 + power-settings=0 + pq-diag-type=0 +@@ -19769,7 +19769,7 @@ model1=HP LaserJet Professional M1137 Mu + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=65 + power-settings=0 + pq-diag-type=0 +@@ -19812,7 +19812,7 @@ model1=HP LaserJet Professional M1138 Mu + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=65 + power-settings=0 + pq-diag-type=0 +@@ -19855,7 +19855,7 @@ model1=HP LaserJet Professional M1139 Mu + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=65 + power-settings=0 + pq-diag-type=0 +@@ -20447,7 +20447,7 @@ model1=HP LaserJet Professional M1212nf + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=65 + power-settings=0 + pq-diag-type=0 +@@ -20490,7 +20490,7 @@ model1=HP LaserJet Professional M1213nf + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=65 + power-settings=0 + pq-diag-type=0 +@@ -20533,7 +20533,7 @@ model1=HP LaserJet Professional M1214nfh + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=65 + power-settings=0 + pq-diag-type=0 +@@ -20675,7 +20675,7 @@ model1=HP LaserJet Professional M1216nfh + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=65 + power-settings=0 + pq-diag-type=0 +@@ -20718,7 +20718,7 @@ model1=HP Color LaserJet CP1217 Printer + monitor-type=0 + panel-check-type=1 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=1 + power-settings=0 + pq-diag-type=0 +@@ -20813,7 +20813,7 @@ model1=HP Laserjet M1210 MFP Series + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=65 + power-settings=0 + pq-diag-type=0 +@@ -20903,7 +20903,7 @@ model1=HP HotSpot LaserJet Pro M1218nfs + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=65 + power-settings=0 + pq-diag-type=0 +@@ -20945,7 +20945,7 @@ linefeed-cal-type=0 + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=65 + power-settings=0 + pq-diag-type=0 +@@ -20987,7 +20987,7 @@ linefeed-cal-type=0 + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=65 + power-settings=0 + pq-diag-type=0 +@@ -21030,7 +21030,7 @@ model1=HP LaserJet Professional M1219nf + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=65 + power-settings=0 + pq-diag-type=0 +@@ -22320,8 +22320,8 @@ model1=HP LaserJet Professional CM1411fn + monitor-type=0 + panel-check-type=1 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-laserjet_cm1410_series-ps.ppd + pq-diag-type=0 +@@ -22373,8 +22373,8 @@ model1=HP LaserJet Professional CM1412fn + monitor-type=0 + panel-check-type=1 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-laserjet_cm1410_series-ps.ppd + pq-diag-type=0 +@@ -22426,8 +22426,8 @@ model1=HP LaserJet Professional CM1413fn + monitor-type=0 + panel-check-type=1 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-laserjet_cm1410_series-ps.ppd + pq-diag-type=0 +@@ -22479,8 +22479,8 @@ model1=HP LaserJet Professional CM1415fn + monitor-type=0 + panel-check-type=1 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-laserjet_cm1410_series-ps.ppd + pq-diag-type=0 +@@ -22532,8 +22532,8 @@ model1=HP LaserJet Professional CM1415fn + monitor-type=0 + panel-check-type=1 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-laserjet_cm1410_series-ps.ppd + pq-diag-type=0 +@@ -22585,8 +22585,8 @@ model1=HP LaserJet Professional CM1416fn + monitor-type=0 + panel-check-type=1 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-laserjet_cm1410_series-ps.ppd + pq-diag-type=0 +@@ -22638,8 +22638,8 @@ model1=HP LaserJet Professional CM1417fn + monitor-type=0 + panel-check-type=1 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-laserjet_cm1410_series-ps.ppd + pq-diag-type=0 +@@ -22691,8 +22691,8 @@ model1=HP LaserJet Professional CM1418fn + monitor-type=0 + panel-check-type=1 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-laserjet_cm1410_series-ps.ppd + pq-diag-type=0 +@@ -23889,8 +23889,8 @@ model1=HP LaserJet M1536dnf MFP + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-laserjet_m1530_mfp_series-ps.ppd + family-ppd=hp-postscript-laserjet.ppd +@@ -23934,8 +23934,8 @@ model1=HP LaserJet M1537dnf MFP + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-laserjet_m1530_mfp_series-ps.ppd + pq-diag-type=0 +@@ -23978,8 +23978,8 @@ model1=HP LaserJet M1538dnf MFP + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-laserjet_m1530_mfp_series-ps.ppd + pq-diag-type=0 +@@ -24022,8 +24022,8 @@ model1=HP LaserJet M1539dnf MFP + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-laserjet_m1530_mfp_series-ps.ppd + pq-diag-type=0 +@@ -24109,7 +24109,7 @@ model1=HP LaserJet Professional P1567 + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=1 + power-settings=0 + pq-diag-type=0 +@@ -24152,7 +24152,7 @@ model1=HP LaserJet Professional P1568 + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=1 + power-settings=0 + pq-diag-type=0 +@@ -24195,7 +24195,7 @@ model1=HP LaserJet Professional P1569 + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=1 + power-settings=0 + pq-diag-type=0 +@@ -24631,7 +24631,7 @@ model1=HP LaserJet Professional P1606dn + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=1 + power-settings=0 + pq-diag-type=0 +@@ -24674,7 +24674,7 @@ model1=HP LaserJet Professional P1607dn + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=1 + power-settings=0 + pq-diag-type=0 +@@ -24717,7 +24717,7 @@ model1=HP LaserJet Professional P1608dn + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=1 + power-settings=0 + pq-diag-type=0 +@@ -24760,7 +24760,7 @@ model1=HP LaserJet Professional P1609dn + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=1 + power-settings=0 + pq-diag-type=0 +@@ -29946,8 +29946,8 @@ ppd-name=hp-color_laserjet_2800-ps.ppd + monitor-type=0 + panel-check-type=1 + pcard-type=2 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + pq-diag-type=0 + r-type=0 +@@ -30068,8 +30068,8 @@ ppd-name=hp-color_laserjet_2820-ps.ppd + monitor-type=0 + panel-check-type=1 + pcard-type=2 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + pq-diag-type=0 + r-type=0 +@@ -53138,8 +53138,8 @@ model1=HP Color LaserJet MFP M277n + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-color_laserjet_mfp_m277 + family-ppd=hp-postscript-laserjet-pro.ppd +@@ -53192,8 +53192,8 @@ model1=HP Color LaserJet MFP M277dw + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-color_laserjet_pro_mfp_m277 + family-ppd=hp-postscript-laserjet-pro.ppd +@@ -53933,8 +53933,8 @@ model1=HP Color LaserJet Pro MFP M274n + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-color_laserjet_mfp_m274-ps.ppd + family-ppd=hp-postscript-laserjet-pro.ppd +@@ -54716,8 +54716,8 @@ model1=HP Laserjet Pro MFP M426fdn + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=laserjet_mfp_m426_m427 + family-ppd=hp-postscript-laserjet-pro.ppd +@@ -54761,8 +54761,8 @@ model1=HP Laserjet Pro MFP M426fdw + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=laserjet_mfp_m426_m427 + family-ppd=hp-postscript-laserjet-pro.ppd +@@ -54806,8 +54806,8 @@ model1=HP Laserjet Pro MFP M427dn + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=laserjet_mfp_m426_m427 + family-ppd=hp-postscript-laserjet-pro.ppd +@@ -54851,8 +54851,8 @@ model1=HP Laserjet Pro MFP M427fdw + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=laserjet_mfp_m426_m427 + family-ppd=hp-postscript-laserjet-pro.ppd +@@ -54896,8 +54896,8 @@ model1=HP Laserjet Pro MFP M426dw + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=laserjet_mfp_m426_m427 + family-ppd=hp-postscript-laserjet-pro.ppd +@@ -54941,8 +54941,8 @@ model1=HP Laserjet Pro MFP M427dw + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-laserjet_mfp_m426_m427-ps.ppd + family-ppd=hp-postscript-laserjet-pro.ppd +@@ -55271,8 +55271,8 @@ model1=HP Color Laserjet Pro MFP M477 fn + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-color_laserjet_pro_mfp_m477-ps.ppd + family-ppd=hp-postscript-laserjet-pro.ppd +@@ -55313,8 +55313,8 @@ model1=HP Color Laserjet Pro MFP M477 fd + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=color_laserjet_pro_mfp_m477d + family-ppd=hp-postscript-laserjet-pro.ppd +@@ -55355,8 +55355,8 @@ model1=HP Color Laserjet Pro MFP M477 fd + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-color_laserjet_pro_mfp_m477d-ps.ppd + family-ppd=hp-postscript-laserjet-pro.ppd +@@ -55437,7 +55437,7 @@ model1=HP LaserJet Pro MFP M127fs + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=65 + power-settings=0 + pq-diag-type=0 +@@ -56513,8 +56513,8 @@ model1=HP Color Laserjet MFP M377 fnw + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-color_laserjet_pro_mfp_m377-ps.ppd + family-ppd=hp-postscript-laserjet-pro.ppd +@@ -57475,8 +57475,8 @@ model1=HP Color LaserJet MFP M277c6 + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-color_laserjet_pro_mfp_m277-ps.ppd + pq-diag-type=0 +@@ -60453,7 +60453,7 @@ model1=HP LaserJet Pro MFP M26a + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=1 + power-settings=0 + pq-diag-type=0 +@@ -60493,7 +60493,7 @@ model1=HP LaserJet Pro MFP M26nw + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=1 + power-settings=0 + pq-diag-type=0 +@@ -60653,7 +60653,7 @@ model1=HP LaserJet Pro MFP M27cnw + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 ++plugin=1 + plugin-reason=1 + power-settings=0 + pq-diag-type=0 +@@ -65387,8 +65387,8 @@ model1=HP Smart Tank Plus 570 series + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + pq-diag-type=0 + r-type=0 +@@ -67470,8 +67470,8 @@ model2=HP DeskJet Ink Advantage 2700 All + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + pq-diag-type=0 + r-type=0 +@@ -67510,8 +67510,8 @@ model1=HP DeskJet Plus 4100 All-in-One P + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + pq-diag-type=0 + r-type=0 +@@ -67632,8 +67632,8 @@ model2=HP DeskJet Ink Advantage 2300 All + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + pq-diag-type=0 + r-type=0 diff --git a/hplip-scan-hpaio-include.patch b/hplip-scan-hpaio-include.patch new file mode 100644 index 0000000000000000000000000000000000000000..79d1d94b74b9c8497a3173e1e973d0a23c7b54b6 --- /dev/null +++ b/hplip-scan-hpaio-include.patch @@ -0,0 +1,19 @@ +scam/sane/hpaio.c: Include orblite.h for more function prototypes + +Otherwise the build fails with compilers which do not support +implicit function declarations. + +Submitted upstream: + +diff --git a/scan/sane/hpaio.c b/scan/sane/hpaio.c +index d342626822fc2190..57d1ddea32fb5816 100644 +--- a/scan/sane/hpaio.c ++++ b/scan/sane/hpaio.c +@@ -50,6 +50,7 @@ + #include "sclpml.h" + #include "escl.h" + #include "io.h" ++#include "orblite.h" + #include "orblitei.h" + + diff --git a/hplip-scan-orblite-c99.patch b/hplip-scan-orblite-c99.patch new file mode 100644 index 0000000000000000000000000000000000000000..c921f22f1b30d1e9f1f24b4eb56bb94f7a6b2c35 --- /dev/null +++ b/hplip-scan-orblite-c99.patch @@ -0,0 +1,21 @@ +diff --git a/scan/sane/orblite.c b/scan/sane/orblite.c +index ba86640..2eb7aba 100644 +--- a/scan/sane/orblite.c ++++ b/scan/sane/orblite.c +@@ -20,6 +20,7 @@ + #include "orblitei.h" + #include "orblite.h"//Added New + #include ++#include + #include "utils.h" + #include "io.h" + +@@ -195,7 +196,7 @@ bugout: + + static int bb_unload(SANE_THandle ps) + { +- _DBG("Calling orblite bb_unload: \n"); ++ DBG("Calling orblite bb_unload: \n"); + if (ps->bb_handle) + { + dlclose(ps->bb_handle); diff --git a/hplip-sclpml-strcasestr.patch b/hplip-sclpml-strcasestr.patch new file mode 100644 index 0000000000000000000000000000000000000000..daf86c81a7a98e71d3170e93f6c6cfe73b6a54da --- /dev/null +++ b/hplip-sclpml-strcasestr.patch @@ -0,0 +1,16 @@ +Switch the whole libsane-hpaio to get proper definition of strcasestr() used in +sclpml.c + +diff --git a/Makefile.am b/Makefile.am +index 15d953a..7105f74 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -73,7 +73,7 @@ endif + # The following is a interlibrary dependency that must be compiled first. + libsane_hpaio_la_LIBADD = libhpip.la libhpmud.la libhpipp.la $(DBUS_LIBS) -lcups -ldl + #libsane_hpaio_la_CFLAGS = -DWITH_NONAMESPACES -DSOAP_DEBUG +-libsane_hpaio_la_CFLAGS = $(DBUS_CFLAGS) -Iprotocol ++libsane_hpaio_la_CFLAGS = $(DBUS_CFLAGS) -Iprotocol -D_GNU_SOURCE + + if NETWORK_BUILD + libsane_hpaio_la_LIBADD += libhpdiscovery.la diff --git a/hplip-3165-sourceoption.patch b/hplip-sourceoption.patch similarity index 100% rename from hplip-3165-sourceoption.patch rename to hplip-sourceoption.patch diff --git a/hplip-strstr-const.patch b/hplip-strstr-const.patch new file mode 100644 index 0000000000000000000000000000000000000000..f2ac91b26afec58583d3a29fced5b2c96e81c352 --- /dev/null +++ b/hplip-strstr-const.patch @@ -0,0 +1,50 @@ +diff -up hplip-3.9.6b/prnt/hpijs/dj3320.cpp.strstr-const hplip-3.9.6b/prnt/hpijs/dj3320.cpp +--- hplip-3.9.6b/prnt/hpijs/dj3320.cpp.strstr-const 2009-06-25 21:02:29.000000000 +0100 ++++ hplip-3.9.6b/prnt/hpijs/dj3320.cpp 2009-07-27 16:14:52.868542337 +0100 +@@ -405,7 +405,7 @@ DISPLAY_STATUS DJ3320::ParseError (BYTE + { + DRIVER_ERROR err = NO_ERROR; + BYTE byDevIDBuffer[DevIDBuffSize]; +- char *pcStr = NULL; ++ const char *pcStr = NULL; + BYTE byStatus1, byStatus2; + + memset(byDevIDBuffer, 0, sizeof(byDevIDBuffer)); +diff -up hplip-3.9.6b/prnt/hpijs/registry.cpp.strstr-const hplip-3.9.6b/prnt/hpijs/registry.cpp +--- hplip-3.9.6b/prnt/hpijs/registry.cpp.strstr-const 2009-06-25 21:02:29.000000000 +0100 ++++ hplip-3.9.6b/prnt/hpijs/registry.cpp 2009-07-27 16:18:41.583417187 +0100 +@@ -290,14 +290,14 @@ DRIVER_ERROR DeviceRegistry::SelectDevic + err = pSS->GetDeviceID(DevIDBuffer, DevIDBuffSize, FALSE); + ERRCHECK; // should be either NO_ERROR or BAD_DEVICE_ID + +- char *cmdStr = (char *) strstr ((const char *) DevIDBuffer+2, "CMD:"); ++ char *cmdStr = strstr ((char *) DevIDBuffer+2, "CMD:"); + char *cmdStrEnd; + if ((strstr((const char *) DevIDBuffer+2,"CMD:LDL"))) + { + device = eDJ3320; + match = TRUE; + } +- if (!match && cmdStr && (cmdStrEnd = (char *) strstr (cmdStr, ";"))) ++ if (!match && cmdStr && (cmdStrEnd = strstr (cmdStr, ";"))) + { + *cmdStrEnd = '\0'; + if (strstr (cmdStr, "LDL")) +@@ -309,12 +309,12 @@ DRIVER_ERROR DeviceRegistry::SelectDevic + } + if (!match && !cmdStr) + { +- cmdStr = (char *) strstr ((const char *) DevIDBuffer+2, "COMMAND SET:"); ++ cmdStr = strstr ((char *) DevIDBuffer+2, "COMMAND SET:"); + } +- if (!match && cmdStr && (strstr ((const char *) cmdStr+4, "POSTSCRIPT") || +- strstr ((const char *) cmdStr+4, "PostScript") || +- strstr ((const char *) cmdStr+4, "Postscript") || +- strstr ((const char *) cmdStr+4, "postscript") )) ++ if (!match && cmdStr && (strstr (cmdStr+4, "POSTSCRIPT") || ++ strstr (cmdStr+4, "PostScript") || ++ strstr (cmdStr+4, "Postscript") || ++ strstr (cmdStr+4, "postscript") )) + { + device = ePScript; + match = TRUE; diff --git a/hplip-systray-blockerror.patch b/hplip-systray-blockerror.patch new file mode 100644 index 0000000000000000000000000000000000000000..92a8cdf1b5a51eeb78a953074dea3b224f54a5e3 --- /dev/null +++ b/hplip-systray-blockerror.patch @@ -0,0 +1,20 @@ +diff --git a/systray.py b/systray.py +index 07db0fa..3a35b30 100644 +--- a/systray.py ++++ b/systray.py +@@ -89,7 +89,14 @@ if __name__ == '__main__': + log.debug("Creating pipe: hpssd (%d) ==> systemtray (%d)" % (w1, r1)) + + parent_pid = os.getpid() +- child_pid1 = os.fork() ++ try: ++ child_pid1 = os.fork() ++ except BlockingIOErrror as e: ++ log.error("hp-systray: error during fork - %s" % e) ++ os.close(w1) ++ os.close(r1) ++ mod.unlockInstance() ++ sys.exit(1) + + if child_pid1: + # parent (UI) diff --git a/hplip-typo.patch b/hplip-typo.patch index f8a6aca82fb4e48ba680a4552e8f126f6570f715..4d9380118350cc9097fc4e2e17969884f24c49bb 100644 --- a/hplip-typo.patch +++ b/hplip-typo.patch @@ -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(): diff --git a/hplip-unicodeerror.patch b/hplip-unicodeerror.patch new file mode 100644 index 0000000000000000000000000000000000000000..f98c7a3666f5abfa0ea07821c42b58aa26a44e7d --- /dev/null +++ b/hplip-unicodeerror.patch @@ -0,0 +1,18 @@ +diff --git a/base/sixext.py b/base/sixext.py +index 0bf4fc4..311bf72 100644 +--- a/base/sixext.py ++++ b/base/sixext.py +@@ -110,11 +110,11 @@ if PY3: + + + def to_string_utf8(s): +- return s.decode("utf-8") ++ return s.decode("utf-8", 'ignore') + + + def to_string_latin(s): +- return s.decode("latin-1") ++ return s.decode("latin-1", 'ignore') + + + def to_unicode(s, enc=None): diff --git a/hplip-use-raw-strings.patch b/hplip-use-raw-strings.patch new file mode 100644 index 0000000000000000000000000000000000000000..6777903ad4d6a320549ea73d43d036addd4b7295 --- /dev/null +++ b/hplip-use-raw-strings.patch @@ -0,0 +1,398 @@ +diff --git a/base/LedmWifi.py b/base/LedmWifi.py +index f63a050..074d5a2 100644 +--- a/base/LedmWifi.py ++++ b/base/LedmWifi.py +@@ -31,7 +31,7 @@ from .g import * + from . import device, utils + from .sixext import to_bytes_utf8 + +-http_result_pat = re.compile("""HTTP/\d.\d\s(\d+)""", re.I) ++http_result_pat = re.compile(r"""HTTP/\d.\d\s(\d+)""", re.I) + HTTP_OK = 200 + HTTP_ACCEPTED = 202 + HTTP_NOCONTENT = 204 +diff --git a/base/device.py b/base/device.py +index fbe6c34..a551403 100644 +--- a/base/device.py ++++ b/base/device.py +@@ -47,7 +47,7 @@ from . import models, mdns, slp, avahi + from .strings import * + from .sixext import PY3, to_bytes_utf8, to_unicode, to_string_latin, to_string_utf8, xStringIO + +-http_result_pat = re.compile("""HTTP/\d.\d\s(\d+)""", re.I) ++http_result_pat = re.compile(r"""HTTP/\d.\d\s(\d+)""", re.I) + + HTTP_OK = 200 + HTTP_ERROR = 500 +diff --git a/base/g.py b/base/g.py +index 96b3131..023aeea 100644 +--- a/base/g.py ++++ b/base/g.py +@@ -302,7 +302,7 @@ prop.hpcups_build = to_bool(sys_conf.get('configure', 'hpcups-install', '0')) + prop.hpijs_build = to_bool(sys_conf.get('configure', 'hpijs-install', '0')) + + # Spinner, ala Gentoo Portage +-spinner = "\|/-\|/-" ++spinner = r"\|/-\|/-" + spinpos = 0 + enable_spinner = True + +@@ -352,7 +352,7 @@ def check_extension_module_env(ext_mod): + log.error('%s not present in the system. Please re-install HPLIP.' %ext_mod) + sys.exit(1) + +- m = re.search('python(\d(\.\d){0,2})', ext_path) #get the python version where the .so file is found ++ m = re.search(r'python(\d(\.\d){0,2})', ext_path) #get the python version where the .so file is found + ext_ver = xint(m.group(1)) + + if ext_ver[0] == 3: +diff --git a/base/logger.py b/base/logger.py +index dd92a9c..68e4f13 100644 +--- a/base/logger.py ++++ b/base/logger.py +@@ -437,10 +437,10 @@ class Logger(object): + start = start + " " + number_chars = number_chars + 1 + try: +- elem_start = re.findall("(\<\W{0,1}\w+) ?", line)[0] +- elem_finished = re.findall("([?|\]\]]*\>)", line)[0] ++ elem_start = re.findall(r"(\<\W{0,1}\w+) ?", line)[0] ++ elem_finished = re.findall(r"([?|\]\]]*\>)", line)[0] + #should not have * +- attrs = re.findall("(\S*?\=\".*?\")", line) ++ attrs = re.findall(r"(\S*?\=\".*?\")", line) + #output.write(start + elem_start) + self.log(start+elem_start, level, False) + number_chars = len(start + elem_start) +diff --git a/base/models.py b/base/models.py +index dc6cc39..48dd2ef 100644 +--- a/base/models.py ++++ b/base/models.py +@@ -35,7 +35,7 @@ except ImportError: + datetime = None + + +-pat_prod_num = re.compile("""(\d+)""", re.I) ++pat_prod_num = re.compile(r"""(\d+)""", re.I) + + TYPE_UNKNOWN = 0 + TYPE_STRING = 1 +@@ -427,25 +427,25 @@ class ModelData: + } + + self.RE_FIELD_TYPES = { +- re.compile('^r(\d+)-agent(\d+)-kind', re.IGNORECASE) : TYPE_INT, +- re.compile('^r(\d+)-agent(\d+)-type', re.IGNORECASE) : TYPE_INT, +- re.compile('^r(\d+)-agent(\d+)-sku', re.IGNORECASE) : TYPE_STR, +- re.compile('^agent(\d+)-desc', re.IGNORECASE) : TYPE_STR, +- re.compile('^agent(\d+)-virgin', re.IGNORECASE) : TYPE_BOOL, +- re.compile('^agent(\d+)-dvc', re.IGNORECASE) : TYPE_INT, +- re.compile('^agent(\d+)-kind', re.IGNORECASE) : TYPE_INT, +- re.compile('^agent(\d+)-type', re.IGNORECASE) : TYPE_INT, +- re.compile('^agent(\d+)-id', re.IGNORECASE) : TYPE_INT, +- re.compile('^agent(\d+)-hp-ink', re.IGNORECASE) : TYPE_BOOL, +- re.compile('^agent(\d+)-health-desc', re.IGNORECASE) : TYPE_STR, +- re.compile('^agent(\d+)-health$', re.IGNORECASE) : TYPE_INT, +- re.compile('^agent(\d+)-known', re.IGNORECASE) : TYPE_BOOL, +- re.compile('^agent(\d+)-level', re.IGNORECASE) : TYPE_INT, +- re.compile('^agent(\d+)-ack', re.IGNORECASE) : TYPE_BOOL, +- re.compile('^agent(\d+)-sku', re.IGNORECASE) : TYPE_STR, +- re.compile('^in-tray(\d+)', re.IGNORECASE) : TYPE_BOOL, +- re.compile('^out-tray(\d+)', re.IGNORECASE) : TYPE_BOOL, +- re.compile('^model(\d+)', re.IGNORECASE) : TYPE_STR, ++ re.compile(r'^r(\d+)-agent(\d+)-kind', re.IGNORECASE) : TYPE_INT, ++ re.compile(r'^r(\d+)-agent(\d+)-type', re.IGNORECASE) : TYPE_INT, ++ re.compile(r'^r(\d+)-agent(\d+)-sku', re.IGNORECASE) : TYPE_STR, ++ re.compile(r'^agent(\d+)-desc', re.IGNORECASE) : TYPE_STR, ++ re.compile(r'^agent(\d+)-virgin', re.IGNORECASE) : TYPE_BOOL, ++ re.compile(r'^agent(\d+)-dvc', re.IGNORECASE) : TYPE_INT, ++ re.compile(r'^agent(\d+)-kind', re.IGNORECASE) : TYPE_INT, ++ re.compile(r'^agent(\d+)-type', re.IGNORECASE) : TYPE_INT, ++ re.compile(r'^agent(\d+)-id', re.IGNORECASE) : TYPE_INT, ++ re.compile(r'^agent(\d+)-hp-ink', re.IGNORECASE) : TYPE_BOOL, ++ re.compile(r'^agent(\d+)-health-desc', re.IGNORECASE) : TYPE_STR, ++ re.compile(r'^agent(\d+)-health$', re.IGNORECASE) : TYPE_INT, ++ re.compile(r'^agent(\d+)-known', re.IGNORECASE) : TYPE_BOOL, ++ re.compile(r'^agent(\d+)-level', re.IGNORECASE) : TYPE_INT, ++ re.compile(r'^agent(\d+)-ack', re.IGNORECASE) : TYPE_BOOL, ++ re.compile(r'^agent(\d+)-sku', re.IGNORECASE) : TYPE_STR, ++ re.compile(r'^in-tray(\d+)', re.IGNORECASE) : TYPE_BOOL, ++ re.compile(r'^out-tray(\d+)', re.IGNORECASE) : TYPE_BOOL, ++ re.compile(r'^model(\d+)', re.IGNORECASE) : TYPE_STR, + } + + self.TYPE_CACHE = {} +diff --git a/base/password.py b/base/password.py +index 259bf82..a4ed107 100644 +--- a/base/password.py ++++ b/base/password.py +@@ -167,8 +167,8 @@ class Password(object): + + elif i == 1: # TIMEOUT + if('true' in cmd and self.__password_prompt_str == ""): # sudo true or su -c "true" +- cb = cb.replace("[", "\[") +- cb = cb.replace("]", "\]") ++ cb = cb.replace("[", r"\[") ++ cb = cb.replace("]", r"\]") + + self.__password_prompt_str = cb + try: +diff --git a/base/queues.py b/base/queues.py +index 0818574..8625f53 100755 +--- a/base/queues.py ++++ b/base/queues.py +@@ -46,7 +46,7 @@ HPPS = 3 + HPOTHER = 4 + + DEVICE_URI_PATTERN = re.compile(r"""(.*):/(.*?)/(\S*?)\?(?:serial=(\S*)|device=(\S*)|ip=(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}[^&]*)|zc=(\S+))(?:&port=(\d))?""", re.I) +-NICKNAME_PATTERN = re.compile(b'''\*NickName:\s*\"(.*)"''', re.MULTILINE) ++NICKNAME_PATTERN = re.compile(r'''\*NickName:\s*\"(.*)"''', re.MULTILINE) + NET_PATTERN = re.compile(r"""(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})""") + NET_ZC_PATTERN = re.compile(r'''zc=(.*)''',re.IGNORECASE) + NET_OTHER_PATTERN = re.compile(r'''(.*)://(.*)''',re.IGNORECASE) +@@ -149,7 +149,7 @@ def parseQueues(mode): + desc='' + else: + try: +- desc = to_string_utf8( NICKNAME_PATTERN.search(fileptr).group(1) ) ++ desc = to_string_utf8( NICKNAME_PATTERN.search(fileptr.decode('utf-8')).group(1) ) + except AttributeError: + desc = '' + +diff --git a/base/status.py b/base/status.py +index 37c774e..01f455d 100644 +--- a/base/status.py ++++ b/base/status.py +@@ -1341,7 +1341,7 @@ def MapPJLErrorCode(error_code, str_code=None): + return status_code + + +-pjl_code_pat = re.compile("""^CODE\s*=\s*(\d.*)$""", re.IGNORECASE) ++pjl_code_pat = re.compile(r"""^CODE\s*=\s*(\d.*)$""", re.IGNORECASE) + + + +diff --git a/base/tui.py b/base/tui.py +index 0f90f92..3b36c65 100644 +--- a/base/tui.py ++++ b/base/tui.py +@@ -217,7 +217,7 @@ class ProgressMeter(object): + self.progress = 0 + self.prompt = prompt + self.prev_length = 0 +- self.spinner = "\|/-\|/-*" ++ self.spinner = r"\|/-\|/-*" + self.spinner_pos = 0 + self.max_size = ttysize()[1] - len(prompt) - 25 + self.update(0) +diff --git a/base/utils.py b/base/utils.py +index 2b631ce..2fb57c4 100644 +--- a/base/utils.py ++++ b/base/utils.py +@@ -148,7 +148,7 @@ def get_cups_systemgroup_list(): + return lis + + try: +- lis = ((re.findall('SystemGroup [\w* ]*',fp.read()))[0].replace('SystemGroup ','')).split(' ') ++ lis = ((re.findall(r'SystemGroup [\w* ]*',fp.read()))[0].replace('SystemGroup ','')).split(' ') + except IndexError: + return lis + +@@ -1597,7 +1597,7 @@ def mixin(cls): + # ------------------------- Usage Help + USAGE_OPTIONS = ("[OPTIONS]", "", "heading", False) + USAGE_LOGGING1 = ("Set the logging level:", "-l or --logging=", 'option', False) +-USAGE_LOGGING2 = ("", ": none, info\*, error, warn, debug (\*default)", "option", False) ++USAGE_LOGGING2 = ("", r": none, info\*, error, warn, debug (\*default)", "option", False) + USAGE_LOGGING3 = ("Run in debug mode:", "-g (same as option: -ldebug)", "option", False) + USAGE_LOGGING_PLAIN = ("Output plain text only:", "-t", "option", False) + USAGE_ARGS = ("[PRINTER|DEVICE-URI]", "", "heading", False) +@@ -1605,13 +1605,13 @@ USAGE_ARGS2 = ("[PRINTER]", "", "heading", False) + USAGE_DEVICE = ("To specify a device-URI:", "-d or --device=", "option", False) + USAGE_PRINTER = ("To specify a CUPS printer:", "-p or --printer=", "option", False) + USAGE_BUS1 = ("Bus to probe (if device not specified):", "-b or --bus=", "option", False) +-USAGE_BUS2 = ("", ": cups\*, usb\*, net, bt, fw, par\* (\*defaults) (Note: bt and fw not supported in this release.)", 'option', False) ++USAGE_BUS2 = ("", r": cups\*, usb\*, net, bt, fw, par\* (\*defaults) (Note: bt and fw not supported in this release.)", 'option', False) + USAGE_HELP = ("This help information:", "-h or --help", "option", True) + USAGE_SPACE = ("", "", "space", False) + USAGE_EXAMPLES = ("Examples:", "", "heading", False) + USAGE_NOTES = ("Notes:", "", "heading", False) + USAGE_STD_NOTES1 = ("If device or printer is not specified, the local device bus is probed and the program enters interactive mode.", "", "note", False) +-USAGE_STD_NOTES2 = ("If -p\* is specified, the default CUPS printer will be used.", "", "note", False) ++USAGE_STD_NOTES2 = (r"If -p\* is specified, the default CUPS printer will be used.", "", "note", False) + USAGE_SEEALSO = ("See Also:", "", "heading", False) + USAGE_LANGUAGE = ("Set the language:", "--loc= or --lang=. Use --loc=? or --lang=? to see a list of available language codes.", "option", False) + USAGE_LANGUAGE2 = ("Set the language:", "--lang=. Use --lang=? to see a list of available language codes.", "option", False) +@@ -1839,7 +1839,7 @@ encoding: utf8 + + elif typ == 'man': + log.info('.TH "%s" 1 "%s" Linux "User Manuals"' % (crumb, version)) +- log.info(".SH NAME\n%s \- %s" % (crumb, title)) ++ log.info(r".SH NAME\n%s \- %s" % (crumb, title)) + + for line in text_list: + text1, text2, format, trailing_space = line +@@ -1938,7 +1938,7 @@ def unescape(text): + except KeyError: + pass + return text # leave as is +- return re.sub("&#?\w+;", fixup, text) ++ return re.sub(r"&#?\w+;", fixup, text) + + + # Adds HTML or XML character references and entities from a text string +@@ -1991,7 +1991,7 @@ def Is_HPLIP_older_version(installed_version, available_version): + log.debug("HPLIP Installed_version=%s Available_version=%s"%(installed_version,available_version)) + cnt = 0 + Is_older = False +- pat=re.compile('''(\d{1,})([a-z]{1,})''') ++ pat=re.compile(r'''(\d{1,})([a-z]{1,})''') + try: + while cnt or --port= (Valid values are 1\*, 2, and 3. \*default)", "option", False), ++ ("To specify the port on a multi-port JetDirect:", r"-p or --port= (Valid values are 1\*, 2, and 3. \*default)", "option", False), + ("Show the CUPS URI only (quiet mode):", "-c or --cups", "option", False), + ("Show the SANE URI only (quiet mode):", "-s or --sane", "option", False), + ("Show the HP Fax URI only (quiet mode):", "-f or --fax", "option", False), +diff --git a/prnt/cups.py b/prnt/cups.py +index 1ea3099..78b8adc 100644 +--- a/prnt/cups.py ++++ b/prnt/cups.py +@@ -168,7 +168,7 @@ CUPS_ERROR_BAD_NAME = 0x0f00 + CUPS_ERROR_BAD_PARAMETERS = 0x0f01 + + nickname_pat = re.compile(r'''\*NickName:\s*\"(.*)"''', re.MULTILINE) +-pat_cups_error_log = re.compile("""^loglevel\s?(debug|debug2|warn|info|error|none)""", re.I) ++pat_cups_error_log = re.compile(r"""^loglevel\s?(debug|debug2|warn|info|error|none)""", re.I) + ppd_pat = re.compile(r'''.*hp-(.*?)(-.*)*\.ppd.*''', re.I) + ppd_pat1 = re.compile(r'''.*hp-(.*?)(_.*)*\.ppd.*''', re.I) + +diff --git a/probe.py b/probe.py +index 2041fb6..2b43ece 100755 +--- a/probe.py ++++ b/probe.py +@@ -42,11 +42,11 @@ USAGE = [(__doc__, "", "name", True), + ("Usage: %s [OPTIONS]" % __mod__, "", "summary", True), + utils.USAGE_OPTIONS, + ("Bus to probe:", "-b or --bus=", "option", False), +- ("", ": cups, usb\*, net, bt, fw, par (\*default) (Note: bt and fw not supported in this release.)", "option", False), ++ ("", r": cups, usb\*, net, bt, fw, par (\*default) (Note: bt and fw not supported in this release.)", "option", False), + ("Set Time to Live (TTL):", "-t or --ttl= (Default is 4).", "option", False), + ("Set timeout:", "-o or --timeout=", "option", False), + ("Filter by functionality:", "-e or --filter=", "option", False), +- ("", ": comma separated list of one or more of: scan, pcard, fax, copy, or none\*. (\*none is the default)", "option", False), ++ ("", r": comma separated list of one or more of: scan, pcard, fax, copy, or none\*. (\*none is the default)", "option", False), + ("Search:", "-s or --search=", "option", False), + ("", " must be a valid regular expression (not case sensitive)", "option", False), + ("Network discovery method:", "-m or --method=: is 'slp'* or 'mdns'.", "option", False), +diff --git a/scan.py b/scan.py +index 0bfa6f5..27b8c2e 100755 +--- a/scan.py ++++ b/scan.py +@@ -249,9 +249,9 @@ try: + extra_options=[utils.USAGE_SPACE, + ("[OPTIONS] (General)", "", "header", False), + ("Scan destinations:", "-s or --dest=", "option", False), +- ("", "where is a comma separated list containing one or more of: 'file'\*, ", "option", False), ++ ("", r"where is a comma separated list containing one or more of: 'file'\*, ", "option", False), + ("", "'viewer', 'editor', 'pdf', or 'print'. Use only commas between values, no spaces.", "option", False), +- ("Scan mode:", "-m or --mode=. Where is 'gray'\*, 'color' or 'lineart'.", "option", False), ++ ("Scan mode:", r"-m or --mode=. Where is 'gray'\*, 'color' or 'lineart'.", "option", False), + ("Scanning resolution:", "-r or --res= or --resolution=", "option", False), + ("", "where 300 is default.", "option", False), + ("Image resize:", "--resize= (min=1%, max=400%, default=100%)", "option", False), +@@ -268,7 +268,7 @@ try: + utils.USAGE_SPACE, + ("[OPTIONS] (Scan area)", "", "header", False), + ("Specify the units for area/box measurements:", "-t or --units=", "option", False), +- ("", "where is 'mm'\*, 'cm', 'in', 'px', or 'pt' ('mm' is default).", "option", False), ++ ("", r"where is 'mm'\*, 'cm', 'in', 'px', or 'pt' ('mm' is default).", "option", False), + ("Scan area:", "-a,,, or --area=,,,", "option", False), + ("", "Coordinates are relative to the upper left corner of the scan area.", "option", False), + ("", "Units for tlx, tly, brx, and bry are specified by -t/--units (default is 'mm').", "option", False), +diff --git a/setup.py b/setup.py +index 98f57fd..1a74d6d 100755 +--- a/setup.py ++++ b/setup.py +@@ -79,11 +79,11 @@ USAGE = [ (__doc__, "", "name", True), + utils.USAGE_SPACE, + utils.USAGE_OPTIONS, + ("Automatic mode:", "-a or --auto (-i mode only)", "option", False), +- ("To specify the port on a multi-port JetDirect:", "--port= (Valid values are 1\*, 2, and 3. \*default)", "option", False), ++ ("To specify the port on a multi-port JetDirect:", r"--port= (Valid values are 1\*, 2, and 3. \*default)", "option", False), + ("No testpage in automatic mode:", "-x (-i mode only)", "option", False), + ("To specify a CUPS printer queue name:", "-p or --printer= (-i mode only)", "option", False), + ("To specify a CUPS fax queue name:", "-f or --fax= (-i mode only)", "option", False), +- ("Type of queue(s) to install:", "-t or --type=. : print*, fax\* (\*default) (-i mode only)", "option", False), ++ ("Type of queue(s) to install:", r"-t or --type=. : print*, fax\* (\*default) (-i mode only)", "option", False), + ("To specify the device URI to install:", "-d or --device= (--qt4 mode only)", "option", False), + ("Remove printers or faxes instead of setting-up:", "-r or --rm or --remove", "option", False), + utils.USAGE_LANGUAGE, diff --git a/hplip-wifisetup.patch b/hplip-wifisetup.patch new file mode 100644 index 0000000000000000000000000000000000000000..a7dc21b0ab1cd85d9e963a8f8177c3672d5c6de6 --- /dev/null +++ b/hplip-wifisetup.patch @@ -0,0 +1,12 @@ +diff -up hplip-3.23.3/ui5/wifisetupdialog.py.wifisetup-bad-call-fix hplip-3.23.3/ui5/wifisetupdialog.py +--- hplip-3.23.3/ui5/wifisetupdialog.py.wifisetup-bad-call-fix 2023-05-29 13:45:35.830961640 +0200 ++++ hplip-3.23.3/ui5/wifisetupdialog.py 2023-05-29 13:48:05.939993288 +0200 +@@ -665,7 +665,7 @@ class WifiSetupDialog(QDialog, Ui_Dialog + self.ip,_,addressmode, subnetmask, gateway, pridns, sec_dns= self.wifiObj.getIPConfiguration(self.dev, self.adapterName) + if self.ip == "0.0.0.0": + if not self.wifiObj == CdmWifi: +- self.ip, subnetmask, gateway, pri_dns, sec_dns, addressmode = self.wifiObj.getwifiotherdetails(self.dev,self.adapterName) ++ self.ip, subnetmask, gateway, pridns, sec_dns, addressmode = self.wifiObj.getwifiotherdetails(self.dev,self.adapterName) + vsa_codes = self.wifiObj.getVSACodes(self.dev, self.adapterName) + ss_max, ss_min, ss_val, ss_dbm = self.wifiObj.getSignalStrength(self.dev, self.adapterName,self.network, self.adaptor_id) + self.hn = self.wifiObj.getHostname(self.dev) diff --git a/hplip.spec b/hplip.spec index ac29176a6adb5801e006c8f18bfde5be8909c7d8..ebed5bbb09812c958b7d3b93c30afbd8d7711a59 100644 --- a/hplip.spec +++ b/hplip.spec @@ -1,16 +1,21 @@ Name: hplip Summary: HP Linux Imaging and Printing Project -Version: 3.23.12 +Version: 3.24.4 Release: 1 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 Source1: hpcups-update-ppds.sh Source2: copy-deviceids.py -Source3: hplip.appdata.xml +Source3: %{name}.appdata.xml +Source4: hp-laserjet_cp_1025nw.ppd.gz +Source5: hp-laserjet_professional_p_1102w.ppd.gz +Source6: hp-plugin.in Patch1: hplip-pstotiff-is-rubbish.patch +Patch2: hplip-strstr-const.patch Patch3: hplip-ui-optional.patch +Patch4: hplip-no-asm.patch Patch5: hplip-deviceIDs-drv.patch Patch6: hplip-udev-rules.patch Patch7: hplip-retry-open.patch @@ -25,23 +30,59 @@ Patch15: hplip-ppd-ImageableArea.patch Patch16: hplip-scan-tmp.patch Patch17: hplip-log-stderr.patch Patch18: hplip-avahi-parsing.patch -Patch20: hplip-dj990c-margin.patch -Patch21: hplip-strncpy.patch -Patch22: hplip-no-write-bytecode.patch -Patch23: hplip-silence-ioerror.patch -Patch24: hplip-3165-sourceoption.patch -Patch25: hplip-noernie.patch -Patch27: hplip-check-cups.patch -Patch30: hplip-typo.patch -Patch31: hplip-use-binary-str.patch -Patch32: hplip-colorlaserjet-mfp-m278-m281.patch -Patch33: hplip-error-print.patch -Patch34: hplip-hpfax-importerror-print.patch -Patch35: 0025-Remove-all-ImageProcessor-functionality-which-is-clo.patch -Patch36: 0026-Call-QMessageBox-constructors-of-PyQT5-with-the-corr.patch -Patch37: 0027-Fixed-incomplete-removal-of-hp-toolbox-features-whic.patch - -Requires: python3-pillow python3-gobject cups python3-dbus systemd %{_bindir}/gpg +Patch19: hplip-dj990c-margin.patch +Patch20: hplip-strncpy.patch +Patch21: hplip-no-write-bytecode.patch +Patch22: hplip-silence-ioerror.patch +Patch23: hplip-sourceoption.patch +Patch24: hplip-noernie.patch +Patch25: hplip-appdata.patch +Patch26: hplip-check-cups.patch +Patch27: hplip-typo.patch +Patch28: hplip-use-binary-str.patch +Patch29: hplip-error-print.patch +Patch30: hplip-hpfax-importerror-print.patch +Patch31: hplip-wifisetup.patch +Patch32: hplip-keyserver.patch +Patch33: 0026-Call-QMessageBox-constructors-of-PyQT5-with-the-corr.patch +Patch34: 0025-Remove-all-ImageProcessor-functionality-which-is-clo.patch +Patch35: 0027-Fixed-incomplete-removal-of-hp-toolbox-features-whic.patch +Patch36: hplip-add-ppd-crash.patch +Patch37: hplip-missing-links.patch +Patch38: hplip-hplj-3052.patch +Patch39: hplip-hpmud-string-parse.patch +Patch40: hplip-m278-m281-needs-plugin.patch +Patch41: hplip-hpcups-crash.patch +Patch42: hplip-covscan.patch +Patch43: hplip-logging-segfault.patch +Patch44: hplip-systray-blockerror.patch +Patch45: hplip-missing-drivers.patch +Patch46: hplip-model-mismatch.patch +Patch47: hplip-unicodeerror.patch +Patch48: hplip-fix-Wreturn-type-warning.patch +Patch49: hplip-configure-python.patch +Patch50: hplip-dialog-infinite-loop.patch +Patch51: hplip-find-driver.patch +Patch52: hplip-clean-ldl.patch +Patch53: hplip-revert-plugins.patch +Patch54: hplip-hpsetup-noscanjets.patch +Patch55: hplip-hpfirmware-timeout.patch +Patch56: hplip-gpgdir-perms.patch +Patch57: hplip-plugin-udevissues.patch +Patch58: hplip-no-libhpmud-libm-warnings.patch +Patch60: hplip-plugin-script.patch +Patch61: hplip-pserror-c99.patch +Patch62: hplip-scan-hpaio-include.patch +Patch63: hplip-scan-orblite-c99.patch +Patch64: hplip-pcardext-disable.patch +Patch65: hplip-sclpml-strcasestr.patch +Patch67: hplip-fix-parsing-lpstat.patch +Patch68: hplip-plugin-curl.patch +Patch69: hplip-use-raw-strings.patch +Patch70: hplip-hpaio-gcc14.patch +Patch71: hplip-locale-format.patch + +Requires: python3-pillow python3-gobject cups python3-dbus systemd gnupg2 Requires: python3-qt5 wget python3-gobject python3-reportlab sane-backends python3 BuildRequires: autoconf automake libtool net-snmp-devel cups-devel libappstream-glib @@ -75,29 +116,31 @@ drivers for HP printers and multi-function peripherals. %prep %setup -q -%patch1 -p1 -b .pstotiff-is-rubbish -%patch3 -p1 -b .ui-optional -%patch5 -p1 -b .deviceIDs-drv +%patch -P 1 -p1 -b .pstotiff-is-rubbish +%patch -P 2 -p1 -b .strstr-const +%patch -P 3 -p1 -b .ui-optional +%patch -P 4 -p1 -b .no-asm +%patch -P 5 -p1 -b .deviceIDs-drv chmod +x %{SOURCE2} mv prnt/drv/hpijs.drv.in{,.deviceIDs-drv-hpijs} %{SOURCE2} prnt/drv/hpcups.drv.in \ prnt/drv/hpijs.drv.in.deviceIDs-drv-hpijs \ > prnt/drv/hpijs.drv.in -%patch6 -p1 -b .udev-rules -%patch7 -p1 -b .retry-open -%patch8 -p1 -b .snmp-quirks -%patch9 -p1 -b .hpijs-marker-supply -%patch10 -p1 -b .clear-old-state-reasons -%patch11 -p1 -b .hpcups-sigpipe -%patch12 -p1 -b .logdir -%patch13 -p1 -b .bad-low-ink-warning +%patch -P 6 -p1 -b .udev-rules +%patch -P 7 -p1 -b .retry-open +%patch -P 8 -p1 -b .snmp-quirks +%patch -P 9 -p1 -b .hpijs-marker-supply +%patch -P 10 -p1 -b .clear-old-state-reasons +%patch -P 11 -p1 -b .hpcups-sigpipe +%patch -P 12 -p1 -b .logdir +%patch -P 13 -p1 -b .bad-low-ink-warning for ppd_file in $(grep '^diff' %{PATCH14} | cut -d " " -f 4); do gunzip ${ppd_file#*/}.gz done -%patch14 -p1 -b .deviceIDs-ppd +%patch -P 14 -p1 -b .deviceIDs-ppd for ppd_file in $(grep '^diff' %{PATCH14} | cut -d " " -f 4); do gzip -n ${ppd_file#*/} @@ -107,37 +150,69 @@ for ppd_file in $(grep '^diff' %{PATCH15} | cut -d " " -f 4); do gunzip ${ppd_file#*/}.gz done -%patch15 -p1 -b .ImageableArea +%patch -P 15 -p1 -b .ImageableArea for ppd_file in $(grep '^diff' %{PATCH15} | cut -d " " -f 4); do gzip -n ${ppd_file#*/} done -%patch16 -p1 -b .scan-tmp -%patch17 -p1 -b .log-stderr -%patch18 -p1 -b .parsing -%patch20 -p1 -b .dj990c-margin -%patch21 -p1 -b .strncpy -%patch22 -p1 -b .no-write-bytecode -%patch23 -p1 -b .silence-ioerror -%patch24 -p1 -b .sourceoption -%patch25 -p1 -b .no-ernie +%patch -P 16 -p1 -b .scan-tmp +%patch -P 17 -p1 -b .log-stderr +%patch -P 18 -p1 -b .parsing +%patch -P 19 -p1 -b .dj990c-margin +%patch -P 20 -p1 -b .strncpy +%patch -P 21 -p1 -b .no-write-bytecode +%patch -P 22 -p1 -b .silence-ioerror +%patch -P 23 -p1 -b .sourceoption +%patch -P 24 -p1 -b .no-ernie +%patch -P 25 -p1 -b .appdata +%patch -P 26 -p1 -b .check-cups +%patch -P 27 -p1 -b .typo +%patch -P 28 -p1 -b .use-binary-str +%patch -P 29 -p1 -b .error-print-fix +%patch -P 30 -p1 -b .hpfax-import-error-print +%patch -P 31 -p1 -b .wifisetup-bad-call-fix +%patch -P 32 -p1 -b .keyserver +%patch -P 33 -p1 -b .qmsgbox-typos-fix +%patch -P 34 -p1 -b .libimageprocessor-removal -rm prnt/hpcups/ErnieFilter.{cpp,h} prnt/hpijs/ernieplatform.h - -%patch27 -p1 -b .check-cups -%patch30 -p1 -b .typo - -%patch31 -p1 -b .use-binary-str -%patch32 -p1 -b .colorlaserjet-mfp-m278-m281 -%patch33 -p1 -b .error-print-fix -%patch34 -p1 -b .hpfax-import-error-print - -%patch35 -p1 -b .libimageprocessor-removal %{_bindir}/rm prnt/hpcups/libImageProcessor-x86* -%patch36 -p1 -b .qmsgbox-typos-fix -%patch37 -p1 -b .toolbox-crash +%patch -P 35 -p1 -b .toolbox-crash +%patch -P 36 -p1 -b .add-ppd-crash +%patch -P 37 -p1 -b .missing-links +%patch -P 38 -p1 -b .hp-laserjet-3052-broken-scanning +%patch -P 39 -p1 -b .hpmud-string-parse +%patch -P 40 -p1 -b .m278-m281-needs-plugin +%patch -P 41 -p1 -b .hpcups-crash +%patch -P 42 -p1 -b .covscan +%patch -P 43 -p1 -b .logging-segfault +%patch -P 44 -p1 -b .systray-blockerror +%patch -P 45 -p1 -b .missing-drivers +%patch -P 46 -p1 -b .model-mismatch +%patch -P 47 -p1 -b .unicodeerror +%patch -P 48 -p1 -b .Wreturn-fix +%patch -P 49 -p1 -b .configure-python +%patch -P 50 -p1 -b .dialog-infinite-loop +%patch -P 51 -p1 -b .find-driver +%patch -P 52 -p1 -b .clean-ldl +%patch -P 53 -p1 -b .revert-plugins +%patch -P 54 -p1 -b .hpsetup-noscanjets +%patch -P 55 -p1 -b .hpfirmware-timeout +%patch -P 56 -p1 -b .gpgdir-perms +%patch -P 57 -p1 -b .hpplugin-udevperms +%patch -P 58 -p1 -b .no-libm-libhpmud-warn +%patch -P 60 -p1 -b .plugin-patch +%patch -P 61 -p1 -b .pserror-int +%patch -P 62 -p1 -b .hpaio-orblite-defs +%patch -P 63 -p1 -b .orblite-undefs +%patch -P 64 -p1 -b .pcardext-disable +%patch -P 65 -p1 -b .sclpml-strcasestr +%patch -P 67 -p1 -b .lpstat-parse +%patch -P 68 -p1 -b .curl-switch +%patch -P 69 -p1 -b .raw-strings +%patch -P 70 -p1 -b .hpaio-gcc14 +%patch -P 71 -p1 -b .locale-format sed -i.duplex-constraints \ -e 's,\(UIConstraints.* \*Duplex\),//\1,' \ @@ -149,7 +224,10 @@ sed -i.env-python -e 's,^#!/usr/bin/env python,#!%{__python3},' \ prnt/filters/hpps \ fax/filters/pstotiff -rm locatedriver +cp -p %{SOURCE4} %{SOURCE5} ppd/hpcups + +cp -p %{SOURCE6} . + %build @@ -159,31 +237,51 @@ autoreconf --verbose --force --install export CFLAGS="%{optflags} $(python3-config --includes)" export CXXFLAGS="%{optflags} $(python3-config --includes)" +export LDFLAGS="${LDFLAGS} -fPIC" %configure \ - --enable-scan-build --enable-gui-build --enable-fax-build \ - --disable-foomatic-rip-hplip-install --enable-pp-build \ - --disable-qt4 --enable-qt5 --enable-hpcups-install \ - --enable-cups-drv-install --enable-foomatic-drv-install \ - --enable-hpijs-install --disable-policykit \ + --enable-fax-build \ + --enable-foomatic-drv-install \ + --enable-gui-build \ + --enable-hpcups-install \ + --enable-hpijs-install \ + --enable-pp-build \ + --enable-qt5 \ + --enable-scan-build \ + --disable-foomatic-rip-hplip-install \ --disable-imageProcessor-build \ + --disable-policykit \ + --disable-qt4 \ --with-mimedir=%{_datadir}/cups/mime PYTHON=%{__python3} %make_build + %install -install -d ${RPM_BUILD_ROOT}%{_bindir} -%make_install DESTDIR=${RPM_BUILD_ROOT} PYTHON=%{__python3} +mkdir -p %{buildroot}%{_bindir} +%make_install PYTHON=%{__python3} + +mkdir -p %{buildroot}/run/hplip +mkdir -p %{buildroot}%{_sharedstatedir}/hp -install -d ${RPM_BUILD_ROOT}/run/hplip -install -d ${RPM_BUILD_ROOT}%{_sharedstatedir}/hp -install -d ${RPM_BUILD_ROOT}%{_tmpfilesdir} -cat > ${RPM_BUILD_ROOT}%{_tmpfilesdir}/hplip.conf < %{buildroot}%{_tmpfilesdir}/hplip.conf < ${RPM_BUILD_ROOT}%{_sysconfdir}/sane.d/dll.d/hpaio + +desktop-file-install \ + --dir %{buildroot}/%{_datadir}/applications \ + --add-category System \ + --add-category Settings \ + --add-category HardwareSettings \ + hplip.desktop + +appstream-util validate-relax --nonet %{buildroot}%{_datadir}/appdata/*.appdata.xml + +install -p -m755 %{SOURCE1} %{buildroot}%{_bindir}/hpcups-update-ppds + +install -d %{buildroot}%{_sysconfdir}/sane.d/dll.d +echo hpaio > %{buildroot}%{_sysconfdir}/sane.d/dll.d/hpaio + find doc/images -type f -exec chmod 644 {} \; -install -d ${RPM_BUILD_ROOT}%{_datadir}/hplip/prnt/plugins +install -d %{buildroot}%{_datadir}/hplip/prnt/plugins %pre %{_bindir}/systemctl start cups &>/dev/null ||: %{_bindir}/systemctl enable cups &>/dev/null ||: %post -%{_bindir}/hpcups-update-ppds &>/dev/null ||: +%{_bindir}/timeout 10m -k 15m %{_bindir}/hpcups-update-ppds &>/dev/null ||: /sbin/ldconfig %postun @@ -260,25 +400,10 @@ install -d ${RPM_BUILD_ROOT}%{_datadir}/hplip/prnt/plugins %config(noreplace) %{_sysconfdir}/hp/%{name}.conf %config(noreplace) %{_sysconfdir}/sane.d/dll.d/hpaio -%exclude %{_datadir}/%{name}/pkservice.py -%exclude %{_datadir}/%{name}/dat2drv* -%exclude %{_datadir}/%{name}/fax/pstotiff* -%exclude %{_datadir}/hal/fdi -%exclude %{_datadir}/applications/%{name}.desktop -%exclude %{_datadir}/cups/mime/pstotiff.types -%exclude %{_docdir} -%exclude %{_bindir}/hp-pkservice -%exclude %{_libdir}/*.la -%exclude %{_libdir}/libhpip.so -%exclude %{_libdir}/libhpipp.so -%exclude %{_libdir}/libhpdiscovery.so -%exclude %{_libdir}/sane/*.la -%exclude %{_unitdir}/%{name}-printer@.service -%exclude %{_sysconfdir}/xdg/autostart/%{name}-systray.desktop -%exclude %{_sysconfdir}/sane.d -%exclude %{python3_sitearch}/*.la - %changelog +* Thu Jan 09 2025 yangchenguang - - 3.24.4-1 +- Upgrade to 3.24.4 + * Thu Mar 14 2024 xu_ping <707078654@qq.com> - 3.23.12-1 - Upgrade to 3.23.12