summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/patches/0001-Cope-with-prnt-hpcups-ErnieFilter.-cpp-h-removal-by-.patch79
-rw-r--r--debian/patches/0002-Blank-ink-only-patch-by-Richard-Spencer-Smith.patch125
-rw-r--r--debian/patches/0003-Fix-missing-charsign.patch26
-rw-r--r--debian/patches/0004-Corrections-models.dat-entry-for-the-HP-PhotoSmart-P.patch97
-rw-r--r--debian/patches/0005-Fixed-short-edge-duplex-for-non-PS-laser-printers.patch81
-rw-r--r--debian/patches/0006-Make-simple-scan-the-default-scanning-frontend.patch56
-rw-r--r--debian/patches/0007-Try-libhpmud.so.0-directly.patch52
-rw-r--r--debian/patches/0008-For-the-Lidil-printers-enable-two-cartridge-modes-bl.patch71
-rw-r--r--debian/patches/0009-Treat-logging-before-importing-of-logger-module.patch50
-rw-r--r--debian/patches/0010-Simplified-the-construction-of-the-title-line-of-the.patch51
-rw-r--r--debian/patches/0011-Make-the-menu-of-the-hp-systray-applet-appearing-whe.patch25
-rw-r--r--debian/patches/0012-Fix-duplex-descriptor-uninitialized.patch43
-rw-r--r--debian/patches/0013-Make-sure-that-the-HPLIP-components-which-access-the.patch101
-rw-r--r--debian/patches/0014-Workaround-patch-for-missing-Python3-transition-of-t.patch147
-rw-r--r--debian/patches/0015-Allow-non-JPEG-scanning-on-the-HP-DeskJet-3520-All-i.patch150
-rw-r--r--debian/patches/0016-Fix-download-and-installation-of-HP-s-proprietary-pl.patch38
-rw-r--r--debian/patches/0017-In-hp-scan-s-manpage-sort-PAGE_SIZES-in-help-for-the.patch22
-rw-r--r--debian/patches/0018-Install-check-plugin.py-as-a-script.patch29
-rw-r--r--debian/patches/0019-LaserJet-PostScript-4000-PPD-bugfix.patch36
-rw-r--r--debian/patches/0020-Patch-UI-files-to-match-upstream-produced-.py-code.patch65
-rw-r--r--debian/patches/0021-Add-include-cups-ppd.h-in-various-places-as-CUPS-2.2.patch49
-rw-r--r--debian/patches/0022-Fix-list-wrapping-in-scan.py-to-fix-generated-manpag.patch23
-rw-r--r--debian/patches/0023-Fix-handling-of-unicode-filenames-in-sixext.py.patch28
-rw-r--r--debian/patches/0024-Make-dat2drv-and-locateppd-build-dependent-of-class-.patch44
-rw-r--r--debian/patches/0025-Remove-all-ImageProcessor-functionality-which-is-clo.patch112
-rw-r--r--debian/patches/0026-Call-QMessageBox-constructors-of-PyQT5-with-the-corr.patch472
-rw-r--r--debian/patches/0027-Fixed-incomplete-removal-of-hp-toolbox-features-whic.patch40
-rw-r--r--debian/patches/0028-hp-check-Fix-core.distro-vs.-core.distro_name-mixups.patch51
-rw-r--r--debian/patches/0029-Make-base.g.xint-more-generous-in-what-it-can-take.patch28
-rw-r--r--debian/patches/0030-Fix-linking-of-libhpipp-and-the-ext-python-extension.patch58
-rw-r--r--debian/patches/0031-Fix-some-typos-in-BUG-and-DBG-messages.patch95
-rw-r--r--debian/patches/0032-Fix-version-pattern-check-to-support-ghostscript-RC-.patch26
-rw-r--r--debian/patches/0033-Fix-the-PIL.Image-version-check-to-work-with-Pillow-.patch22
-rw-r--r--debian/patches/0034-Don-t-gpg-import-but-rely-on-installed-signing_key.a.patch37
-rw-r--r--debian/patches/0035-Shortcut-distros.dat-finding-to-point-to-where-it-is.patch35
-rw-r--r--debian/patches/0036-Accelerate-HTTP-check-by-doing-a-HEAD-not-a-GET.patch56
-rw-r--r--debian/patches/0037-Enforce-Debian-assumptions.patch139
-rw-r--r--debian/patches/0038-Removed-all-page-size-choices-named-Custom-.-they-br.patch96
-rw-r--r--debian/patches/0039-PY3-Fix-dat2drv.py.patch21
-rw-r--r--debian/patches/0040-Replace-rubbish-pstotiff-filter.patch76
-rw-r--r--debian/patches/0041-Fix-strstr-const.patch62
-rw-r--r--debian/patches/0042-Added-several-IEEE-1284-Device-IDs.patch760
-rw-r--r--debian/patches/0043-Retry-when-connecting-to-device-fails.patch26
-rw-r--r--debian/patches/0044-Mark-SNMP-quirks-for-two-lying-devices.patch31
-rw-r--r--debian/patches/0045-Fix-bogus-low-ink-warning-from-hpijs-driver.patch41
-rw-r--r--debian/patches/0046-Clear-old-state-reasons.patch27
-rw-r--r--debian/patches/0047-Avoid-busy-loop-in-hpcups-when-backend-has-exited.patch39
-rw-r--r--debian/patches/0048-CUPS-filters-should-use-TMPDIR-when-available.patch36
-rw-r--r--debian/patches/0049-Fixed-Device-ID-parsing-code-in-hpijs-s-dj9xxvip.c.patch49
-rw-r--r--debian/patches/0050-IEEE1284-Device-ID-for-HP-LaserJet-4000.patch21
-rw-r--r--debian/patches/0051-Fix-ImageableArea-for-Laserjet-8150-9000.patch473
-rw-r--r--debian/patches/0052-Fix-parsing-of-avahi-daemon-output.patch29
-rw-r--r--debian/patches/0053-Fixed-left-right-margins-for-HP-DeskJet-990C.patch25
-rw-r--r--debian/patches/0054-Fixed-uses-of-strncpy-throughout.patch62
-rw-r--r--debian/patches/0055-Ignore-IOError-when-logging-output.patch22
-rw-r--r--debian/patches/0056-Exit-if-source-cannot-be-fetched-from-device.patch21
-rw-r--r--debian/patches/0057-hp-check-shows-CUPS-incompatible-or-not-running-even.patch27
-rw-r--r--debian/patches/0058-hp-firmware-NameError-name-INTERACTIVE_MODE4-is-not-.patch22
-rw-r--r--debian/patches/0059-hp-setup-fails-on-fax-setup-use-binary-strings.patch52
-rw-r--r--debian/patches/0060-Fix-TypeError.patch84
-rw-r--r--debian/patches/0061-Fix-TypeError-in-hpfax.patch22
-rw-r--r--debian/patches/0062-Fix-AttributeError-when-connecting-to-printer-via-wi.patch22
-rw-r--r--debian/patches/0063-Fixed-hp-setup-crash-when-user-wants-to-define-path-.patch23
-rw-r--r--debian/patches/0064-Ignore-symlinks-when-installing-plugins.patch31
-rw-r--r--debian/patches/0065-Scanning-broken-for-HP-LaserJet-3052.patch30
-rw-r--r--debian/patches/0066-Cannot-scan-with-M281fdw-LaserJet-failed-Error-durin.patch24
-rw-r--r--debian/patches/0067-Fixed-hpcups-crash-when-required-plugin-missing.patch22
-rw-r--r--debian/patches/0068-Fixing-issues-found-by-coverity-scan.patch734
-rw-r--r--debian/patches/0069-abrt-hplip-strlen-hp-killed-by-SIGSEGV.patch26
-rw-r--r--debian/patches/0070-abrt-hp-systray-BlockingIOError-Errno-11-Resource-te.patch34
-rw-r--r--debian/patches/0071-Missing-drivers.patch622
-rw-r--r--debian/patches/0072-Revert-3.20.2-change-to-io-hpmud-jd.c.patch21
-rw-r--r--debian/patches/series72
73 files changed, 6444 insertions, 0 deletions
diff --git a/debian/patches/0001-Cope-with-prnt-hpcups-ErnieFilter.-cpp-h-removal-by-.patch b/debian/patches/0001-Cope-with-prnt-hpcups-ErnieFilter.-cpp-h-removal-by-.patch
new file mode 100644
index 000000000..e1bab9609
--- /dev/null
+++ b/debian/patches/0001-Cope-with-prnt-hpcups-ErnieFilter.-cpp-h-removal-by-.patch
@@ -0,0 +1,79 @@
+From: Didier Raboud <odyx@debian.org>
+Date: Fri, 22 Jul 2016 09:32:50 +0200
+Subject: Cope with prnt/hpcups/ErnieFilter.{cpp,h} removal by disabling the
+ functionality
+
+Origin: vendor
+---
+ Makefile.am | 2 +-
+ prnt/hpcups/Pcl3Gui2.cpp | 17 -----------------
+ prnt/hpcups/Pcl3Gui2.h | 1 -
+ 3 files changed, 1 insertion(+), 19 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 891660d..54a46b5 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -559,7 +559,7 @@ hpcups_SOURCES = prnt/hpcups/HPCupsFilter.cpp prnt/hpcups/HPCupsFilter.h prnt/hp
+ prnt/hpcups/Mode2.cpp prnt/hpcups/Mode2.h prnt/hpcups/Mode3.cpp prnt/hpcups/Mode3.h \
+ prnt/hpcups/Mode9.cpp prnt/hpcups/Mode9.h prnt/hpcups/Mode10.cpp prnt/hpcups/Mode10.h \
+ prnt/hpcups/ModeDeltaPlus.cpp prnt/hpcups/ModeDeltaPlus.h prnt/hpcups/ModeJbig.cpp prnt/hpcups/ModeJbig.h \
+- prnt/hpcups/ErnieFilter.cpp prnt/hpcups/ErnieFilter.h prnt/hpcups/EncapsulatorFactory.cpp prnt/hpcups/EncapsulatorFactory.h \
++ prnt/hpcups/EncapsulatorFactory.cpp prnt/hpcups/EncapsulatorFactory.h \
+ prnt/hpcups/Encapsulator.cpp prnt/hpcups/Encapsulator.h prnt/hpcups/Pcl3.cpp prnt/hpcups/Pcl3.h \
+ prnt/hpcups/Pcl3Gui.cpp prnt/hpcups/Pcl3Gui.h prnt/hpcups/Pcl3Gui2.cpp prnt/hpcups/Pcl3Gui2.h \
+ prnt/hpcups/LJMono.cpp prnt/hpcups/LJMono.h prnt/hpcups/LJColor.cpp prnt/hpcups/LJColor.h \
+diff --git a/prnt/hpcups/Pcl3Gui2.cpp b/prnt/hpcups/Pcl3Gui2.cpp
+index 893bcfd..1678c39 100644
+--- a/prnt/hpcups/Pcl3Gui2.cpp
++++ b/prnt/hpcups/Pcl3Gui2.cpp
+@@ -30,7 +30,6 @@
+
+ #include "CommonDefinitions.h"
+ #include "Pcl3Gui2.h"
+-#include "ErnieFilter.h"
+ #include "Mode10.h"
+ #include "Mode9.h"
+ #include "PrinterCommands.h"
+@@ -38,7 +37,6 @@
+ Pcl3Gui2::Pcl3Gui2() : Encapsulator()
+ {
+ speed_mech_enabled = true;
+- m_run_ernie_filter = true;
+ crd_type = eCrd_both;
+ strcpy(m_szLanguage, "PCL3GUI");
+ }
+@@ -59,21 +57,6 @@ DRIVER_ERROR Pcl3Gui2::Configure(Pipeline **pipeline)
+ }
+
+ width = m_pMA->printable_width;;
+- if (m_run_ernie_filter) {
+- ErnieFilter *pErnie;
+-
+- // Normal: threshold = (resolution) * (0.0876) - 2
+- int threshold = ((m_pQA->horizontal_resolution * 876) / 10000) - 2;
+-
+- pErnie = new ErnieFilter (width, eBGRPixelData, threshold);
+- p = new Pipeline (pErnie);
+- if (head) {
+- head->AddPhase (p);
+- }
+- else {
+- head = p;
+- }
+- }
+
+ if (crd_type != eCrd_black_only) {
+ Mode10 *pMode10;
+diff --git a/prnt/hpcups/Pcl3Gui2.h b/prnt/hpcups/Pcl3Gui2.h
+index 8907078..543f8bd 100644
+--- a/prnt/hpcups/Pcl3Gui2.h
++++ b/prnt/hpcups/Pcl3Gui2.h
+@@ -60,7 +60,6 @@ private:
+ DRIVER_ERROR encapsulateRaster(BYTE *input_raster, unsigned int num_bytes, COLORTYPE c_type);
+ bool speed_mech_enabled;
+ int page_number;
+- bool m_run_ernie_filter;
+ eCrdType crd_type;
+ };
+
diff --git a/debian/patches/0002-Blank-ink-only-patch-by-Richard-Spencer-Smith.patch b/debian/patches/0002-Blank-ink-only-patch-by-Richard-Spencer-Smith.patch
new file mode 100644
index 000000000..46285a1c6
--- /dev/null
+++ b/debian/patches/0002-Blank-ink-only-patch-by-Richard-Spencer-Smith.patch
@@ -0,0 +1,125 @@
+From: Torsten Landschoff <torsten@pulsar.galaxy>
+Date: Fri, 22 Jul 2016 09:32:51 +0200
+Subject: Blank-ink-only patch by Richard Spencer-Smith
+
+---
+ prnt/hpijs/breaks_open.cpp | 5 ++++-
+ prnt/hpijs/dj660_maps.cpp | 5 ++++-
+ prnt/hpijs/dj690_maps.cpp | 5 ++++-
+ prnt/hpijs/dj895_maps.cpp | 5 ++++-
+ prnt/hpijs/dj895_maps2.cpp | 5 ++++-
+ prnt/hpijs/dj970_maps.cpp | 6 +++++-
+ prnt/hpijs/dj970_maps3.cpp | 3 ++-
+ 7 files changed, 27 insertions(+), 7 deletions(-)
+
+diff --git a/prnt/hpijs/breaks_open.cpp b/prnt/hpijs/breaks_open.cpp
+index ebfdb95..4d8fdf4 100644
+--- a/prnt/hpijs/breaks_open.cpp
++++ b/prnt/hpijs/breaks_open.cpp
+@@ -1078,7 +1078,10 @@ const unsigned char HT600x6004level970_open[1024]=
+
+ {
+ 0, 0, 255, 0,
+-0, 1, 255, 0,
++// 2001.06.16 mrb: changed the value to 0. With the original "1"
++// the printer sometimes prints empty lines...
++//0, 1, 255, 0,
++0, 0, 255, 0,
+ 0, 3, 255, 0,
+ 0, 5, 255, 0,
+ 0, 7, 255, 0,
+diff --git a/prnt/hpijs/dj660_maps.cpp b/prnt/hpijs/dj660_maps.cpp
+index 7f29cbb..6da224f 100644
+--- a/prnt/hpijs/dj660_maps.cpp
++++ b/prnt/hpijs/dj660_maps.cpp
+@@ -38,7 +38,10 @@ APDK_BEGIN_NAMESPACE
+ //const
+ uint32_t ulMapDJ660_CCM_KCMY[ 9 * 9 * 9 ]=
+ {
+- 422720226UL, 142187374UL, 94354238UL, 62442785UL, 45668877UL, 27648516UL, 8972032UL, 7335680UL, 5895424UL,
++// 2001.06.14 mrb: Replaced the first entry so the printer will
++// use only the black pen when he should print real black.
++// 422720226UL, 142187374UL, 94354238UL, 62442785UL, 45668877UL, 27648516UL, 8972032UL, 7335680UL, 5895424UL,
++ 226UL, 142187374UL, 94354238UL, 62442785UL, 45668877UL, 27648516UL, 8972032UL, 7335680UL, 5895424UL,
+ 2519110233UL, 807846483UL, 391693109UL, 260029471UL, 143570703UL, 42776580UL, 8501760UL, 7782400UL, 6539520UL,
+ 3072173868UL, 1881129514UL, 841465387UL, 524792087UL, 358391818UL, 174364420UL, 40408577UL, 6920704UL, 6530560UL,
+ 3407591425UL, 2551891200UL, 1612695808UL, 824489479UL, 506699268UL, 306153730UL, 105283329UL, 5144320UL, 5737216UL,
+diff --git a/prnt/hpijs/dj690_maps.cpp b/prnt/hpijs/dj690_maps.cpp
+index a8248c6..df0c527 100644
+--- a/prnt/hpijs/dj690_maps.cpp
++++ b/prnt/hpijs/dj690_maps.cpp
+@@ -38,7 +38,10 @@ APDK_BEGIN_NAMESPACE
+ uint32_t ulMapDJ690_CMYK[ 9 * 9 * 9 ]=
+ // DJ690_CMYK
+ {
+- 337848575UL, 37838470UL, 155209268UL, 137905152UL, 36454656UL, 2310144UL,
++// 2001.06.14 mrb: Replaced the first entry so the printer will
++// use only the black pen when he should print real black.
++// 337848575UL, 37838470UL, 155209268UL, 137905152UL, 36454656UL, 2310144UL,
++ 226UL, 37838470UL, 155209268UL, 137905152UL, 36454656UL, 2310144UL,
+ 2179072UL, 2051072UL, 1733120UL, 2013280119UL, 385897321UL, 303379741UL,
+ 270610688UL, 102772224UL, 1844992UL, 1911552UL, 1847296UL, 1784832UL,
+ 2080387626UL, 1157643294UL, 452996881UL, 335555072UL, 202384384UL, 50991872UL,
+diff --git a/prnt/hpijs/dj895_maps.cpp b/prnt/hpijs/dj895_maps.cpp
+index ff23db5..54da57d 100644
+--- a/prnt/hpijs/dj895_maps.cpp
++++ b/prnt/hpijs/dj895_maps.cpp
+@@ -37,7 +37,10 @@ APDK_BEGIN_NAMESPACE
+
+ uint32_t ulMapDJ895_KCMY[ 9*9*9 ]=
+ {
+-1819176703UL, 79494215UL, 112983330UL, 79035667UL, 78183948UL, 60489224UL, 59571718UL, 42007811UL, 7405312UL,
++// 2001.06.14 mrb: Replaced the first entry so the printer will
++// use only the black pen when he should print real black.
++//1819176703UL, 79494215UL, 112983330UL, 79035667UL, 78183948UL, 60489224UL, 59571718UL, 42007811UL, 7405312UL,
++226UL, 79494215UL, 112983330UL, 79035667UL, 78183948UL, 60489224UL, 59571718UL, 42007811UL, 7405312UL,
+ 4230922555UL, 655358293UL, 176553263UL, 128253208UL, 61209869UL, 60751368UL, 26606852UL, 9305345UL, 8650496UL,
+ 4248940299UL, 3776766759UL, 756415798UL, 308083743UL, 142671120UL, 59440646UL, 9239553UL, 9109248UL, 8779520UL,
+ 4248086274UL, 4214276619UL, 2786390812UL, 942206231UL, 491516427UL, 224131588UL, 6616320UL, 7399168UL, 7857664UL,
+diff --git a/prnt/hpijs/dj895_maps2.cpp b/prnt/hpijs/dj895_maps2.cpp
+index 2f6d857..8ab12d8 100644
+--- a/prnt/hpijs/dj895_maps2.cpp
++++ b/prnt/hpijs/dj895_maps2.cpp
+@@ -163,7 +163,10 @@ uint32_t ulMapDJ895_HB_KCMY[ 9*9*9 ]=
+
+ uint32_t ulMapDJ895_Binary_KCMY[ 9*9*9 ]=
+ {
+-1819176648UL, 64158794UL, 80805158UL, 80215318UL, 62389519UL, 61406730UL,
++// 2001.06.14 mrb: Replaced the first entry so the printer will
++// use only the black pen when he should print real black.
++//1819176648UL, 64158794UL, 80805158UL, 80215318UL, 62389519UL, 61406730UL,
++226UL, 64158794UL, 80805158UL, 80215318UL, 62389519UL, 61406730UL,
+ 60292615UL, 42401028UL, 7601920UL, 4230922301UL, 571406681UL, 160889651UL,
+ 113048859UL, 62717200UL, 45415944UL, 27917573UL, 10419457UL, 9238272UL,
+ 4248940557UL, 3743081259UL, 790296119UL, 325515810UL, 127007505UL, 27196678UL,
+diff --git a/prnt/hpijs/dj970_maps.cpp b/prnt/hpijs/dj970_maps.cpp
+index d5d25d5..1f696f0 100644
+--- a/prnt/hpijs/dj970_maps.cpp
++++ b/prnt/hpijs/dj970_maps.cpp
+@@ -127,7 +127,11 @@ uint32_t ulMapGRAY_K_6x6x1[] =
+
+ uint32_t ulMapDJ970_KCMY[ 9*9*9 ]=
+ {
+- 673723135UL, 26007371UL, 9756717UL, 10020638UL, 10022677UL, 10153743UL,
++// 2003.06.05 rss: Replaced the first entry so the printer will
++// (hopefully) use only the black pen when he should print real black.
++// Please report as a bug if it doesn't, or something worse happens.
++// 673723135UL, 26007371UL, 9756717UL, 10020638UL, 10022677UL, 10153743UL,
++ 226UL, 26007371UL, 9756717UL, 10020638UL, 10022677UL, 10153743UL,
+ 10285066UL, 10416133UL, 9169408UL, 3405886809UL, 59743UL, 23980849UL,
+ 9366812UL, 10153744UL, 10285066UL, 10153990UL, 10087424UL, 9169408UL,
+ 3858807091UL, 2197868343UL, 60220UL, 4714015UL, 7270155UL, 8646656UL,
+diff --git a/prnt/hpijs/dj970_maps3.cpp b/prnt/hpijs/dj970_maps3.cpp
+index fcf3877..04c631b 100644
+--- a/prnt/hpijs/dj970_maps3.cpp
++++ b/prnt/hpijs/dj970_maps3.cpp
+@@ -37,7 +37,8 @@ APDK_BEGIN_NAMESPACE
+
+ uint32_t ulMapDJ970_Draft_KCMY[ 9*9*9 ]=
+ {
+-1802205183UL, 22740362UL, 5832524UL, 5635892UL, 5570340UL, 5308188UL,
++//1802205183UL, 22740362UL, 5832524UL, 5635892UL, 5570340UL, 5308188UL,
++ 226UL, 22740362UL, 5832524UL, 5635892UL, 5570340UL, 5308188UL,
+ 5308180UL, 5504778UL, 5504768UL, 4278239136UL, 65446UL, 4194132UL,
+ 5308210UL, 5373728UL, 5308182UL, 5504784UL, 5504776UL, 5504768UL,
+ 4278498896UL, 1862336354UL, 65388UL, 2621242UL, 4128540UL, 4718348UL,
diff --git a/debian/patches/0003-Fix-missing-charsign.patch b/debian/patches/0003-Fix-missing-charsign.patch
new file mode 100644
index 000000000..767f6ccc6
--- /dev/null
+++ b/debian/patches/0003-Fix-missing-charsign.patch
@@ -0,0 +1,26 @@
+From: Till Kamppeter <till.kamppeter@gmail.com>
+Date: Fri, 22 Jul 2016 09:32:52 +0200
+Subject: Fix missing charsign
+
+---
+ scan/sane/scl.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/scan/sane/scl.c b/scan/sane/scl.c
+index cc640f4..eccd990 100755
+--- a/scan/sane/scl.c
++++ b/scan/sane/scl.c
+@@ -37,10 +37,11 @@
+ #define DEBUG_DECLARE_ONLY
+ #include "sanei_debug.h"
+
+-static int SclBufferIsPartialReply( unsigned char * data, int datalen )
++static int SclBufferIsPartialReply( void * dataptr, int datalen )
+ {
+ int i = 0, value = 0;
+- unsigned char d;
++ unsigned char * const data = dataptr;
++ unsigned int d;
+
+ if( i >= datalen )
+ {
diff --git a/debian/patches/0004-Corrections-models.dat-entry-for-the-HP-PhotoSmart-P.patch b/debian/patches/0004-Corrections-models.dat-entry-for-the-HP-PhotoSmart-P.patch
new file mode 100644
index 000000000..2290500bf
--- /dev/null
+++ b/debian/patches/0004-Corrections-models.dat-entry-for-the-HP-PhotoSmart-P.patch
@@ -0,0 +1,97 @@
+From: Till Kamppeter <till.kamppeter@gmail.com>
+Date: Fri, 22 Jul 2016 09:32:53 +0200
+Subject: Corrections: models.dat entry for the HP PhotoSmart Pro B9100
+
+LP: #213984
+---
+ data/models/models.dat | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 77 insertions(+)
+
+diff --git a/data/models/models.dat b/data/models/models.dat
+index 8637795..759569c 100644
+--- a/data/models/models.dat
++++ b/data/models/models.dat
+@@ -52244,6 +52244,83 @@ usb-pid=d12
+ usb-vid=3f0
+ wifi-config=0
+
++[photosmart_pro_b9100_series]
++align-type=1
++clean-type=1
++color-cal-type=3
++copy-type=0
++embedded-server-type=1
++fax-type=0
++fw-download=False
++icon=Photosmart_Pro_B9180.png
++io-mfp-mode=4
++io-mode=1
++io-support=6
++job-storage=0
++linefeed-cal-type=0
++model1=HP Photosmart Pro B9180gp Photo Printer
++model2=HP Photosmart Pro B9180 Photo Printer
++monitor-type=0
++panel-check-type=1
++pcard-type=0
++plugin=0
++plugin-reason=0
++power-settings=0
++pq-diag-type=0
++r-type=0
++r0-agent1-kind=1
++r0-agent1-sku=C9407A
++r0-agent1-type=16
++r0-agent10-kind=2
++r0-agent10-sku=C9417A
++r0-agent10-type=6
++r0-agent11-kind=2
++r0-agent11-sku=C9418A
++r0-agent11-type=7
++r0-agent12-kind=2
++r0-agent12-sku=C9419A
++r0-agent12-type=8
++r0-agent2-kind=1
++r0-agent2-sku=C9406A
++r0-agent2-type=14
++r0-agent3-kind=1
++r0-agent3-sku=C9405A
++r0-agent3-type=13
++r0-agent4-kind=1
++r0-agent4-sku=C9404A
++r0-agent4-type=15
++r0-agent5-kind=2
++r0-agent5-sku=C9412A
++r0-agent5-type=1
++r0-agent6-kind=2
++r0-agent6-sku=C9413A
++r0-agent6-type=19
++r0-agent7-kind=2
++r0-agent7-sku=C9414A
++r0-agent7-type=17
++r0-agent8-kind=2
++r0-agent8-sku=C9415A
++r0-agent8-type=4
++r0-agent9-kind=2
++r0-agent9-sku=C9416A
++r0-agent9-type=5
++scan-src=0
++scan-type=0
++status-battery-check=0
++status-dynamic-counters=0
++status-type=2
++support-released=True
++support-subtype=219b2b
++support-type=2
++support-ver=2.8.4
++tech-class=PSB9100
++family-class=Undefined
++tech-subclass=Normal
++tech-type=2
++usb-pid=bd02
++usb-vid=3f0
++wifi-config=0
++
+ [hp_deskjet_9300]
+ align-type=1
+ clean-type=1
diff --git a/debian/patches/0005-Fixed-short-edge-duplex-for-non-PS-laser-printers.patch b/debian/patches/0005-Fixed-short-edge-duplex-for-non-PS-laser-printers.patch
new file mode 100644
index 000000000..98f2d2473
--- /dev/null
+++ b/debian/patches/0005-Fixed-short-edge-duplex-for-non-PS-laser-printers.patch
@@ -0,0 +1,81 @@
+From: Till Kamppeter <till.kamppeter@gmail.com>
+Date: Fri, 22 Jul 2016 09:32:54 +0200
+Subject: Fixed short-edge duplex for non-PS laser printers
+
+LP: #244295
+---
+ prnt/hpijs/ljcolor.cpp | 13 +++++++++++++
+ prnt/hpijs/ljjetready.cpp | 11 +++++++++++
+ prnt/hpijs/ljmono.cpp | 13 +++++++++++++
+ 3 files changed, 37 insertions(+)
+
+diff --git a/prnt/hpijs/ljcolor.cpp b/prnt/hpijs/ljcolor.cpp
+index 0ecbfc6..db35e98 100644
+--- a/prnt/hpijs/ljcolor.cpp
++++ b/prnt/hpijs/ljcolor.cpp
+@@ -330,6 +330,19 @@ DRIVER_ERROR HeaderLJColor::StartSend ()
+
+ err = thePrinter->Send ((const BYTE *) res, strlen (res));
+
++// Binding directive
++
++ strcpy (res, "@PJL SET BINDING=LONGEDGE\015\012");
++
++#ifdef APDK_AUTODUPLEX
++ if (thePrintContext->QueryDuplexMode () == DUPLEXMODE_TABLET)
++ {
++ strcpy (res, "@PJL SET BINDING=SHORTEDGE\015\012");
++ }
++#endif
++
++ err = thePrinter->Send ((const BYTE *) res, strlen (res));
++
+
+ err = thePrinter->Send ((const BYTE*) EnterLanguage, sizeof (EnterLanguage));
+ ERRCHECK;
+diff --git a/prnt/hpijs/ljjetready.cpp b/prnt/hpijs/ljjetready.cpp
+index 6942d29..d79d409 100644
+--- a/prnt/hpijs/ljjetready.cpp
++++ b/prnt/hpijs/ljjetready.cpp
+@@ -329,6 +329,17 @@ DRIVER_ERROR HeaderLJJetReady::StartSend ()
+ err = thePrinter->Send ((const BYTE *) szScratchStr, strlen (szScratchStr));
+ ERRCHECK;
+
++ // Send the Binding command
++ strcpy (szScratchStr, "@PJL SET BINDING=LONGEDGE\015\012");
++#ifdef APDK_AUTODUPLEX
++ if (thePrintContext->QueryDuplexMode () == DUPLEXMODE_TABLET)
++ {
++ strcpy (szScratchStr, "@PJL SET BINDING=SHORTEDGE\015\012");
++ }
++#endif
++ err = thePrinter->Send ((const BYTE *) szScratchStr, strlen (szScratchStr));
++ ERRCHECK;
++
+ //Set the resolution to 600
+ err = thePrinter->Send ((const BYTE*)ccpPJLSetRes,sizeof(ccpPJLSetRes));
+ ERRCHECK;
+diff --git a/prnt/hpijs/ljmono.cpp b/prnt/hpijs/ljmono.cpp
+index 67a0077..8d3ad4d 100644
+--- a/prnt/hpijs/ljmono.cpp
++++ b/prnt/hpijs/ljmono.cpp
+@@ -212,6 +212,19 @@ DRIVER_ERROR HeaderLJMono::StartSend ()
+ err = thePrinter->Send ((const BYTE *) res, strlen (res));
+ ERRCHECK;
+
++// Binding directive
++
++ strcpy (res, "@PJL SET BINDING=LONGEDGE\015\012");
++
++#ifdef APDK_AUTODUPLEX
++ if (thePrintContext->QueryDuplexMode () == DUPLEXMODE_TABLET)
++ {
++ strcpy (res, "@PJL SET BINDING=SHORTEDGE\015\012");
++ }
++#endif
++ err = thePrinter->Send ((const BYTE *) res, strlen (res));
++ ERRCHECK;
++
+ err = thePrinter->Send ((const BYTE*) EnterLanguage, sizeof (EnterLanguage));
+ ERRCHECK;
+
diff --git a/debian/patches/0006-Make-simple-scan-the-default-scanning-frontend.patch b/debian/patches/0006-Make-simple-scan-the-default-scanning-frontend.patch
new file mode 100644
index 000000000..947b9bc04
--- /dev/null
+++ b/debian/patches/0006-Make-simple-scan-the-default-scanning-frontend.patch
@@ -0,0 +1,56 @@
+From: Till Kamppeter <till.kamppeter@gmail.com>
+Date: Fri, 22 Jul 2016 09:32:55 +0200
+Subject: Make simple-scan the default scanning frontend
+
+LP: #539015
+---
+ base/utils.py | 17 ++++++++++-------
+ ui5/ui_utils.py | 2 +-
+ 2 files changed, 11 insertions(+), 8 deletions(-)
+
+diff --git a/base/utils.py b/base/utils.py
+index f268cf8..9f9cfb1 100644
+--- a/base/utils.py
++++ b/base/utils.py
+@@ -566,18 +566,21 @@ class UserSettings(object): # Note: Deprecated after 2.8.8 in Qt4 (see ui4/ui_ut
+
+ # Scan
+ self.cmd_scan = ''
+- path = which('xsane')
+-
++ path = which('simple-scan')
+ if len(path) > 0:
+- self.cmd_scan = 'xsane -V %SANE_URI%'
++ self.cmd_scan = 'simple-scan %SANE_URI%'
+ else:
+- path = which('kooka')
++ path = which('xsane')
+ if len(path) > 0:
+- self.cmd_scan = 'kooka'
++ self.cmd_scan = 'xsane -V %SANE_URI%'
+ else:
+- path = which('xscanimage')
++ path = which('kooka')
+ if len(path) > 0:
+- self.cmd_scan = 'xscanimage'
++ self.cmd_scan = 'kooka'
++ else:
++ path = which('xscanimage')
++ if len(path) > 0:
++ self.cmd_scan = 'xscanimage'
+
+ # Photo Card
+ path = which('hp-unload')
+diff --git a/ui5/ui_utils.py b/ui5/ui_utils.py
+index caba339..865d6eb 100644
+--- a/ui5/ui_utils.py
++++ b/ui5/ui_utils.py
+@@ -205,7 +205,7 @@ class UserSettings(QSettings):
+ return ''
+
+ def loadDefaults(self):
+- self.cmd_scan = self.__setup(['xsane -V %SANE_URI%', 'kooka', 'xscanimage'])
++ self.cmd_scan = self.__setup(['simple-scan %SANE_URI%', 'xsane -V %SANE_URI%', 'kooka', 'xscanimage'])
+ self.cmd_fab = self.__setup(['hp-fab'])
+
+
diff --git a/debian/patches/0007-Try-libhpmud.so.0-directly.patch b/debian/patches/0007-Try-libhpmud.so.0-directly.patch
new file mode 100644
index 000000000..7c2131290
--- /dev/null
+++ b/debian/patches/0007-Try-libhpmud.so.0-directly.patch
@@ -0,0 +1,52 @@
+From: Evgeny Golov <evgeni@debian.org>
+Date: Fri, 22 Jul 2016 09:32:56 +0200
+Subject: Try libhpmud.so.0 directly
+
+It's the library we ship.
+
+Closes: #600670
+---
+ scan/sane/marvell.c | 2 +-
+ scan/sane/soap.c | 2 +-
+ scan/sane/soapht.c | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/scan/sane/marvell.c b/scan/sane/marvell.c
+index ad267a3..6cac67a 100644
+--- a/scan/sane/marvell.c
++++ b/scan/sane/marvell.c
+@@ -60,7 +60,7 @@ 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 = dlopen("libhpmud.so.0", RTLD_LAZY|RTLD_GLOBAL)) == NULL)
+ {
+ if ((ps->hpmud_handle = load_library("libhpmud.so.0")) == NULL)
+ goto bugout;
+diff --git a/scan/sane/soap.c b/scan/sane/soap.c
+index 07106fe..a45f1a0 100644
+--- a/scan/sane/soap.c
++++ b/scan/sane/soap.c
+@@ -68,7 +68,7 @@ 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 = dlopen("libhpmud.so.0", RTLD_LAZY|RTLD_GLOBAL)) == NULL)
+ {
+ if ((ps->hpmud_handle = load_library("libhpmud.so.0")) == NULL)
+ goto bugout;
+diff --git a/scan/sane/soapht.c b/scan/sane/soapht.c
+index 269ab21..df0e807 100644
+--- a/scan/sane/soapht.c
++++ b/scan/sane/soapht.c
+@@ -62,7 +62,7 @@ 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 = dlopen("libhpmud.so.0", RTLD_LAZY|RTLD_GLOBAL)) == NULL)
+ {
+ if ((ps->hpmud_handle = load_library("libhpmud.so.0")) == NULL)
+ goto bugout;
diff --git a/debian/patches/0008-For-the-Lidil-printers-enable-two-cartridge-modes-bl.patch b/debian/patches/0008-For-the-Lidil-printers-enable-two-cartridge-modes-bl.patch
new file mode 100644
index 000000000..efe1cdcab
--- /dev/null
+++ b/debian/patches/0008-For-the-Lidil-printers-enable-two-cartridge-modes-bl.patch
@@ -0,0 +1,71 @@
+From: Till Kamppeter <till.kamppeter@gmail.com>
+Date: Fri, 22 Jul 2016 09:32:58 +0200
+Subject: For the Lidil printers,
+ enable two-cartridge modes (black and color cartridge) in the hpcups driver
+ and assign the choices of the "Printout Mode" option to two-cartridge modes
+ in the hpijs driver
+
+LP: #235399
+---
+ prnt/drv/hpijs.drv.in.template | 20 ++++++++++----------
+ 1 file changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/prnt/drv/hpijs.drv.in.template b/prnt/drv/hpijs.drv.in.template
+index 3ae87af..0c60fdc 100644
+--- a/prnt/drv/hpijs.drv.in.template
++++ b/prnt/drv/hpijs.drv.in.template
+@@ -2220,16 +2220,16 @@ le=- -"
+ r=&quot;HEWLETT-PACKARD&quot; -sDeviceModel=&quot;deskjet 3320&quot;"
+ Attribute "FoomaticRIPOption" "PrintoutMode" "enum Composite B"
+ Attribute "FoomaticRIPOptionSetting" "PrintoutMode=Draft" "Quality=300DraftColorCM&&
+-Y"
++YK"
+ Attribute "FoomaticRIPOptionSetting" "PrintoutMode=Draft.Gray" "Quality=300DraftGr&&
+ ayscaleK"
+- Attribute "FoomaticRIPOptionSetting" "PrintoutMode=Normal" "Quality=300ColorCMY"
++ Attribute "FoomaticRIPOptionSetting" "PrintoutMode=Normal" "Quality=300ColorCMYK"
+ Attribute "FoomaticRIPOptionSetting" "PrintoutMode=Normal.Gray" "Quality=300Graysc&&
+ aleK"
+- Attribute "FoomaticRIPOptionSetting" "PrintoutMode=High" "Quality=600ColorCMY"
++ Attribute "FoomaticRIPOptionSetting" "PrintoutMode=High" "Quality=600ColorCMYK"
+ Attribute "FoomaticRIPOptionSetting" "PrintoutMode=High.Gray" "Quality=600Grayscal&&
+ eK"
+- Attribute "FoomaticRIPOptionSetting" "PrintoutMode=Photo" "Quality=600PhotoCMY"
++ Attribute "FoomaticRIPOptionSetting" "PrintoutMode=Photo" "Quality=600PhotoCMYK"
+ Attribute "FoomaticRIPOption" "PageSize" "enum CmdLine A"
+ Attribute "FoomaticRIPOptionSetting" "PageSize=Letter" " -dDEVICEWIDTHPOINTS=612 -&&
+ dDEVICEHEIGHTPOINTS=792"
+@@ -2402,13 +2402,13 @@ le=- -"
+ r=&quot;HEWLETT-PACKARD&quot; -sDeviceModel=&quot;deskjet 3600&quot;"
+ Attribute "FoomaticRIPOption" "PrintoutMode" "enum Composite B"
+ Attribute "FoomaticRIPOptionSetting" "PrintoutMode=Draft" "Quality=300DraftColorCM&&
+-Y"
++YK"
+ Attribute "FoomaticRIPOptionSetting" "PrintoutMode=Draft.Gray" "Quality=300DraftGr&&
+ ayscaleK"
+- Attribute "FoomaticRIPOptionSetting" "PrintoutMode=Normal" "Quality=300ColorCMY"
++ Attribute "FoomaticRIPOptionSetting" "PrintoutMode=Normal" "Quality=300ColorCMYK"
+ Attribute "FoomaticRIPOptionSetting" "PrintoutMode=Normal.Gray" "Quality=300Graysc&&
+ aleK"
+- Attribute "FoomaticRIPOptionSetting" "PrintoutMode=High" "Quality=600ColorCMY"
++ Attribute "FoomaticRIPOptionSetting" "PrintoutMode=High" "Quality=600ColorCMYK"
+ Attribute "FoomaticRIPOptionSetting" "PrintoutMode=High.Gray" "Quality=600Grayscal&&
+ eK"
+ Attribute "FoomaticRIPOptionSetting" "PrintoutMode=Photo" "Quality=600PhotoCMYKFul&&
+@@ -2598,13 +2598,13 @@ er=&quot;HEWLETT-PACKARD&quot; -sDeviceModel=&quot;Deskjet D4100&quot;&&
+ "
+ Attribute "FoomaticRIPOption" "PrintoutMode" "enum Composite B"
+ Attribute "FoomaticRIPOptionSetting" "PrintoutMode=Draft" "Quality=600DraftColorCM&&
+-Y"
++YK"
+ Attribute "FoomaticRIPOptionSetting" "PrintoutMode=Draft.Gray" "Quality=600DraftGr&&
+ ayscaleK"
+- Attribute "FoomaticRIPOptionSetting" "PrintoutMode=Normal" "Quality=600ColorCMY"
++ Attribute "FoomaticRIPOptionSetting" "PrintoutMode=Normal" "Quality=600ColorCMYK"
+ Attribute "FoomaticRIPOptionSetting" "PrintoutMode=Normal.Gray" "Quality=600Graysc&&
+ aleK"
+- Attribute "FoomaticRIPOptionSetting" "PrintoutMode=High" "Quality=600ColorCMY"
++ Attribute "FoomaticRIPOptionSetting" "PrintoutMode=High" "Quality=600ColorCMYK"
+ Attribute "FoomaticRIPOptionSetting" "PrintoutMode=High.Gray" "Quality=600Grayscal&&
+ eK"
+ Attribute "FoomaticRIPOptionSetting" "PrintoutMode=Photo" "Quality=600PhotoCMYKFul&&
diff --git a/debian/patches/0009-Treat-logging-before-importing-of-logger-module.patch b/debian/patches/0009-Treat-logging-before-importing-of-logger-module.patch
new file mode 100644
index 000000000..0a95f88f1
--- /dev/null
+++ b/debian/patches/0009-Treat-logging-before-importing-of-logger-module.patch
@@ -0,0 +1,50 @@
+From: Till Kamppeter <till.kamppeter@gmail.com>
+Date: Fri, 22 Jul 2016 09:32:59 +0200
+Subject: Treat logging before importing of logger module
+
+LP: #560849
+Origin: https://src.fedoraproject.org/rpms/hplip/blob/master/f/hplip-log-stderr.patch
+---
+ fax/backend/hpfax.py | 5 ++++-
+ prnt/filters/hpps | 10 ++++++++--
+ 2 files changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/fax/backend/hpfax.py b/fax/backend/hpfax.py
+index 9560e84..7aaef35 100755
+--- a/fax/backend/hpfax.py
++++ b/fax/backend/hpfax.py
+@@ -55,7 +55,10 @@ home_dir = ''
+
+ def bug(msg):
+ syslog.syslog("hpfax[%d]: error: %s\n" % (pid, msg))
+- log.stderr("ERROR: %s\n" % msg)
++ try:
++ log.stderr("ERROR: %s\n" % msg)
++ except:
++ print >> sys.stderr, ("ERROR: %s\n" % msg)
+
+
+ if os.path.exists(config_file):
+diff --git a/prnt/filters/hpps b/prnt/filters/hpps
+index d6220ba..00a4931 100644
+--- a/prnt/filters/hpps
++++ b/prnt/filters/hpps
+@@ -53,10 +53,16 @@ home_dir = ''
+
+
+ def bug(m):
+- log.stderr("ERROR: %s" % m)
++ try:
++ log.stderr("ERROR: %s" % m)
++ except NameError:
++ sys.stderr.write("ERROR: %s\n" % m)
+
+ def msg(m):
+- log.stderr("INFO: %s" % m)
++ try:
++ log.stderr("INFO: %s" % msg)
++ except NameError:
++ sys.stderr.write("INFO: %s\n" % msg)
+
+ if os.path.exists(config_file):
+ config = configparser.ConfigParser()
diff --git a/debian/patches/0010-Simplified-the-construction-of-the-title-line-of-the.patch b/debian/patches/0010-Simplified-the-construction-of-the-title-line-of-the.patch
new file mode 100644
index 000000000..c3416ee06
--- /dev/null
+++ b/debian/patches/0010-Simplified-the-construction-of-the-title-line-of-the.patch
@@ -0,0 +1,51 @@
+From: Till Kamppeter <till.kamppeter@gmail.com>
+Date: Fri, 22 Jul 2016 09:33:00 +0200
+Subject: Simplified the construction of the title line of the hp-systray
+ applet menu,
+ so that the applet-to-indicator converter sni-qt also imports this title
+ line (at least the text of it).
+
+Thanks to Aurelien Gateau for this patch.
+---
+ ui5/systemtray.py | 25 ++++---------------------
+ 1 file changed, 4 insertions(+), 21 deletions(-)
+
+diff --git a/ui5/systemtray.py b/ui5/systemtray.py
+index 5b69d2b..8888dec 100644
+--- a/ui5/systemtray.py
++++ b/ui5/systemtray.py
+@@ -442,30 +442,13 @@ class SystemTrayApp(QApplication):
+ def setMenu(self):
+ self.menu = QMenu()
+
+- title = QWidgetAction(self.menu)
++ title = QAction(self.menu)
+ #title.setDisabled(True)
+
+- hbox = QFrame(self.menu)
+- layout = QHBoxLayout(hbox)
+- # layout.setMargin(3)
+- layout.setContentsMargins(3, 3, 3, 3)
+- layout.setSpacing(5)
+- pix_label = QLabel(hbox)
+
+- layout.insertWidget(-1, pix_label, 0)
+-
+- icon_size = self.menu.style().pixelMetric(QStyle.PM_SmallIconSize)
+- pix_label.setPixmap(self.prop_icon.pixmap(icon_size))
+-
+- label = QLabel(hbox)
+- layout.insertWidget(-1, label, 20)
+- title.setDefaultWidget(hbox)
+-
+- label.setText(self.__tr("HPLIP Status Service"))
+-
+- f = label.font()
+- f.setBold(True)
+- label.setFont(f)
++ title.setText(self.__tr("HPLIP Status Service"))
++ title.setIcon(self.prop_icon)
++ title.setIconVisibleInMenu(True)
+ self.menu.insertAction(None, title)
+
+ if devices:
diff --git a/debian/patches/0011-Make-the-menu-of-the-hp-systray-applet-appearing-whe.patch b/debian/patches/0011-Make-the-menu-of-the-hp-systray-applet-appearing-whe.patch
new file mode 100644
index 000000000..2590fddf0
--- /dev/null
+++ b/debian/patches/0011-Make-the-menu-of-the-hp-systray-applet-appearing-whe.patch
@@ -0,0 +1,25 @@
+From: Till Kamppeter <till.kamppeter@gmail.com>
+Date: Fri, 22 Jul 2016 09:33:01 +0200
+Subject: Make the menu of the hp-systray applet appearing when the applet is
+ converted to an indicator applet by sni-qt and put into the notification
+ area of KDE
+
+LP: #857929
+---
+ ui5/systemtray.py | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/ui5/systemtray.py b/ui5/systemtray.py
+index 8888dec..ec3574f 100644
+--- a/ui5/systemtray.py
++++ b/ui5/systemtray.py
+@@ -576,6 +576,9 @@ class SystemTrayApp(QApplication):
+
+ elif reason == QSystemTrayIcon.Trigger:
+ #print "single click"
++ self.updateMenu()
++ if not self.menu is None:
++ self.menu.popup(QCursor.pos())
+ pass
+
+ elif reason == QSystemTrayIcon.MiddleClick:
diff --git a/debian/patches/0012-Fix-duplex-descriptor-uninitialized.patch b/debian/patches/0012-Fix-duplex-descriptor-uninitialized.patch
new file mode 100644
index 000000000..b43f28768
--- /dev/null
+++ b/debian/patches/0012-Fix-duplex-descriptor-uninitialized.patch
@@ -0,0 +1,43 @@
+From: Matej Vela <vela@debian.org>
+Date: Fri, 22 Jul 2016 09:33:02 +0200
+Subject: Fix "duplex descriptor uninitialized"
+
+Closes: #583273
+---
+ scan/sane/sclpml.c | 21 +++++++++------------
+ 1 file changed, 9 insertions(+), 12 deletions(-)
+
+diff --git a/scan/sane/sclpml.c b/scan/sane/sclpml.c
+index 9a5975f..61500da 100644
+--- a/scan/sane/sclpml.c
++++ b/scan/sane/sclpml.c
+@@ -1084,20 +1084,17 @@ static void init_options( hpaioScanner_t hpaio )
+ hpaio->option[OPTION_ADF_MODE].constraint_type = SANE_CONSTRAINT_STRING_LIST;
+ hpaio->option[OPTION_ADF_MODE].constraint.string_list = hpaio->adfModeList;
+
+- // Duplex scanning is supported
+- if (hpaio->supportsDuplex == 1)
+- {
+- hpaio->option[OPTION_DUPLEX].name = STR_NAME_DUPLEX;
+- hpaio->option[OPTION_DUPLEX].title = STR_TITLE_DUPLEX;
+- hpaio->option[OPTION_DUPLEX].desc = STR_DESC_DUPLEX;
+- hpaio->option[OPTION_DUPLEX].type = SANE_TYPE_BOOL;
+- hpaio->option[OPTION_DUPLEX].unit = SANE_UNIT_NONE;
+- hpaio->option[OPTION_DUPLEX].size = sizeof( SANE_Bool );
+- hpaio->option[OPTION_DUPLEX].cap = SANE_CAP_SOFT_SELECT |
++ hpaio->option[OPTION_DUPLEX].name = STR_NAME_DUPLEX;
++ hpaio->option[OPTION_DUPLEX].title = STR_TITLE_DUPLEX;
++ hpaio->option[OPTION_DUPLEX].desc = STR_DESC_DUPLEX;
++ hpaio->option[OPTION_DUPLEX].type = SANE_TYPE_BOOL;
++ hpaio->option[OPTION_DUPLEX].unit = SANE_UNIT_NONE;
++ hpaio->option[OPTION_DUPLEX].size = sizeof( SANE_Bool );
++ hpaio->option[OPTION_DUPLEX].cap = SANE_CAP_SOFT_SELECT |
+ SANE_CAP_SOFT_DETECT |
+ SANE_CAP_ADVANCED;
+- hpaio->option[OPTION_DUPLEX].constraint_type = SANE_CONSTRAINT_NONE;
+- }
++ hpaio->option[OPTION_DUPLEX].constraint_type = SANE_CONSTRAINT_NONE;
++
+ hpaio->option[GROUP_GEOMETRY].title = STR_TITLE_GEOMETRY;
+ hpaio->option[GROUP_GEOMETRY].type = SANE_TYPE_GROUP;
+ hpaio->option[GROUP_GEOMETRY].cap = SANE_CAP_ADVANCED;
diff --git a/debian/patches/0013-Make-sure-that-the-HPLIP-components-which-access-the.patch b/debian/patches/0013-Make-sure-that-the-HPLIP-components-which-access-the.patch
new file mode 100644
index 000000000..d72a37b67
--- /dev/null
+++ b/debian/patches/0013-Make-sure-that-the-HPLIP-components-which-access-the.patch
@@ -0,0 +1,101 @@
+From: Till Kamppeter <till.kamppeter@gmail.com>
+Date: Fri, 22 Jul 2016 09:33:03 +0200
+Subject: Make sure that the HPLIP components which access the USB (especially
+ the CUPS backends "hp" and "hpfax") do not crash when libusb fails to
+ connect to the USB,
+ for example on machines without USB or with the USB kernel modules not
+ loaded
+
+LP: #1302437
+---
+ io/hpmud/musb.c | 32 +++++++++++++++++++++-----------
+ 1 file changed, 21 insertions(+), 11 deletions(-)
+
+diff --git a/io/hpmud/musb.c b/io/hpmud/musb.c
+index 6e99c15..fe5d50f 100644
+--- a/io/hpmud/musb.c
++++ b/io/hpmud/musb.c
+@@ -695,7 +695,8 @@ static libusb_device *get_libusb_device(const char *uri)
+ int numdevs = 0; /* number of connected devices */
+ int i, conf, iface, altset ;
+
+- libusb_init(&libusb_ctx);
++ i = libusb_init(&libusb_ctx);
++ if (i) goto bugout;
+ numdevs = libusb_get_device_list(libusb_ctx, &libusb_dev_list);
+ for (i=0; i< numdevs; i++)
+ {
+@@ -2054,7 +2055,8 @@ int __attribute__ ((visibility ("hidden"))) musb_probe_devices(char *lst, int ls
+ char serial[128], mfg[128], sz[HPMUD_LINE_SIZE];
+ int r, size=0;
+
+- libusb_init(&ctx);
++ i = libusb_init(&ctx);
++ if (i) goto bugout;
+ numdevs = libusb_get_device_list(ctx, &list);
+
+ if (numdevs <= 0)
+@@ -2155,12 +2157,14 @@ int __attribute__ ((visibility ("hidden"))) musb_probe_devices(char *lst, int ls
+ }//end for loop
+
+ bugout:
+- if (!hd)
++ if (hd)
+ libusb_close(hd);
+ if (confptr)
+ libusb_free_config_descriptor(confptr);
+- libusb_free_device_list(list, 1);
+- libusb_exit(ctx);
++ if (list)
++ libusb_free_device_list(list, 1);
++ if (ctx)
++ libusb_exit(ctx);
+
+ return size;
+ }
+@@ -2186,7 +2190,8 @@ enum HPMUD_RESULT hpmud_make_usb_uri(const char *busnum, const char *devnum, cha
+
+ *bytes_read=0;
+
+- libusb_init(&ctx);
++ i = libusb_init(&ctx);
++ if (i) goto bugout;
+ numdevs = libusb_get_device_list(ctx, &list);
+
+ if (numdevs <= 0)
+@@ -2289,8 +2294,10 @@ bugout:
+ if (hd != NULL)
+ libusb_close(hd);
+
+- libusb_free_device_list(list, 1);
+- libusb_exit(ctx);
++ if (list)
++ libusb_free_device_list(list, 1);
++ if (ctx)
++ libusb_exit(ctx);
+
+ return stat;
+ }
+@@ -2309,7 +2316,8 @@ enum HPMUD_RESULT hpmud_make_usb_serial_uri(const char *sn, char *uri, int uri_s
+
+ *bytes_read=0;
+
+- libusb_init(&ctx);
++ i = libusb_init(&ctx);
++ if (i) goto bugout;
+ numdevs = libusb_get_device_list(ctx, &list);
+
+ if (numdevs <= 0)
+@@ -2335,8 +2343,10 @@ enum HPMUD_RESULT hpmud_make_usb_serial_uri(const char *sn, char *uri, int uri_s
+ stat = HPMUD_R_OK;
+
+ bugout:
+- libusb_free_device_list(list, 1);
+- libusb_exit(ctx);
++ if (list)
++ libusb_free_device_list(list, 1);
++ if (ctx)
++ libusb_exit(ctx);
+
+ return stat;
+ }
diff --git a/debian/patches/0014-Workaround-patch-for-missing-Python3-transition-of-t.patch b/debian/patches/0014-Workaround-patch-for-missing-Python3-transition-of-t.patch
new file mode 100644
index 000000000..b79f0c017
--- /dev/null
+++ b/debian/patches/0014-Workaround-patch-for-missing-Python3-transition-of-t.patch
@@ -0,0 +1,147 @@
+From: Till Kamppeter <till.kamppeter@gmail.com>
+Date: Fri, 22 Jul 2016 09:33:04 +0200
+Subject: Workaround patch for missing Python3 transition of the old
+ (pre-USB-storage) photo memory card support (pcardext) as this part builds
+ in Python3 environments but with pointer-related warnings which are fatal
+ errors for Ubuntu's build servers. The patch silences the warnings but the
+ memory card support is dropped in Python3 environments. This patch is
+ supplied by the HPLIP upstream developers and will be replaced by a more
+ proper solution in the next upstream release of HPLIP (see LP: #1275353)
+
+---
+ pcard/pcardext/pcardext.c | 59 +++++++++++++++++++++++++++++++++++++----------
+ pcard/photocard.py | 2 +-
+ unload.py | 5 ++++
+ 3 files changed, 53 insertions(+), 13 deletions(-)
+
+diff --git a/pcard/pcardext/pcardext.c b/pcard/pcardext/pcardext.c
+index c1a8273..37d979b 100644
+--- a/pcard/pcardext/pcardext.c
++++ b/pcard/pcardext/pcardext.c
+@@ -20,7 +20,7 @@ pcardext - Python extension for HP photocard services
+ Requires:
+ Python 2.2+
+
+-Author: Don Welch
++Author: Don Welch
+
+ \*****************************************************************************/
+
+@@ -38,9 +38,37 @@ typedef int Py_ssize_t;
+
+ int verbose=0;
+
++#if PY_MAJOR_VERSION >= 3
++ #define MOD_ERROR_VAL NULL
++ #define MOD_SUCCESS_VAL(val) val
++ #define MOD_INIT(name) PyMODINIT_FUNC PyInit_##name(void)
++ #define PyInt_AS_LONG PyLong_AS_LONG
++ #define MOD_DEF(ob, name, doc, methods) \
++ static struct PyModuleDef moduledef = { \
++ PyModuleDef_HEAD_INIT, name, doc, -1, methods, }; \
++ ob = PyModule_Create(&moduledef);
++
++
++ #define PY_String_Bytes PyBytes_FromStringAndSize
++ #define PY_AsString_Bytes PyBytes_AsStringAndSize
++
++#else
++ #define MOD_ERROR_VAL
++ #define MOD_SUCCESS_VAL(val)
++ #define MOD_INIT(name) void init##name(void)
++ #define MOD_DEF(ob, name, doc, methods) \
++ ob = Py_InitModule3(name, methods, doc);
++
++ #define PY_String_Bytes PyString_FromStringAndSize
++ #define PY_AsString_Bytes PyString_AsStringAndSize
++
++#endif
++
+ PyObject * readsectorFunc = NULL;
+ PyObject * writesectorFunc = NULL;
+
++
++
+ int ReadSector(int sector, int nsector, void *buf, int size)
+ {
+ PyObject * result;
+@@ -56,9 +84,13 @@ int ReadSector(int sector, int nsector, void *buf, int size)
+ if( result )
+ {
+ Py_ssize_t len = 0;
+- PyString_AsStringAndSize( result, &result_str, &len );
++
++ //PyString_AsStringAndSize( result, &result_str, &len );
++ //PyBytes_AsStringAndSize( result, &result_str, &len );
++ PY_AsString_Bytes( result, &result_str, &len );
+
+- if( len < nsector*FAT_HARDSECT )
++
++ if( len < nsector*FAT_HARDSECT )
+ {
+ goto abort;
+ }
+@@ -205,7 +237,9 @@ PyObject * pcardext_read( PyObject * self, PyObject * args )
+
+ if( FatReadFileExt( name, offset, len, buffer ) == len )
+ {
+- return PyString_FromStringAndSize( (char *)buffer, len );
++ // return PyString_FromStringAndSize( (char *)buffer, len );
++ return PY_String_Bytes( (char *)buffer, len );
++ // return PyBytes_FromStringAndSize( (char *)buffer, len );
+ }
+ else
+ {
+@@ -233,14 +267,15 @@ static PyMethodDef pcardext_methods[] =
+
+ static char pcardext_documentation[] = "Python extension for HP photocard services";
+
+-void initpcardext( void )
+-{
+- PyObject * mod = Py_InitModule4( "pcardext", pcardext_methods,
+- pcardext_documentation, (PyObject*)NULL,
+- PYTHON_API_VERSION );
+-
+- if (mod == NULL)
+- return;
++MOD_INIT(pcardext) {
++
++ PyObject* mod ;
++ MOD_DEF(mod, "pcardext", pcardext_documentation, pcardext_methods);
++ if (mod == NULL)
++ return MOD_ERROR_VAL;
++
++ return MOD_SUCCESS_VAL(mod);
++
+ }
+
+
+diff --git a/pcard/photocard.py b/pcard/photocard.py
+index 913dc4e..2c73158 100644
+--- a/pcard/photocard.py
++++ b/pcard/photocard.py
+@@ -30,7 +30,7 @@ from base.codes import *
+ from base import device, utils, exif
+
+ try:
+- from . import pcardext
++ import pcardext
+ except ImportError:
+ if not os.getenv("HPLIP_BUILD"):
+ log.error("PCARDEXT could not be loaded. Please check HPLIP installation.")
+diff --git a/unload.py b/unload.py
+index 3fdd5a3..ce8b069 100755
+--- a/unload.py
++++ b/unload.py
+@@ -44,6 +44,11 @@ except ImportError:
+
+ # Local
+ from base.g import *
++from base.sixext import PY3
++if PY3:
++ log.error("This functionality is not spported in python3 environment.")
++ sys.exit(1)
++
+ from base import device, utils, tui, module
+ from prnt import cups
+
diff --git a/debian/patches/0015-Allow-non-JPEG-scanning-on-the-HP-DeskJet-3520-All-i.patch b/debian/patches/0015-Allow-non-JPEG-scanning-on-the-HP-DeskJet-3520-All-i.patch
new file mode 100644
index 000000000..4da93880b
--- /dev/null
+++ b/debian/patches/0015-Allow-non-JPEG-scanning-on-the-HP-DeskJet-3520-All-i.patch
@@ -0,0 +1,150 @@
+From: =?utf-8?b?THVib8WhIERvbGXFvmVs?= <lubos@dolezel.info>
+Date: Fri, 22 Jul 2016 09:33:05 +0200
+Subject: Allow non-JPEG scanning on the HP DeskJet 3520 All-in-One and
+ similar devices
+
+LP: #1245578
+---
+ scan/sane/bb_ledm.c | 47 +++++++++++++++++++++++++++++++++++++++++------
+ scan/sane/ledm.c | 12 +++++++-----
+ 2 files changed, 48 insertions(+), 11 deletions(-)
+
+diff --git a/scan/sane/bb_ledm.c b/scan/sane/bb_ledm.c
+index b233d1e..27d73a0 100644
+--- a/scan/sane/bb_ledm.c
++++ b/scan/sane/bb_ledm.c
+@@ -189,7 +189,7 @@ Keep-Alive: 20\r\nProxy-Connection: keep-alive\r\nCookie: AccessCounter=new\r\n0
+ <YStart>%d</YStart>\
+ <Height>%d</Height>\
+ <Format>%s</Format>\
+-<CompressionQFactor>15</CompressionQFactor>\
++<CompressionQFactor>0</CompressionQFactor>\
+ <ColorSpace>%s</ColorSpace>\
+ <BitDepth>%d</BitDepth>\
+ <InputSource>%s</InputSource>\
+@@ -234,6 +234,38 @@ Keep-Alive: 300\r\nProxy-Connection: keep-alive\r\nCookie: AccessCounter=new\r\n
+ # define JOBSTATE_COMPLETED "<j:JobState>Completed</j:JobState>"
+ # define PRESCANPAGE "<PreScanPage>"
+
++static int parse_status_elements(const char *payload, int size, struct wscn_create_scan_job_response *resp)
++{
++ char tag[512];
++ char value[128];
++ char *tail=(char *)payload;
++
++ while (1)
++ {
++ get_tag(tail, size-(tail-payload), tag, sizeof(tag), &tail);
++
++ if (!tag[0])
++ break;
++
++ if (strncmp(tag, "ImageWidth", 10) == 0)
++ {
++ get_element(tail, size-(tail-payload), value, sizeof(value), &tail);
++ resp->pixels_per_line = strtol(value, NULL, 10);
++ }
++ else if (strncmp(tag, "ImageHeight", 11) == 0)
++ {
++ get_element(tail, size-(tail-payload), value, sizeof(value), &tail);
++ resp->lines = strtol(value, NULL, 10);
++ }
++ else if (strncmp(tag, "BytesPerLine", 12) == 0)
++ {
++ get_element(tail, size-(tail-payload), value, sizeof(value), &tail);
++ resp->bytes_per_line = strtol(value, NULL, 10);
++ }
++ }
++ return 0;
++}
++
+ static int parse_scan_elements(const char *payload, int size, struct wscn_scan_elements *elements)
+ {
+ char tag[512];
+@@ -762,8 +794,7 @@ int bb_get_parameters(struct ledm_session *ps, SANE_Parameters *pp, int option)
+ if (ps->currentCompression == SF_RAW && ps->currentScanMode != CE_GRAY8)
+ {
+ /* Set scan parameters based on scan job response values */
+- //pp->lines = pbb->job.lines;
+- pp->lines = (int)(SANE_UNFIX(ps->effectiveBry - ps->effectiveTly)/MM_PER_INCH*ps->currentResolution);
++ pp->lines = pbb->job.lines;
+ pp->pixels_per_line = pbb->job.pixels_per_line;
+ pp->bytes_per_line = pbb->job.bytes_per_line;
+ }
+@@ -784,8 +815,8 @@ int bb_get_parameters(struct ledm_session *ps, SANE_Parameters *pp, int option)
+ break;
+ case SPO_BEST_GUESS: /* called by xsane & sane_start */
+ /* Set scan parameters based on best guess. */
+- pp->lines = (int)round(SANE_UNFIX(ps->effectiveBry - ps->effectiveTly)/MM_PER_INCH*ps->currentResolution);
+- pp->pixels_per_line = (int)round(SANE_UNFIX(ps->effectiveBrx -ps->effectiveTlx)/MM_PER_INCH*ps->currentResolution);
++ pp->lines = (int)(SANE_UNFIX(ps->effectiveBry - ps->effectiveTly)/MM_PER_INCH*ps->currentResolution);
++ pp->pixels_per_line = ps->image_traits.iPixelsPerRow;
+ pp->bytes_per_line = BYTES_PER_LINE(pp->pixels_per_line, pp->depth * factor);
+ break;
+ default:
+@@ -889,7 +920,7 @@ SANE_Status bb_start_scan(struct ledm_session *ps)
+ (int) ((ps->currentBrx / 5548.7133) - (ps->currentTlx / 5548.7133)),//<Width>
+ (int) (ps->currentTly / 5548.7133),//<YStart>
+ (int) ((ps->currentBry / 5548.7133) - (ps->currentTly / 5548.7133)),//<Height>
+- "Jpeg",//<Format>
++ (ps->currentCompression == SF_RAW) ? "Raw" : "Jpeg", //<Format>
+ (! strcmp(ce_element[ps->currentScanMode], "Color8")) ? "Color" : (! strcmp(ce_element[ps->currentScanMode], "Gray8")) ? "Gray" : "Gray",//<ColorSpace>
+ ((! strcmp(ce_element[ps->currentScanMode], "Color8")) || (! strcmp(ce_element[ps->currentScanMode], "Gray8"))) ? 8: 8,//<BitDepth>
+ ps->currentInputSource == IS_PLATEN ? is_element[1] : is_element[2],//<InputSource>
+@@ -987,6 +1018,7 @@ SANE_Status bb_start_scan(struct ledm_session *ps)
+ _DBG("bb_start_scan() read_http_payload FAILED len=%d buf=%s\n", len, buf);
+ break;
+ }
++
+ //For a new scan, buf must contain <PreScanPage>.
+ if (NULL == strstr(buf,PRESCANPAGE))
+ { //i.e Paper is not present in Scanner
+@@ -1005,6 +1037,9 @@ SANE_Status bb_start_scan(struct ledm_session *ps)
+ stat = SANE_STATUS_GOOD;
+ goto bugout;
+ }
++ // Parse buf here
++ parse_status_elements(buf, len, &pbb->job);
++
+ usleep(500000);//0.5 sec delay
+ }//end while()
+
+diff --git a/scan/sane/ledm.c b/scan/sane/ledm.c
+index 9a1ff02..8f04338 100644
+--- a/scan/sane/ledm.c
++++ b/scan/sane/ledm.c
+@@ -170,11 +170,11 @@ static int set_scan_mode_side_effects(struct ledm_session *ps, enum COLOR_ENTRY
+ case CE_GRAY8:
+ case CE_COLOR8:
+ default:
+-// ps->compressionList[j] = STR_COMPRESSION_NONE;
+-// ps->compressionMap[j++] = SF_RAW;
++ ps->compressionList[j] = STR_COMPRESSION_NONE;
++ ps->compressionMap[j++] = SF_RAW;
+ ps->compressionList[j] = STR_COMPRESSION_JPEG;
+ ps->compressionMap[j++] = SF_JPEG;
+- ps->currentCompression = SF_JPEG;
++ ps->currentCompression = SF_RAW;
+ ps->option[LEDM_OPTION_JPEG_QUALITY].cap |= SANE_CAP_SOFT_SELECT; /* enable jpeg quality */
+ break;
+ }
+@@ -679,7 +679,7 @@ SANE_Status ledm_control_option(SANE_Handle handle, SANE_Int option, SANE_Action
+ }
+ else
+ { /* Set default. */
+- ps->currentCompression = SF_JPEG;
++ ps->currentCompression = SF_RAW;
+ stat = SANE_STATUS_GOOD;
+ }
+ break;
+@@ -984,7 +984,9 @@ SANE_Status ledm_start(SANE_Handle handle)
+ }
+ }
+ else
+- ipGetImageTraits(ps->ip_handle, NULL, &ps->image_traits); /* get valid image traits */
++ {
++ ipGetOutputTraits(ps->ip_handle, &ps->image_traits); /* get valid image traits */
++ }
+
+ stat = SANE_STATUS_GOOD;
+
diff --git a/debian/patches/0016-Fix-download-and-installation-of-HP-s-proprietary-pl.patch b/debian/patches/0016-Fix-download-and-installation-of-HP-s-proprietary-pl.patch
new file mode 100644
index 000000000..cc11b0733
--- /dev/null
+++ b/debian/patches/0016-Fix-download-and-installation-of-HP-s-proprietary-pl.patch
@@ -0,0 +1,38 @@
+From: Till Kamppeter <till.kamppeter@gmail.com>
+Date: Fri, 22 Jul 2016 09:33:06 +0200
+Subject: Fix download and installation of HP's proprietary plug-in in Python3
+ environments
+
+LP: #1422004
+---
+ base/pkit.py | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/base/pkit.py b/base/pkit.py
+index f3f1e44..6a848ef 100644
+--- a/base/pkit.py
++++ b/base/pkit.py
+@@ -35,9 +35,12 @@ import dbus
+ import dbus.service
+
+ if PY3:
+- from gi import _gobject as gobject
++ try:
++ from gi._gobject import MainLoop
++ except:
++ from gi.repository.GLib import MainLoop
+ else:
+- import gobject
++ from gobject import MainLoop
+
+ import warnings
+ # Ignore: .../dbus/connection.py:242: DeprecationWarning: object.__init__() takes no parameters
+@@ -207,7 +210,7 @@ if utils.to_bool(sys_conf.get('configure', 'policy-kit')):
+ super(BackendService, self).__init__(connection, path)
+
+ self.name = dbus.service.BusName(self.SERVICE_NAME, connection)
+- self.loop = gobject.MainLoop()
++ self.loop = MainLoop()
+ self.version = 0
+ log.set_level("debug")
+
diff --git a/debian/patches/0017-In-hp-scan-s-manpage-sort-PAGE_SIZES-in-help-for-the.patch b/debian/patches/0017-In-hp-scan-s-manpage-sort-PAGE_SIZES-in-help-for-the.patch
new file mode 100644
index 000000000..87124f6ff
--- /dev/null
+++ b/debian/patches/0017-In-hp-scan-s-manpage-sort-PAGE_SIZES-in-help-for-the.patch
@@ -0,0 +1,22 @@
+From: Didier Raboud <odyx@debian.org>
+Date: Fri, 22 Jul 2016 09:33:07 +0200
+Subject: In hp-scan's manpage, sort PAGE_SIZES in help,
+ for the manpage to be reproducibly created
+
+---
+ scan.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/scan.py b/scan.py
+index 0a98644..585322b 100755
+--- a/scan.py
++++ b/scan.py
+@@ -289,7 +289,7 @@ try:
+ ("", "Coordinates are relative to the upper left corner of the scan area.", "option", False),
+ ("", "Units are specified by -t/--units (default is 'mm').", "option", False),
+ ("Specify the scan area based on a paper size:", "--size=<paper size name>", "option", False),
+- ("", "where <paper size name> is one of: %s" % ', '.join(list(PAGE_SIZES.keys())), "option", False),
++ ("", "where <paper size name> is one of: %s" % ', '.join(sorted(list(PAGE_SIZES.keys()))), "option", False),
+ utils.USAGE_SPACE,
+ ("[OPTIONS] ('file' dest)", "", "header", False),
+ ("Filename for 'file' destination:", "-o<file> or -f<file> or --file=<file> or --output=<file>", "option", False),
diff --git a/debian/patches/0018-Install-check-plugin.py-as-a-script.patch b/debian/patches/0018-Install-check-plugin.py-as-a-script.patch
new file mode 100644
index 000000000..e129db08f
--- /dev/null
+++ b/debian/patches/0018-Install-check-plugin.py-as-a-script.patch
@@ -0,0 +1,29 @@
+From: Julian Andres Klode <jak@debian.org>
+Date: Fri, 22 Jul 2016 09:33:08 +0200
+Subject: Install check-plugin.py as a script
+
+The installer installs check-plugin.py as hp-check-plugin, do the same from the Makefile.
+
+Origin: vendor
+Forwarded: no
+---
+ Makefile.am | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 54a46b5..2db759c 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -178,10 +178,10 @@ if !HPLIP_CLASS_DRIVER
+ dist_cmd_SCRIPTS = align.py info.py print.py toolbox.py clean.py colorcal.py unload.py testpage.py makeuri.py check.py fab.py levels.py \
+ sendfax.py setup.py makecopies.py probe.py timedate.py firmware.py scan.py systray.py plugin.py linefeedcal.py pqdiag.py \
+ faxsetup.py devicesettings.py printsettings.py query.py pkservice.py wificonfig.py diagnose_plugin.py uninstall.py \
+- upgrade.py config_usb_printer.py diagnose_queues.py logcapture.py doctor.py uiscan.py
++ upgrade.py config_usb_printer.py diagnose_queues.py logcapture.py doctor.py uiscan.py check-plugin.py
+
+ homedir = $(hplipdir)
+-dist_home_DATA = check-plugin.py
++dist_home_DATA =
+ dist_home_DATA += hplip_clean.sh
+
+ # base
diff --git a/debian/patches/0019-LaserJet-PostScript-4000-PPD-bugfix.patch b/debian/patches/0019-LaserJet-PostScript-4000-PPD-bugfix.patch
new file mode 100644
index 000000000..beb24efc9
--- /dev/null
+++ b/debian/patches/0019-LaserJet-PostScript-4000-PPD-bugfix.patch
@@ -0,0 +1,36 @@
+From: Jean Tourrilhes <jt@hpl.hp.com>
+Date: Fri, 22 Jul 2016 09:33:10 +0200
+Subject: LaserJet PostScript 4000 PPD bugfix
+
+The PostScript PPD for the HP LaserJet 4000 is buggy, and prevent printing complex documents.
+The 4000 and 4050 are pretty much the same printer. The fix was to extract the missing snipset from the PPD for the 4050 and put it in the PPD for the 4000.
+
+Origin: vendor
+Bug: https://bugs.launchpad.net/hplip/+bug/1298194
+Bug-Debian: https://bugs.debian.org/742766
+---
+ prnt/ps/hp-laserjet_4000_series-ps.ppd | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+diff --git a/prnt/ps/hp-laserjet_4000_series-ps.ppd b/prnt/ps/hp-laserjet_4000_series-ps.ppd
+index db1248c..66c4032 100644
+--- a/prnt/ps/hp-laserjet_4000_series-ps.ppd
++++ b/prnt/ps/hp-laserjet_4000_series-ps.ppd
+@@ -97,6 +97,17 @@
+ *SuggestedWaitTimeout: "120"
+ *PrintPSErrors: True
+
++*% =================================
++*% PostScript Patches
++*% =================================
++*JobPatchFile 1: "
++/limitinterpolate { dup type /dicttype eq { dup /Interpolate known { dup /Interpolate get {
++ 1 1 idtransform 2 index /ImageMatrix get dtransform exch abs 1 exch div exch abs 1 exch div 2 copy lt
++ { exch }if pop 4 lt { dup /Interpolate false put } if } if } if } if
++} bind def
++/image { limitinterpolate systemdict /image get exec } bind def
++/imagemask { limitinterpolate systemdict /imagemask get exec } bind def"
++*End
+
+ *% ===================================
+ *% Installable Options
diff --git a/debian/patches/0020-Patch-UI-files-to-match-upstream-produced-.py-code.patch b/debian/patches/0020-Patch-UI-files-to-match-upstream-produced-.py-code.patch
new file mode 100644
index 000000000..e38ebecca
--- /dev/null
+++ b/debian/patches/0020-Patch-UI-files-to-match-upstream-produced-.py-code.patch
@@ -0,0 +1,65 @@
+From: Julian Andres Klode <jak@debian.org>
+Date: Fri, 22 Jul 2016 09:33:11 +0200
+Subject: Patch UI files to match upstream produced .py code
+
+The update tab was manually patched out in the generated code, and the label_2 was renamed in the code.
+---
+ ui5/devmgr5_base.ui | 31 -------------------------------
+ ui5/wifisetupdialog_base.ui | 2 +-
+ 2 files changed, 1 insertion(+), 32 deletions(-)
+
+diff --git a/ui5/devmgr5_base.ui b/ui5/devmgr5_base.ui
+index 7d0c7f5..09f72bf 100644
+--- a/ui5/devmgr5_base.ui
++++ b/ui5/devmgr5_base.ui
+@@ -547,37 +547,6 @@
+ </item>
+ </layout>
+ </widget>
+- <widget class="QWidget" name="tab_3">
+- <attribute name="title">
+- <string>Page</string>
+- </attribute>
+- <widget class="QPushButton" name="pushButton">
+- <property name="geometry">
+- <rect>
+- <x>280</x>
+- <y>40</y>
+- <width>96</width>
+- <height>27</height>
+- </rect>
+- </property>
+- <property name="text">
+- <string>Install now</string>
+- </property>
+- </widget>
+- <widget class="QLabel" name="label">
+- <property name="geometry">
+- <rect>
+- <x>30</x>
+- <y>45</y>
+- <width>251</width>
+- <height>17</height>
+- </rect>
+- </property>
+- <property name="text">
+- <string>New version of HPLIP-x.x.x is available</string>
+- </property>
+- </widget>
+- </widget>
+ </widget>
+ </widget>
+ </item>
+diff --git a/ui5/wifisetupdialog_base.ui b/ui5/wifisetupdialog_base.ui
+index a85d14c..4e33640 100644
+--- a/ui5/wifisetupdialog_base.ui
++++ b/ui5/wifisetupdialog_base.ui
+@@ -47,7 +47,7 @@
+ </widget>
+ </item>
+ <item row="2" column="0" colspan="3">
+- <widget class="QLabel" name="label_2">
++ <widget class="QLabel" name="MainTitleLabel">
+ <property name="text">
+ <string>&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+ p, li { white-space: pre-wrap; }
diff --git a/debian/patches/0021-Add-include-cups-ppd.h-in-various-places-as-CUPS-2.2.patch b/debian/patches/0021-Add-include-cups-ppd.h-in-various-places-as-CUPS-2.2.patch
new file mode 100644
index 000000000..9b4814cec
--- /dev/null
+++ b/debian/patches/0021-Add-include-cups-ppd.h-in-various-places-as-CUPS-2.2.patch
@@ -0,0 +1,49 @@
+From: Till Kamppeter <till.kamppeter@canonical.com>
+Date: Sat, 24 Sep 2016 10:37:20 +0200
+Subject: Add 'include <cups/ppd.h>' in various places as CUPS 2.2 moved some
+ definitions to ppd.h
+
+---
+ configure.in | 2 +-
+ prnt/hpcups/HPCupsFilter.h | 2 ++
+ prnt/hpijs/hpcupsfax.cpp | 1 +
+ 3 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/configure.in b/configure.in
+index 773f357..9ab31d8 100755
+--- a/configure.in
++++ b/configure.in
+@@ -594,7 +594,7 @@ fi
+
+ if test "$class_driver" = "no" && test "$hpijs_only_build" = "no" && test "$hpcups_only_build" = "no"; then
+ AC_CHECK_LIB([cups], [cupsDoFileRequest], [LIBS="$LIBS"], [AC_MSG_ERROR([cannot find libcups support], 9)])
+- AC_CHECK_HEADERS(cups/cups.h, ,[AC_MSG_ERROR([cannot find cups-devel support], 3)])
++ AC_CHECK_HEADERS(cups/cups.h cups/ppd.h, ,[AC_MSG_ERROR([cannot find cups-devel support], 3)])
+ if test "$libusb01_build" = "yes"; then
+ AC_CHECK_LIB([usb], [usb_init], [LIBS="$LIBS"], [AC_MSG_ERROR([cannot find libusb support], 2)])
+ AC_CHECK_HEADERS(usb.h, ,[AC_MSG_ERROR([cannot find libusb-devel support], 11)])
+diff --git a/prnt/hpcups/HPCupsFilter.h b/prnt/hpcups/HPCupsFilter.h
+index 3d003d5..60f8580 100644
+--- a/prnt/hpcups/HPCupsFilter.h
++++ b/prnt/hpcups/HPCupsFilter.h
+@@ -38,6 +38,8 @@
+ #include <cups/ppd.h>
+ #include "dbuscomm.h"
+
++#include <cups/ppd.h>
++
+ #define DBITMAPFILEHEADER 14
+ #define DBITMAPINFOHEADER 40
+
+diff --git a/prnt/hpijs/hpcupsfax.cpp b/prnt/hpijs/hpcupsfax.cpp
+index 8514775..994e50f 100644
+--- a/prnt/hpijs/hpcupsfax.cpp
++++ b/prnt/hpijs/hpcupsfax.cpp
+@@ -43,6 +43,7 @@
+ #include <arpa/inet.h>
+ #include <math.h>
+ #include <cups/cups.h>
++#include <cups/ppd.h>
+ #include <cups/raster.h>
+ #include <string>
+ #ifdef FALSE
diff --git a/debian/patches/0022-Fix-list-wrapping-in-scan.py-to-fix-generated-manpag.patch b/debian/patches/0022-Fix-list-wrapping-in-scan.py-to-fix-generated-manpag.patch
new file mode 100644
index 000000000..2a28da334
--- /dev/null
+++ b/debian/patches/0022-Fix-list-wrapping-in-scan.py-to-fix-generated-manpag.patch
@@ -0,0 +1,23 @@
+From: Didier Raboud <odyx@debian.org>
+Date: Mon, 3 Oct 2016 11:16:48 +0200
+Subject: Fix list wrapping in scan.py to fix generated manpage
+
+---
+ scan.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/scan.py b/scan.py
+index 585322b..1e93982 100755
+--- a/scan.py
++++ b/scan.py
+@@ -248,8 +248,8 @@ try:
+ extra_options=[utils.USAGE_SPACE,
+ ("[OPTIONS] (General)", "", "header", False),
+ ("Scan destinations:", "-s<dest_list> or --dest=<dest_list>", "option", False),
+- ("", "where <dest_list> 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),
++ ("", "where <dest_list> 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<mode> or --mode=<mode>. Where <mode> is 'gray'\*, 'color' or 'lineart'.", "option", False),
+ ("Scanning resolution:", "-r<resolution_in_dpi> or --res=<resolution_in_dpi> or --resolution=<resolution_in_dpi>", "option", False),
+ ("", "where 300 is default.", "option", False),
diff --git a/debian/patches/0023-Fix-handling-of-unicode-filenames-in-sixext.py.patch b/debian/patches/0023-Fix-handling-of-unicode-filenames-in-sixext.py.patch
new file mode 100644
index 000000000..9a2ffdd0b
--- /dev/null
+++ b/debian/patches/0023-Fix-handling-of-unicode-filenames-in-sixext.py.patch
@@ -0,0 +1,28 @@
+From: Gaurav Sood <gaurav-sood@invalid-email.launchpad.net>
+Date: Thu, 4 May 2017 18:32:08 +0200
+Subject: Fix handling of unicode filenames in sixext.py
+
+LP: #1480152
+Closes: #861731
+---
+ base/sixext.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+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/debian/patches/0024-Make-dat2drv-and-locateppd-build-dependent-of-class-.patch b/debian/patches/0024-Make-dat2drv-and-locateppd-build-dependent-of-class-.patch
new file mode 100644
index 000000000..4e3fca456
--- /dev/null
+++ b/debian/patches/0024-Make-dat2drv-and-locateppd-build-dependent-of-class-.patch
@@ -0,0 +1,44 @@
+From: Didier Raboud <odyx@debian.org>
+Date: Mon, 12 Mar 2018 13:37:19 +0100
+Subject: Make dat2drv and locateppd build dependent of class driver enabling;
+ copes with its source code removal from source
+
+---
+ Makefile.am | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 2db759c..b9381e2 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -620,12 +620,14 @@ endif # FAX_BUILD
+ endif # HPCUPS ONLY
+ endif # HPCUPS_INSTALL
+
++if HPLIP_CLASS_DRIVER
+ dat2drvdir = $(hplipdir)
+ dat2drv_PROGRAMS = dat2drv
+ dat2drv_SOURCES = Common.h Dat2drv.cpp Dat2drv.h Normalize.cpp Normalize.h
+ if GCC_GE_47
+ dat2drv_CXXFLAGS = -std=c++11
+ endif
++endif # HPLIP_CLASS_DRIVER
+
+ if HPPS_INSTALL
+ hppsdir = $(cupsfilterdir)
+@@ -636,6 +638,7 @@ hpps_LDADD = -lcups $(DBUS_LIBS)
+ endif #HPPS_INSTALL
+
+
++if HPLIP_CLASS_DRIVER
+ #locate driver
+ locatedriverdir = $(hplipdir)
+ locatedriver_PROGRAMS = locatedriver
+@@ -643,7 +646,6 @@ locatedriver_SOURCES = FindPPD.cpp FindPPD.h
+ if GCC_GE_47
+ locatedriver_CXXFLAGS = -std=c++11
+ endif
+-if HPLIP_CLASS_DRIVER
+ dist_locatedriver_DATA = locatedriver
+ endif #HPLIP_CLASS_DRIVER
+
diff --git a/debian/patches/0025-Remove-all-ImageProcessor-functionality-which-is-clo.patch b/debian/patches/0025-Remove-all-ImageProcessor-functionality-which-is-clo.patch
new file mode 100644
index 000000000..0d694d1ec
--- /dev/null
+++ b/debian/patches/0025-Remove-all-ImageProcessor-functionality-which-is-clo.patch
@@ -0,0 +1,112 @@
+From: Didier Raboud <odyx@debian.org>
+Date: Tue, 21 Aug 2018 18:18:10 +0200
+Subject: Remove all ImageProcessor functionality, which is closed-source
+
+---
+ Makefile.am | 14 ++------------
+ prnt/hpcups/HPCupsFilter.cpp | 21 ---------------------
+ 2 files changed, 2 insertions(+), 33 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index b9381e2..839561b 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -166,7 +166,7 @@ if !HPLIP_CLASS_DRIVER
+ dist_hplip_SCRIPTS = hpssd.py __init__.py hpdio.py
+ endif #HPLIP_CLASS_DRIVER
+
+-dist_noinst_DATA += prnt/drv/hpijs.drv.in.template prnt/drv/hpcups.drv.in.template prnt/hpcups/libImageProcessor-x86_64.so prnt/hpcups/libImageProcessor-x86_32.so
++dist_noinst_DATA += prnt/drv/hpijs.drv.in.template prnt/drv/hpcups.drv.in.template
+ dist_noinst_SCRIPTS += dat2drv.py install.py hplip-install init-suse-firewall init-iptables-firewall class_rpm_build.sh hplipclassdriver.spec createPPD.sh Makefile_dat2drv hpijs-drv
+
+ if !HPLIP_CLASS_DRIVER
+@@ -594,7 +594,7 @@ hpcups_SOURCES = prnt/hpcups/HPCupsFilter.cpp prnt/hpcups/HPCupsFilter.h prnt/hp
+ prnt/hpcups/ImageProcessor.h
+
+ hpcups_CXXFLAGS = $(APDK_ENDIAN_FLAG) $(DBUS_CFLAGS)
+-hpcups_LDADD = -L./prnt/hpcups/ -ljpeg -ldl -lImageProcessor -lcups -lcupsimage -lz $(DBUS_LIBS)
++hpcups_LDADD = -L./prnt/hpcups/ -ljpeg -ldl -lcups -lcupsimage -lz $(DBUS_LIBS)
+ #else
+ #hpcupsdir = $(cupsfilterdir)
+ #hpcups_PROGRAMS = hpcups
+@@ -686,16 +686,6 @@ endif #HPLIP_CLASS_DRIVER
+
+ install-data-hook:
+ if HPLIP_BUILD
+- if [ \( "$(UNAME)" = "x86_64" -a -d "$(libdir)/" \) ]; then \
+- cp prnt/hpcups/libImageProcessor-x86_64.so $(libdir)/ ; \
+- chmod 775 $(libdir)/libImageProcessor-x86_64.so ; \
+- ln -sf $(libdir)/libImageProcessor-x86_64.so $(libdir)/libImageProcessor.so ; \
+- fi; \
+- if [ \( \( "$(UNAME)" = "i686" -o "$(UNAME)" = "i386" \) -a -d "$(libdir)/" \) ]; then \
+- cp prnt/hpcups/libImageProcessor-x86_32.so $(libdir)/ ; \
+- chmod 775 $(libdir)/libImageProcessor-x86_32.so ; \
+- ln -sf $(libdir)/libImageProcessor-x86_32.so $(libdir)/libImageProcessor.so ; \
+- fi
+ if !HPLIP_CLASS_DRIVER
+ # If scanner build, add hpaio entry to sane dll.conf.
+ if [ "$(scan_build)" = "yes" ]; then \
+diff --git a/prnt/hpcups/HPCupsFilter.cpp b/prnt/hpcups/HPCupsFilter.cpp
+index 5b282d8..0bacfaf 100644
+--- a/prnt/hpcups/HPCupsFilter.cpp
++++ b/prnt/hpcups/HPCupsFilter.cpp
+@@ -31,7 +31,6 @@
+ \*****************************************************************************/
+
+ #include "HPCupsFilter.h"
+-#include "ImageProcessor.h"
+
+ #include <signal.h>
+ #include <sys/wait.h>
+@@ -637,16 +636,10 @@ int HPCupsFilter::processRasterData(cups_raster_t *cups_raster)
+
+
+ sprintf(hpPreProcessedRasterFile, "%s/hp_%s_cups_SwapedPagesXXXXXX",CUPS_TMP_DIR, m_JA.user_name);
+- image_processor_t* imageProcessor = imageProcessorCreate();
+
+ while (cupsRasterReadHeader2(cups_raster, &cups_header))
+ {
+
+- IMAGE_PROCESSOR_ERROR result = imageProcessorStartPage(imageProcessor, &cups_header);
+- if (result != IPE_SUCCESS){
+- dbglog("DEBUG: imageProcessorStartPage failed result = %d\n", result);
+- }
+-
+ current_page_number++;
+
+ if (current_page_number == 1) {
+@@ -745,12 +738,6 @@ int HPCupsFilter::processRasterData(cups_raster_t *cups_raster)
+ color_raster = rgbRaster;
+ black_raster = kRaster;
+
+- result = imageProcessorProcessLine(imageProcessor, m_pPrinterBuffer, cups_header.cupsBytesPerLine);
+- if (result != IPE_SUCCESS){
+- dbglog("DEBUG: imageProcessorProcessLine failed result = %d\n", result);
+- }
+-
+-
+ if ((y == 0) && !is_ljmono) {
+ //For ljmono, make sure that first line is not a blankRaster line.Otherwise printer
+ //may not skip blank lines before actual data
+@@ -780,12 +767,6 @@ int HPCupsFilter::processRasterData(cups_raster_t *cups_raster)
+ }
+ } // for() loop end
+
+- result = imageProcessorEndPage(imageProcessor);
+- if (result != IPE_SUCCESS){
+- dbglog("DEBUG: imageProcessorEndPage failed result = %d\n", result);
+- }
+-
+-
+ m_Job.NewPage();
+ if (err != NO_ERROR) {
+ break;
+@@ -800,8 +781,6 @@ int HPCupsFilter::processRasterData(cups_raster_t *cups_raster)
+ rgbRaster = NULL;
+ }
+
+- imageProcessorDestroy(imageProcessor);
+-
+ unlink(hpPreProcessedRasterFile);
+ return ret_status;
+ }
diff --git a/debian/patches/0026-Call-QMessageBox-constructors-of-PyQT5-with-the-corr.patch b/debian/patches/0026-Call-QMessageBox-constructors-of-PyQT5-with-the-corr.patch
new file mode 100644
index 000000000..ff3c8350a
--- /dev/null
+++ b/debian/patches/0026-Call-QMessageBox-constructors-of-PyQT5-with-the-corr.patch
@@ -0,0 +1,472 @@
+From: Till Kamppeter <till.kamppeter@gmail.com>
+Date: Wed, 3 Oct 2018 15:13:00 +0200
+Subject: Call QMessageBox constructors of PyQT5 with the correct parameters
+
+The whole Python source code of HPLIP contains 40 incorrect calls of
+the QMessageBox constructurs, mostly the list of buttons was given as
+separate arguments instead of a bitwise OR of each button's
+representation value. If the flow of the code hits one of these
+calls (usually when some error or warnings message should be
+displayed or an "Are you sure?" question asked) the GUI app crashes.
+See https://pythonspot.com/pyqt5-messagebox/ for QMessageBox
+documentation.
+This patch corrects all these calls.
+
+Bug-Debian: https://bugs.debian.org/912768
+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1745383
+---
+ ui/devmgr4.py | 16 ++++++++--------
+ ui/faxaddrbookform.py | 6 +++---
+ ui/faxsendjobform.py | 6 +++---
+ ui/firmwaredialog.py | 2 +-
+ ui/makecopiesform.py | 4 ++--
+ ui/nodevicesform.py | 2 +-
+ ui/pluginform2.py | 4 ++--
+ ui/printerform.py | 2 +-
+ ui/settingsdialog.py | 4 ++--
+ ui/setupform.py | 10 +++++-----
+ ui/unloadform.py | 2 +-
+ ui/upgradeform.py | 4 ++--
+ ui5/devmgr5.py | 6 ++----
+ ui5/fabwindow.py | 2 +-
+ ui5/nodevicesdialog.py | 3 +--
+ ui5/plugindialog.py | 2 +-
+ ui5/queuesconf.py | 2 +-
+ ui5/setupdialog.py | 6 +++---
+ 18 files changed, 40 insertions(+), 43 deletions(-)
+
+diff --git a/ui/devmgr4.py b/ui/devmgr4.py
+index cc2552f..a868cca 100644
+--- a/ui/devmgr4.py
++++ b/ui/devmgr4.py
+@@ -1422,7 +1422,7 @@ class DevMgr4(DevMgr4_base):
+ QMessageBox.critical(self,
+ self.caption(),
+ self.__tr("<b>Unable to find an appropriate su/sudo utility to run hp-plugin.</b><p>Install kdesu, gnomesu, or gksu.</p>"),
+- QMessageBox.Ok,
++ QMessageBox.Ok |\
+ QMessageBox.NoButton,
+ QMessageBox.NoButton)
+ else:
+@@ -2854,7 +2854,7 @@ class DevMgr4(DevMgr4_base):
+ x = QMessageBox.critical(self,
+ self.caption(),
+ self.__tr("<b>Annoying Confirmation: Are you sure you want to remove this device?</b>"),
+- QMessageBox.Yes,
++ QMessageBox.Yes |\
+ QMessageBox.No | QMessageBox.Default,
+ QMessageBox.NoButton)
+ if x == QMessageBox.Yes:
+@@ -2949,7 +2949,7 @@ class DevMgr4(DevMgr4_base):
+ QMessageBox.critical(self,
+ self.caption(),
+ error_text,
+- QMessageBox.Ok,
++ QMessageBox.Ok |\
+ QMessageBox.NoButton,
+ QMessageBox.NoButton)
+
+@@ -2958,7 +2958,7 @@ class DevMgr4(DevMgr4_base):
+ QMessageBox.warning(self,
+ self.caption(),
+ msg,
+- QMessageBox.Ok,
++ QMessageBox.Ok |\
+ QMessageBox.NoButton,
+ QMessageBox.NoButton)
+
+@@ -3115,7 +3115,7 @@ class ScrollTestpageView(ScrollView):
+ QMessageBox.information(self,
+ self.caption(),
+ self.__tr("<p><b>A test page should be printing on your printer.</b><p>If the page fails to print, please visit http://hplip.sourceforge.net for troubleshooting and support."),
+- QMessageBox.Ok,
++ QMessageBox.Ok |\
+ QMessageBox.NoButton,
+ QMessageBox.NoButton)
+
+@@ -3130,7 +3130,7 @@ class ScrollTestpageView(ScrollView):
+ QMessageBox.critical(self,
+ self.caption(),
+ error_text,
+- QMessageBox.Ok,
++ QMessageBox.Ok |\
+ QMessageBox.NoButton,
+ QMessageBox.NoButton)
+
+@@ -3272,7 +3272,7 @@ class ScrollColorCalView(ScrollView):
+ QMessageBox.information(self,
+ self.caption(),
+ self.__tr("<p><b>A test page should be printing on your printer.</b><p>If the page fails to print, please visit http://hplip.sourceforge.net for troubleshooting and support."),
+- QMessageBox.Ok,
++ QMessageBox.Ok |\
+ QMessageBox.NoButton,
+ QMessageBox.NoButton)
+
+@@ -3287,7 +3287,7 @@ class ScrollColorCalView(ScrollView):
+ QMessageBox.critical(self,
+ self.caption(),
+ error_text,
+- QMessageBox.Ok,
++ QMessageBox.Ok |\
+ QMessageBox.NoButton,
+ QMessageBox.NoButton)
+
+diff --git a/ui/faxaddrbookform.py b/ui/faxaddrbookform.py
+index 1094622..b233644 100644
+--- a/ui/faxaddrbookform.py
++++ b/ui/faxaddrbookform.py
+@@ -228,7 +228,7 @@ class FaxAddrBookGroupsForm(FaxAddrBookGroupsForm_base):
+ x = QMessageBox.critical(self,
+ self.caption(),
+ self.__tr("<b>Annoying Confirmation: Are you sure you want to delete this group?</b>"),
+- QMessageBox.Yes,
++ QMessageBox.Yes |\
+ QMessageBox.No | QMessageBox.Default,
+ QMessageBox.NoButton)
+ if x == QMessageBox.Yes:
+@@ -421,7 +421,7 @@ class FaxAddrBookForm(FaxAddrBookForm_base):
+ if QMessageBox.critical(self,
+ self.caption(),
+ self.__tr("<b>Annoying Confirmation: Are you sure you want to delete this address book entry?</b>"),
+- QMessageBox.Yes,
++ QMessageBox.Yes |\
+ QMessageBox.No | QMessageBox.Default,
+ QMessageBox.NoButton) == QMessageBox.Yes:
+ db.delete(self.current.entry['name'])
+@@ -451,7 +451,7 @@ class FaxAddrBookForm(FaxAddrBookForm_base):
+ QMessageBox.critical(self,
+ self.caption(),
+ QString(error_text),
+- QMessageBox.Ok,
++ QMessageBox.Ok |\
+ QMessageBox.NoButton,
+ QMessageBox.NoButton)
+
+diff --git a/ui/faxsendjobform.py b/ui/faxsendjobform.py
+index 106215c..69f424c 100644
+--- a/ui/faxsendjobform.py
++++ b/ui/faxsendjobform.py
+@@ -210,7 +210,7 @@ class FaxSendJobForm(QMainWindow):
+ QMessageBox.information(self,
+ self.caption(),
+ self.__tr("<p><b>Fax send completed successfully.</b>"),
+- QMessageBox.Ok,
++ QMessageBox.Ok |\
+ QMessageBox.NoButton,
+ QMessageBox.NoButton)
+
+@@ -219,7 +219,7 @@ class FaxSendJobForm(QMainWindow):
+ QMessageBox.critical(self,
+ self.caption(),
+ error_text,
+- QMessageBox.Ok,
++ QMessageBox.Ok |\
+ QMessageBox.NoButton,
+ QMessageBox.NoButton)
+
+@@ -228,7 +228,7 @@ class FaxSendJobForm(QMainWindow):
+ QMessageBox.warning(self,
+ self.caption(),
+ error_text,
+- QMessageBox.Ok,
++ QMessageBox.Ok |\
+ QMessageBox.NoButton,
+ QMessageBox.NoButton)
+
+diff --git a/ui/firmwaredialog.py b/ui/firmwaredialog.py
+index 16b3133..0bcee11 100644
+--- a/ui/firmwaredialog.py
++++ b/ui/firmwaredialog.py
+@@ -109,7 +109,7 @@ class FirmwareDialog(QDialog, FirmwareDialog_Base):
+ QMessageBox.critical(self,
+ self.caption(),
+ error_text,
+- QMessageBox.Ok,
++ QMessageBox.Ok |\
+ QMessageBox.NoButton,
+ QMessageBox.NoButton)
+
+diff --git a/ui/makecopiesform.py b/ui/makecopiesform.py
+index 27f144b..0fbb573 100644
+--- a/ui/makecopiesform.py
++++ b/ui/makecopiesform.py
+@@ -156,7 +156,7 @@ class MakeCopiesForm(QMainWindow):
+ QMessageBox.critical(self,
+ self.caption(),
+ error_text,
+- QMessageBox.Ok,
++ QMessageBox.Ok |\
+ QMessageBox.NoButton,
+ QMessageBox.NoButton)
+
+@@ -164,7 +164,7 @@ class MakeCopiesForm(QMainWindow):
+ QMessageBox.warning(self,
+ self.caption(),
+ msg,
+- QMessageBox.Ok,
++ QMessageBox.Ok |\
+ QMessageBox.NoButton,
+ QMessageBox.NoButton)
+
+diff --git a/ui/nodevicesform.py b/ui/nodevicesform.py
+index 01f6ae5..57a6963 100644
+--- a/ui/nodevicesform.py
++++ b/ui/nodevicesform.py
+@@ -67,7 +67,7 @@ class NoDevicesForm(NoDevicesForm_base):
+ QMessageBox.critical(self,
+ self.caption(),
+ self.__tr("<b>An error occurred.</b><p>Please re-start the Device Manager and try again."),
+- QMessageBox.Ok,
++ QMessageBox.Ok |\
+ QMessageBox.NoButton,
+ QMessageBox.NoButton)
+
+diff --git a/ui/pluginform2.py b/ui/pluginform2.py
+index 64e64aa..76cb023 100644
+--- a/ui/pluginform2.py
++++ b/ui/pluginform2.py
+@@ -173,7 +173,7 @@ class PluginForm2(PluginForm2_base):
+ QMessageBox.critical(self,
+ self.caption(),
+ error_text,
+- QMessageBox.Ok,
++ QMessageBox.Ok |\
+ QMessageBox.NoButton,
+ QMessageBox.NoButton)
+
+@@ -181,7 +181,7 @@ class PluginForm2(PluginForm2_base):
+ QMessageBox.information(self,
+ self.caption(),
+ text,
+- QMessageBox.Ok,
++ QMessageBox.Ok |\
+ QMessageBox.NoButton,
+ QMessageBox.NoButton)
+
+diff --git a/ui/printerform.py b/ui/printerform.py
+index 0c6c4f3..7c10ab0 100644
+--- a/ui/printerform.py
++++ b/ui/printerform.py
+@@ -154,7 +154,7 @@ class PrinterForm(QMainWindow):
+ QMessageBox.critical(self,
+ self.caption(),
+ error_text,
+- QMessageBox.Ok,
++ QMessageBox.Ok |\
+ QMessageBox.NoButton,
+ QMessageBox.NoButton)
+
+diff --git a/ui/settingsdialog.py b/ui/settingsdialog.py
+index 92da225..24f02fd 100644
+--- a/ui/settingsdialog.py
++++ b/ui/settingsdialog.py
+@@ -146,7 +146,7 @@ class SettingsDialog(SettingsDialog_base):
+ ## QMessageBox.warning(self,
+ ## self.caption(),
+ ## self.__tr("<b>One or more email addresses are missing.</b><p>Please enter this information and try again."),
+-## QMessageBox.Ok,
++## QMessageBox.Ok |\
+ ## QMessageBox.NoButton,
+ ## QMessageBox.NoButton)
+ ## return
+@@ -163,7 +163,7 @@ class SettingsDialog(SettingsDialog_base):
+ ## QMessageBox.information(self,
+ ## self.caption(),
+ ## self.__tr("<p><b>Please check your email for a test message.</b><p>If the message doesn't arrive, please check your settings and try again."),
+-## QMessageBox.Ok,
++## QMessageBox.Ok |\
+ ## QMessageBox.NoButton,
+ ## QMessageBox.NoButton)
+
+diff --git a/ui/setupform.py b/ui/setupform.py
+index 307917b..78863fd 100644
+--- a/ui/setupform.py
++++ b/ui/setupform.py
+@@ -602,7 +602,7 @@ class SetupForm(SetupForm_base):
+ if ( QMessageBox.warning(self,
+ self.caption(),
+ warn_text,
+- QMessageBox.Yes,
++ QMessageBox.Yes |\
+ QMessageBox.No,
+ QMessageBox.NoButton) == QMessageBox.Yes ):
+
+@@ -804,7 +804,7 @@ class SetupForm(SetupForm_base):
+ if QMessageBox.critical(self,
+ self.caption(),
+ error_text,
+- QMessageBox.Retry | QMessageBox.Default,
++ QMessageBox.Retry | QMessageBox.Default |\
+ QMessageBox.Cancel | QMessageBox.Escape,
+ QMessageBox.NoButton) == QMessageBox.Cancel:
+ break
+@@ -832,7 +832,7 @@ class SetupForm(SetupForm_base):
+ if QMessageBox.critical(self,
+ self.caption(),
+ error_text,
+- QMessageBox.Retry | QMessageBox.Default,
++ QMessageBox.Retry | QMessageBox.Default |\
+ QMessageBox.Cancel | QMessageBox.Escape,
+ QMessageBox.NoButton) == QMessageBox.Cancel:
+ break
+@@ -1003,7 +1003,7 @@ class SetupForm(SetupForm_base):
+ QMessageBox.critical(self,
+ self.caption(),
+ error_text,
+- QMessageBox.Ok,
++ QMessageBox.Ok |\
+ QMessageBox.NoButton,
+ QMessageBox.NoButton)
+
+@@ -1011,7 +1011,7 @@ class SetupForm(SetupForm_base):
+ QMessageBox.warning(self,
+ self.caption(),
+ error_text,
+- QMessageBox.Ok,
++ QMessageBox.Ok |\
+ QMessageBox.NoButton,
+ QMessageBox.NoButton)
+
+diff --git a/ui/unloadform.py b/ui/unloadform.py
+index 8397a68..ae363e0 100644
+--- a/ui/unloadform.py
++++ b/ui/unloadform.py
+@@ -135,7 +135,7 @@ class UnloadForm(QMainWindow):
+ QMessageBox.critical(self,
+ self.caption(),
+ error_text,
+- QMessageBox.Ok,
++ QMessageBox.Ok |\
+ QMessageBox.NoButton,
+ QMessageBox.NoButton)
+
+diff --git a/ui/upgradeform.py b/ui/upgradeform.py
+index 6b9acf5..d0b4184 100644
+--- a/ui/upgradeform.py
++++ b/ui/upgradeform.py
+@@ -118,7 +118,7 @@ class UpgradeForm(UpgradeForm_base):
+ QMessageBox.critical(self,
+ self.caption(),
+ error_text,
+- QMessageBox.Ok,
++ QMessageBox.Ok |\
+ QMessageBox.NoButton,
+ QMessageBox.NoButton)
+
+@@ -126,7 +126,7 @@ class UpgradeForm(UpgradeForm_base):
+ QMessageBox.information(self,
+ self.caption(),
+ text,
+- QMessageBox.Ok,
++ QMessageBox.Ok |\
+ QMessageBox.NoButton,
+ QMessageBox.NoButton)
+
+diff --git a/ui5/devmgr5.py b/ui5/devmgr5.py
+index 498151c..1816a9d 100644
+--- a/ui5/devmgr5.py
++++ b/ui5/devmgr5.py
+@@ -139,8 +139,7 @@ class PluginInstall(QObject):
+ install_plugin = QMessageBox.warning(self.parent,
+ self.parent.windowTitle(),
+ self.__tr("<b>The HPLIP plugin is already installed.</b><p>Do you want to continue and re-install it?"),
+- QMessageBox.Yes,
+- QMessageBox.No,
++ QMessageBox.Yes | QMessageBox.No,
+ QMessageBox.NoButton) == QMessageBox.Yes
+
+ if install_plugin:
+@@ -149,8 +148,7 @@ class PluginInstall(QObject):
+ QMessageBox.critical(self.parent,
+ self.parent.windowTitle(),
+ self.__tr("<b>Unable to find an appropriate su/sudo utility to run hp-plugin.</b><p>Install kdesu, gnomesu, or gksu.</p>"),
+- QMessageBox.Ok,
+- QMessageBox.NoButton,
++ QMessageBox.Ok | QMessageBox.NoButton,
+ QMessageBox.NoButton)
+
+
+diff --git a/ui5/fabwindow.py b/ui5/fabwindow.py
+index 488b6bb..0b95c94 100644
+--- a/ui5/fabwindow.py
++++ b/ui5/fabwindow.py
+@@ -344,7 +344,7 @@ class FABWindow(QMainWindow, Ui_MainWindow):
+ new_name = to_unicode(self.NameLineEdit.text())
+ if new_name != self.name:
+ if QMessageBox.question(self, self.__tr("Rename?"), "Rename '%s' to '%s'?"%(self.name,new_name), \
+- QMessageBox.Yes | QMessageBox.No) == QMessageBox.Yes:
++ QMessageBox.Yes | QMessageBox.No, QMessageBox.No) == QMessageBox.Yes:
+
+ self.db.rename(self.name, new_name)
+ log.debug("Rename %s to %s" % (self.name, new_name))
+diff --git a/ui5/nodevicesdialog.py b/ui5/nodevicesdialog.py
+index 6083f6d..ca86bfc 100644
+--- a/ui5/nodevicesdialog.py
++++ b/ui5/nodevicesdialog.py
+@@ -64,8 +64,7 @@ class NoDevicesDialog(QDialog, Ui_NoDevicesDialog_base):
+ QMessageBox.critical(self,
+ self.windowTitle(),
+ self.__tr("<b>An error occurred.</b><p>Please re-start the Device Manager and try again."),
+- QMessageBox.Ok,
+- QMessageBox.NoButton,
++ QMessageBox.Ok | QMessageBox.NoButton,
+ QMessageBox.NoButton)
+
+
+diff --git a/ui5/plugindialog.py b/ui5/plugindialog.py
+index e3007f9..1c6b338 100644
+--- a/ui5/plugindialog.py
++++ b/ui5/plugindialog.py
+@@ -252,7 +252,7 @@ class PluginDialog(QDialog, Ui_Dialog):
+
+ if QMessageBox.question(self, " ",
+ self.__tr("<b>%s</b><p>Without this, it is not possible to authenticate and validate the plug-in prior to installation.</p>Do you still want to install the plug-in?" %error_str),
+- QMessageBox.Yes | QMessageBox.No) != QMessageBox.Yes:
++ QMessageBox.Yes | QMessageBox.No, QMessageBox.No) != QMessageBox.Yes:
+
+ self.pluginObj.deleteInstallationFiles(download_plugin_file)
+ self.close()
+diff --git a/ui5/queuesconf.py b/ui5/queuesconf.py
+index cf22064..e3c2a02 100644
+--- a/ui5/queuesconf.py
++++ b/ui5/queuesconf.py
+@@ -245,7 +245,7 @@ class QueuesDiagnose(QDialog, Ui_Dialog):
+
+ if QMessageBox.question(self, " ",
+ self.__tr("<b>%s</b><p>Without this, it is not possible to authenticate and validate this tool prior to installation.</p>Do you still want to run Smart Install disabler?" %error_str),
+- QMessageBox.Yes | QMessageBox.No) == QMessageBox.Yes:
++ QMessageBox.Yes | QMessageBox.No, QMessageBox.No) == QMessageBox.Yes:
+ # Disabling without verification.
+ sts, out = utils.run("sh %s"%smart_install_run)
+
+diff --git a/ui5/setupdialog.py b/ui5/setupdialog.py
+index fbfe5ac..120ee15 100644
+--- a/ui5/setupdialog.py
++++ b/ui5/setupdialog.py
+@@ -873,7 +873,7 @@ class SetupDialog(QDialog, Ui_Dialog):
+ self.windowTitle(),
+ warn_text,
+ QMessageBox.Yes|\
+- QMessageBox.No|\
++ QMessageBox.No,
+ QMessageBox.NoButton) == QMessageBox.Yes ):
+ i = 2
+ while True:
+@@ -1108,7 +1108,7 @@ class SetupDialog(QDialog, Ui_Dialog):
+ if QMessageBox.critical(self,
+ self.windowTitle(),
+ error_text,
+- QMessageBox.Retry | QMessageBox.Default,
++ QMessageBox.Retry | QMessageBox.Default |\
+ QMessageBox.Cancel | QMessageBox.Escape,
+ QMessageBox.NoButton) == QMessageBox.Cancel:
+ break
+@@ -1138,7 +1138,7 @@ class SetupDialog(QDialog, Ui_Dialog):
+ if QMessageBox.critical(self,
+ self.windowTitle(),
+ error_text,
+- QMessageBox.Retry | QMessageBox.Default,
++ QMessageBox.Retry | QMessageBox.Default |\
+ QMessageBox.Cancel | QMessageBox.Escape,
+ QMessageBox.NoButton) == QMessageBox.Cancel:
+ break
diff --git a/debian/patches/0027-Fixed-incomplete-removal-of-hp-toolbox-features-whic.patch b/debian/patches/0027-Fixed-incomplete-removal-of-hp-toolbox-features-whic.patch
new file mode 100644
index 000000000..96a9f4ffd
--- /dev/null
+++ b/debian/patches/0027-Fixed-incomplete-removal-of-hp-toolbox-features-whic.patch
@@ -0,0 +1,40 @@
+From: Till Kamppeter <till.kamppeter@gmail.com>
+Date: Wed, 3 Oct 2018 15:13:00 +0200
+Subject: Fixed incomplete removal of hp-toolbox features,
+ which caused the hp-toolbox not to start
+
+Looking into the ui5/devmgr5.py of the HPLIP Python source code it
+seems that some features got removed by commenting them out, but this
+removal seems not to have been completed, making non-existing objects
+being called during the start of hp-toolbox and so it crashes right
+away.
+
+This patch completes the commenting-out and so makes hp-toolbox start
+up and work again.
+
+Bug-Debian: https://bugs.debian.org/912768
+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1789184
+---
+ ui5/devmgr5.py | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/ui5/devmgr5.py b/ui5/devmgr5.py
+index 1816a9d..c23957a 100644
+--- a/ui5/devmgr5.py
++++ b/ui5/devmgr5.py
+@@ -319,11 +319,11 @@ class DevMgr5(Ui_MainWindow_Derived, Ui_MainWindow, QMainWindow):
+ self.PreferencesAction.setIcon(QIcon(load_pixmap('settings', '16x16')))
+ self.PreferencesAction.triggered.connect(self.PreferencesAction_activated)
+
+- self.DiagnoseQueueAction.setIcon(QIcon(load_pixmap('warning', '16x16')))
+- self.DiagnoseQueueAction.triggered.connect(self.DiagnoseQueueAction_activated)
++ #self.DiagnoseQueueAction.setIcon(QIcon(load_pixmap('warning', '16x16')))
++ #self.DiagnoseQueueAction.triggered.connect(self.DiagnoseQueueAction_activated)
+
+- self.DiagnoseHPLIPAction.setIcon(QIcon(load_pixmap('troubleshoot', '16x16')))
+- self.DiagnoseHPLIPAction.triggered.connect(self.DiagnoseHPLIP_activated)
++ #self.DiagnoseHPLIPAction.setIcon(QIcon(load_pixmap('troubleshoot', '16x16')))
++ #self.DiagnoseHPLIPAction.triggered.connect(self.DiagnoseHPLIP_activated)
+
+ self.ContentsAction.setIcon(QIcon(load_pixmap("help", "16x16")))
+ self.ContentsAction.triggered.connect(self.helpContents)
diff --git a/debian/patches/0028-hp-check-Fix-core.distro-vs.-core.distro_name-mixups.patch b/debian/patches/0028-hp-check-Fix-core.distro-vs.-core.distro_name-mixups.patch
new file mode 100644
index 000000000..5571a1f93
--- /dev/null
+++ b/debian/patches/0028-hp-check-Fix-core.distro-vs.-core.distro_name-mixups.patch
@@ -0,0 +1,51 @@
+From: Francois Gouget <fgouget@free.fr>
+Date: Sat, 6 May 2017 00:00:52 +0200
+Subject: hp-check: Fix core.distro vs. core.distro_name mixups.
+
+core.distro is the index of the distribution and is thus not suitable
+for traces and information messages.
+
+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1688684
+---
+ check.py | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/check.py b/check.py
+index 5d35094..81330b8 100755
+--- a/check.py
++++ b/check.py
+@@ -199,7 +199,7 @@ class DependenciesCheck(object):
+ return
+ elif d == 'hpaio' and not self.scanning_enabled:
+ return
+- elif self.core.distro =="rhel" and "5." in self.distro_version:
++ elif self.core.distro_name =="rhel" and "5." in self.distro_version:
+ if d in ['dbus','python-devel','python-dbus','pyqt4-dbus','libnetsnmp-devel','gcc','make','reportlab','policykit','sane-devel','cups-ddk']:
+ return
+
+@@ -305,14 +305,14 @@ class DependenciesCheck(object):
+ if self.core.distro_version not in vrs and len(vrs):
+ supported_distro_vrs= vrs[len(vrs)-1]
+ log.warn(log.bold("%s-%s version is not supported. Using %s-%s versions dependencies to verify and install..." \
+- %(self.core.distro, self.core.distro_version, self.core.distro, supported_distro_vrs)))
++ %(self.core.distro_name, self.core.distro_version, self.core.distro_name, supported_distro_vrs)))
+
+ tui.header("SYSTEM INFO")
+ Sts, Kernel_info =utils.run("uname -r -v -o")
+ Sts, Host_info =utils.run("uname -n")
+ Sts, Proc_info =utils.run("uname -r -v -o")
+ log.info(" Kernel: %s Host: %s Proc: %s Distribution: %s %s"\
+- %(Kernel_info,Host_info,Proc_info,self.core.distro, self.core.distro_version))
++ %(Kernel_info,Host_info,Proc_info,self.core.distro_name, self.core.distro_version))
+ log.info(" Bitness: %s bit\n"%utils.getBitness())
+ tui.header("HPLIP CONFIGURATION")
+ v = sys_conf.get('hplip', 'version')
+@@ -323,7 +323,7 @@ class DependenciesCheck(object):
+ if self.core.is_auto_installer_support():
+ log.info("HPLIP-Installation: Auto installation is supported for %s distro %s version " %(self.core.distro_name, self.core.distro_version))
+ else:
+- log.warn("HPLIP-Installation: Auto installation is not supported for %s distro %s version " %(self.core.distro, self.core.distro_version))
++ log.warn("HPLIP-Installation: Auto installation is not supported for %s distro %s version " %(self.core.distro_name, self.core.distro_version))
+
+ log.info()
+ log.info(log.bold("Current contents of '/etc/hp/hplip.conf' file:"))
diff --git a/debian/patches/0029-Make-base.g.xint-more-generous-in-what-it-can-take.patch b/debian/patches/0029-Make-base.g.xint-more-generous-in-what-it-can-take.patch
new file mode 100644
index 000000000..08d28b057
--- /dev/null
+++ b/debian/patches/0029-Make-base.g.xint-more-generous-in-what-it-can-take.patch
@@ -0,0 +1,28 @@
+From: Didier Raboud <odyx@debian.org>
+Date: Tue, 6 Nov 2018 17:57:40 +0100
+Subject: Make base.g.xint more generous in what it can take
+
+Fixes hp-doctor in python with version '2.7.15+'
+
+Closes: #912765
+---
+ base/g.py | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/base/g.py b/base/g.py
+index f73e23f..15e67fc 100644
+--- a/base/g.py
++++ b/base/g.py
+@@ -326,9 +326,9 @@ def cleanup_spinner():
+ # Convert string to int and return a list.
+ def xint(ver):
+ try:
+- l = [int(x) for x in ver.split('.')]
+- except:
+- pass
++ l = [int(x.translate(None, '+~')) for x in ver.split('.')]
++ except ValueError:
++ l = []
+ return l
+
+ # In case of import failure of extension modules, check whether its a mixed python environment issue.
diff --git a/debian/patches/0030-Fix-linking-of-libhpipp-and-the-ext-python-extension.patch b/debian/patches/0030-Fix-linking-of-libhpipp-and-the-ext-python-extension.patch
new file mode 100644
index 000000000..430396fb4
--- /dev/null
+++ b/debian/patches/0030-Fix-linking-of-libhpipp-and-the-ext-python-extension.patch
@@ -0,0 +1,58 @@
+From: Didier Raboud <odyx@debian.org>
+Date: Thu, 6 Dec 2018 20:37:59 +0100
+Subject: Fix linking of libhpipp and the *ext python extensions
+
+Closes: #886391
+---
+ Makefile.am | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 839561b..a704cdd 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -306,7 +306,7 @@ dist_pcard_DATA = pcard/__init__.py pcard/photocard.py
+ # pcardext
+ pcardextdir = $(pyexecdir)
+ pcardext_LTLIBRARIES = pcardext.la
+-pcardext_la_LDFLAGS = -module -avoid-version
++pcardext_la_LDFLAGS = -module -avoid-version -lpython$(PYTHON_VERSION)m
+ pcardext_la_SOURCES = pcard/pcardext/pcardext.c pcard/fat.c
+ pcardext_la_CFLAGS = -I$(PYTHONINCLUDEDIR)
+
+@@ -321,7 +321,7 @@ lib_LTLIBRARIES += libhpipp.la
+ libhpipp_la_SOURCES = protocol/hp_ipp.c protocol/hp_ipp.h protocol/hp_ipp_i.h
+ libhpipp_la_CFLAGS = -DCONFDIR=\"$(hplip_confdir)\"
+ libhpipp_la_LDFLAGS = -version-info 0:1:0
+-libhpipp_la_LIBADD = libhpmud.la
++libhpipp_la_LIBADD = -lcups libhpmud.la
+
+ # cupsext
+ cupsextdir = $(pyexecdir)
+@@ -329,7 +329,7 @@ cupsext_LTLIBRARIES = cupsext.la
+ cupsext_la_LDFLAGS = -module -avoid-version
+ cupsext_la_SOURCES = prnt/cupsext/cupsext.c prnt/cupsext/cupsext.h
+ cupsext_la_CFLAGS = -I$(PYTHONINCLUDEDIR) -Iprotocol
+-cupsext_la_LIBADD = -lcups libhpipp.la
++cupsext_la_LIBADD = -lcups -lpython$(PYTHON_VERSION)m libhpipp.la
+ endif #HPLIP_CLASS_DRIVER
+
+ if !HPLIP_CLASS_DRIVER
+@@ -341,7 +341,7 @@ dist_scan_DATA = scan/__init__.py scan/sane.py
+ # scanext
+ scanextdir = $(pyexecdir)
+ scanext_LTLIBRARIES = scanext.la
+-scanext_la_LDFLAGS = -module -avoid-version -lsane
++scanext_la_LDFLAGS = -module -avoid-version -lsane -lpython$(PYTHON_VERSION)m
+ scanext_la_SOURCES = scan/scanext/scanext.c
+ scanext_la_CFLAGS = -I$(PYTHONINCLUDEDIR)
+ endif #SCAN_BUILD
+@@ -351,7 +351,7 @@ endif #!HPLIP_CLASS_DRIVER
+ if !HPLIP_CLASS_DRIVER
+ hpmudextdir = $(pyexecdir)
+ hpmudext_LTLIBRARIES = hpmudext.la
+-hpmudext_la_LDFLAGS = -module -avoid-version
++hpmudext_la_LDFLAGS = -module -avoid-version -lpython$(PYTHON_VERSION)m
+ hpmudext_la_SOURCES = io/mudext/hpmudext.c
+ hpmudext_la_CFLAGS = -I$(PYTHONINCLUDEDIR)
+ hpmudext_la_LIBADD = libhpmud.la
diff --git a/debian/patches/0031-Fix-some-typos-in-BUG-and-DBG-messages.patch b/debian/patches/0031-Fix-some-typos-in-BUG-and-DBG-messages.patch
new file mode 100644
index 000000000..e3d54491d
--- /dev/null
+++ b/debian/patches/0031-Fix-some-typos-in-BUG-and-DBG-messages.patch
@@ -0,0 +1,95 @@
+From: Didier Raboud <odyx@debian.org>
+Date: Fri, 13 Sep 2019 17:22:20 +0200
+Subject: =?utf-8?q?Fix_some_typos_in_BUG=C2=A0and_DBG=C2=A0messages?=
+
+---
+ common/utils.c | 4 ++--
+ prnt/backend/hp.c | 2 +-
+ prnt/hpcups/LJZjStream.cpp | 2 +-
+ protocol/hp_ipp.c | 4 ++--
+ scan/sane/saneopts.h | 2 +-
+ 5 files changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/common/utils.c b/common/utils.c
+index d8ecee9..e7c5085 100644
+--- a/common/utils.c
++++ b/common/utils.c
+@@ -252,7 +252,7 @@ void *get_library_symbol(void *pLibHandler, const char *szSymbol)
+ void *pSymHandler = NULL;
+ if (pLibHandler == NULL)
+ {
+- BUG("Invalid Library hanlder\n");
++ BUG("Invalid Library handler\n");
+ return NULL;
+ }
+
+@@ -274,7 +274,7 @@ void unload_library(void *pLibHandler)
+ if (pLibHandler)
+ dlclose(pLibHandler);
+ else
+- BUG("Invalid Library hanlder pLibHandler = NULL.\n");
++ BUG("Invalid Library handler pLibHandler = NULL.\n");
+ }
+
+ int createTempFile(char* szFileName, FILE** pFilePtr)
+diff --git a/prnt/backend/hp.c b/prnt/backend/hp.c
+index 07713b2..066866e 100644
+--- a/prnt/backend/hp.c
++++ b/prnt/backend/hp.c
+@@ -666,7 +666,7 @@ static void save_out_file(int fd, int copies, FILE * temp_fp)
+
+ if (NULL == temp_fp)
+ {
+- BUG("ERROR: save_out_file function recieved NULL temp_fp pointer\n");
++ BUG("ERROR: save_out_file function received NULL temp_fp pointer\n");
+ return;
+ }
+
+diff --git a/prnt/hpcups/LJZjStream.cpp b/prnt/hpcups/LJZjStream.cpp
+index 9b06cf8..45a0c7a 100644
+--- a/prnt/hpcups/LJZjStream.cpp
++++ b/prnt/hpcups/LJZjStream.cpp
+@@ -685,7 +685,7 @@ DRIVER_ERROR LJZjStream::preProcessRasterData(cups_raster_t **ppcups_raster, cup
+ return NO_ERROR;
+ }
+
+- dbglog ("DEBUG: Getting Swaped Pages Raster.....\n");
++ dbglog ("DEBUG: Getting Swapped Pages Raster.....\n");
+
+ memcpy(&cups_header, firstpage_cups_header, sizeof(cups_page_header2_t));
+
+diff --git a/protocol/hp_ipp.c b/protocol/hp_ipp.c
+index 24b6b55..9e7c907 100644
+--- a/protocol/hp_ipp.c
++++ b/protocol/hp_ipp.c
+@@ -940,7 +940,7 @@ enum HPMUD_RESULT readChannel(raw_ipp *responseptr, HPMUD_DEVICE hd, HPMUD_CHANN
+ {
+ if(memcmp(&data[*size - CHUNK_DELIMITER_LENGTH], CHUNK_DELIMITER, CHUNK_DELIMITER_LENGTH) == 0)
+ {
+- DBG("Chunk end recieved....\n");
++ DBG("Chunk end received....\n");
+ break;
+ }
+ }
+@@ -949,7 +949,7 @@ enum HPMUD_RESULT readChannel(raw_ipp *responseptr, HPMUD_DEVICE hd, HPMUD_CHANN
+ bytes_remaining -= bytes_read;
+ if(bytes_remaining == 0)
+ {
+- DBG("Complete unchunked data recieved....\n");
++ DBG("Complete unchunked data received....\n");
+ break;
+ }
+ }
+diff --git a/scan/sane/saneopts.h b/scan/sane/saneopts.h
+index fcc460f..2d5a701 100755
+--- a/scan/sane/saneopts.h
++++ b/scan/sane/saneopts.h
+@@ -133,7 +133,7 @@
+
+ #define SANE_NAME_MULTIPICK "multi-pick"
+ #define SANE_TITLE_MULTIPICK SANE_I18N("Multi pick")
+-#define SANE_DESC_MULTIPICK SANE_I18N("Select multipick option for ESCL protocal based devices")
++#define SANE_DESC_MULTIPICK SANE_I18N("Select multipick option for ESCL protocol based devices")
+
+ #define SANE_TITLE_NUM_OPTIONS SANE_I18N("Number of options")
+ #define SANE_TITLE_PREVIEW SANE_I18N("Preview")
diff --git a/debian/patches/0032-Fix-version-pattern-check-to-support-ghostscript-RC-.patch b/debian/patches/0032-Fix-version-pattern-check-to-support-ghostscript-RC-.patch
new file mode 100644
index 000000000..c119fafef
--- /dev/null
+++ b/debian/patches/0032-Fix-version-pattern-check-to-support-ghostscript-RC-.patch
@@ -0,0 +1,26 @@
+From: Didier Raboud <odyx@debian.org>
+Date: Wed, 18 Sep 2019 21:01:21 +0200
+Subject: Fix version pattern check to support ghostscript RC versions
+
+$ gs -v
+GPL Ghostscript RELEASE CANDIDATE 2 9.28 (2019-09-05)
+Copyright (C) 2019 Artifex Software, Inc. All rights reserved.
+
+Without the escaped dot, the version will match as "2 9".
+---
+ installer/dcheck.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/installer/dcheck.py b/installer/dcheck.py
+index ad62c93..a371d15 100644
+--- a/installer/dcheck.py
++++ b/installer/dcheck.py
+@@ -34,7 +34,7 @@ from base import utils, services
+ from base.sixext import to_bytes_utf8
+
+ ver1_pat = re.compile("""(\d+\.\d+\.\d+)""", re.IGNORECASE)
+-ver_pat = re.compile("""(\d+.\d+)""", re.IGNORECASE)
++ver_pat = re.compile("""(\d+\.\d+)""", re.IGNORECASE)
+ PID = 0
+ CMDLINE = 1
+
diff --git a/debian/patches/0033-Fix-the-PIL.Image-version-check-to-work-with-Pillow-.patch b/debian/patches/0033-Fix-the-PIL.Image-version-check-to-work-with-Pillow-.patch
new file mode 100644
index 000000000..14428b42e
--- /dev/null
+++ b/debian/patches/0033-Fix-the-PIL.Image-version-check-to-work-with-Pillow-.patch
@@ -0,0 +1,22 @@
+From: Didier Raboud <odyx@debian.org>
+Date: Wed, 18 Sep 2019 21:09:05 +0200
+Subject: Fix the PIL.Image version check, to work with Pillow > 6
+
+(Debian has Pillow 6.1 from Bullseye on)
+---
+ installer/dcheck.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/installer/dcheck.py b/installer/dcheck.py
+index a371d15..d011c97 100644
+--- a/installer/dcheck.py
++++ b/installer/dcheck.py
+@@ -370,7 +370,7 @@ def get_pil_version():
+ except ImportError:
+ return '-'
+ else:
+- return Image.PILLOW_VERSION
++ return Image.__version__
+
+ def get_libpthread_version():
+ try:
diff --git a/debian/patches/0034-Don-t-gpg-import-but-rely-on-installed-signing_key.a.patch b/debian/patches/0034-Don-t-gpg-import-but-rely-on-installed-signing_key.a.patch
new file mode 100644
index 000000000..f86eaee33
--- /dev/null
+++ b/debian/patches/0034-Don-t-gpg-import-but-rely-on-installed-signing_key.a.patch
@@ -0,0 +1,37 @@
+From: Didier Raboud <odyx@debian.org>
+Date: Wed, 18 Sep 2019 22:11:40 +0200
+Subject: Don't gpg --import, but rely on installed signing_key.asc
+
+---
+ base/validation.py | 10 ++++------
+ 1 file changed, 4 insertions(+), 6 deletions(-)
+
+diff --git a/base/validation.py b/base/validation.py
+index d555f12..dfea16c 100644
+--- a/base/validation.py
++++ b/base/validation.py
+@@ -42,9 +42,7 @@ class DigiSign_Verification(object):
+
+
+ class GPG_Verification(DigiSign_Verification):
+- def __init__(self, pgp_site = 'pgp.mit.edu', key = 0x4ABA2F66DBD5A95894910E0673D770CDA59047B9):
+- self.__pgp_site = pgp_site
+- self.__key = key
++ def __init__(self):
+ self.__gpg = utils.which('gpg',True)
+
+ sts, self.__hplipdir = os_utils.getHPLIPDir()
+@@ -83,10 +81,10 @@ 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)
++ cmd = '%s --homedir %s --no-permission-warning --import %s' \
++ % (self.__gpg, self.__gpg_dir, "/usr/share/hplip/signing-key.asc")
+
+- log.info("Receiving digital keys: %s" % cmd)
++ log.info("Importing digital key")
+ status, output = utils.run(cmd)
+ log.debug(output)
+
diff --git a/debian/patches/0035-Shortcut-distros.dat-finding-to-point-to-where-it-is.patch b/debian/patches/0035-Shortcut-distros.dat-finding-to-point-to-where-it-is.patch
new file mode 100644
index 000000000..0f3a515df
--- /dev/null
+++ b/debian/patches/0035-Shortcut-distros.dat-finding-to-point-to-where-it-is.patch
@@ -0,0 +1,35 @@
+From: Didier Raboud <odyx@debian.org>
+Date: Thu, 19 Sep 2019 08:37:21 +0200
+Subject: Shortcut distros.dat finding to point to where it is
+
+---
+ installer/core_install.py | 16 +---------------
+ 1 file changed, 1 insertion(+), 15 deletions(-)
+
+diff --git a/installer/core_install.py b/installer/core_install.py
+index eaecdc6..d690a52 100644
+--- a/installer/core_install.py
++++ b/installer/core_install.py
+@@ -816,21 +816,7 @@ class CoreInstall(object):
+ return [x for x in data.split(',') if x]
+
+ def load_distros(self):
+- if self.mode == MODE_INSTALLER:
+- distros_dat_file = os.path.join('installer', 'distros.dat')
+-
+- elif self.mode == MODE_CREATE_DOCS:
+- distros_dat_file = os.path.join(
+- '..', '..', 'installer', 'distros.dat')
+-
+- else: # MODE_CHECK
+- distros_dat_file = os.path.join(
+- prop.home_dir, 'installer', 'distros.dat')
+-
+- if not os.path.exists(distros_dat_file):
+- log.debug(
+- "DAT file not found at %s. Using local relative path..." % distros_dat_file)
+- distros_dat_file = os.path.join('installer', 'distros.dat')
++ distros_dat_file = '/usr/share/hplip/installer/distros.dat'
+
+ distros_dat = ConfigBase(distros_dat_file)
+ distros_list = self.__fixup_data(
diff --git a/debian/patches/0036-Accelerate-HTTP-check-by-doing-a-HEAD-not-a-GET.patch b/debian/patches/0036-Accelerate-HTTP-check-by-doing-a-HEAD-not-a-GET.patch
new file mode 100644
index 000000000..af4e2b902
--- /dev/null
+++ b/debian/patches/0036-Accelerate-HTTP-check-by-doing-a-HEAD-not-a-GET.patch
@@ -0,0 +1,56 @@
+From: Didier Raboud <odyx@debian.org>
+Date: Thu, 19 Sep 2019 08:47:34 +0200
+Subject: =?utf-8?q?Accelerate_HTTP=C2=A0check_by_doing_a_HEAD=2C_not_a_GET?=
+
+---
+ base/utils.py | 12 ++++++++----
+ 1 file changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/base/utils.py b/base/utils.py
+index 9f9cfb1..eff780f 100644
+--- a/base/utils.py
++++ b/base/utils.py
+@@ -2248,12 +2248,14 @@ def check_library( so_file_path):
+ return ret_val
+
+
+-def download_via_wget(target):
++def download_via_wget(target, head=False):
+ status = -1
+ wget = which("wget")
+ if target and wget:
+ wget = os.path.join(wget, "wget")
+ cmd = "%s --cache=off --tries=3 --timeout=60 --output-document=- %s" % (wget, target)
++ if head:
++ cmd += " --spider -S"
+ log.debug(cmd)
+ status, output = run(cmd)
+ log.debug("wget returned: %d" % status)
+@@ -2261,12 +2263,14 @@ def download_via_wget(target):
+ log.debug("wget not found")
+ return status
+
+-def download_via_curl(target):
++def download_via_curl(target, head=False):
+ status = -1
+ curl = which("curl")
+ if target and curl:
+ curl = os.path.join(curl, "curl")
+ cmd = "%s --output - --connect-timeout 5 --max-time 10 %s" % (curl, target)
++ if head:
++ cmd += " --head"
+ log.debug(cmd)
+ status, output = run(cmd)
+ log.debug("curl returned: %d" % status)
+@@ -2288,9 +2292,9 @@ def check_network_via_ping(target):
+ return status
+
+ def check_network_connection(url=HTTP_CHECK_TARGET, ping_server=PING_CHECK_TARGET):
+- status = download_via_wget(url)
++ status = download_via_wget(url, head=True)
+ if (status != 0):
+- status = download_via_curl(url)
++ status = download_via_curl(url, head=True)
+ if (status != 0):
+ status = check_network_via_ping(ping_server)
+ return (status == 0)
diff --git a/debian/patches/0037-Enforce-Debian-assumptions.patch b/debian/patches/0037-Enforce-Debian-assumptions.patch
new file mode 100644
index 000000000..f7c49ba7f
--- /dev/null
+++ b/debian/patches/0037-Enforce-Debian-assumptions.patch
@@ -0,0 +1,139 @@
+From: Didier Raboud <odyx@debian.org>
+Date: Sat, 21 Sep 2019 19:02:07 +0200
+Subject: Enforce Debian assumptions:
+
+- The distro version is supported
+- Auto installation is not allowed
+- Do not allow the installer to install "missing" packages by itself
+---
+ installer/core_install.py | 109 +++-------------------------------------------
+ 1 file changed, 5 insertions(+), 104 deletions(-)
+
+diff --git a/installer/core_install.py b/installer/core_install.py
+index d690a52..461a34b 100644
+--- a/installer/core_install.py
++++ b/installer/core_install.py
+@@ -2013,34 +2013,12 @@ class CoreInstall(object):
+ return True
+
+ def validate_distro_version(self):
+- if self.validate_disto():
+- for vers in self.distros[self.distro_name]['versions']:
+- if self.distro_version == vers:
+- return True
+-
+- return False
++ # It's shipped in Debian. It's supported.
++ return True
+
+ def is_auto_installer_support(self, distro_version=DISTRO_VER_UNKNOWN):
+- if not self.distro_name:
+- self.get_distro()
+- try:
+- self.distro_name = self.distros_index[self.distro]
+- except KeyError:
+- log.debug("Auto installation is not supported as Distro Name can't find for distro index [%d]." % (
+- self.distro))
+- return False
+-
+- if distro_version == DISTRO_VER_UNKNOWN:
+- distro_version = self.distro_version
+-
+- if self.distro != DISTRO_UNKNOWN and distro_version != DISTRO_VER_UNKNOWN and self.get_ver_data('supported', False, distro_version):
+- log.debug("Auto installation is supported for Distro =%s version =%s " % (
+- self.distro_name, distro_version))
+- return True
+- else:
+- log.debug("Auto installation is not supported for Distro =%s version =%s " % (
+- self.distro_name, distro_version))
+- return False
++ # No auto install ever.
++ return False
+
+ # Uninstalls the HPLIP package.
+ # Input:
+@@ -2378,83 +2356,6 @@ class CoreInstall(object):
+ log.info("No missing dependencies")
+ return 0
+
+- if mode == INTERACTIVE_MODE:
+- ok, user_input = tui.enter_choice(
+- "Do you want to update repository and Install missing/incompatible packages. (a=install all*, c=custom_install, s=skip):", ['a', 'c', 's'], 'a')
+- if not ok or user_input == 'q':
+- return 1
+- elif user_input == 's':
+- log.info(
+- log.bold("Install manually above missing/incompatible packages."))
+- else:
+- self.close_package_managers()
+-
+- log.info(log.bold("Updating repository"))
+- log.info(log.bold('-' * len("Updating repository")))
+- if pre_depend_cmd:
+- for cmd in pre_depend_cmd:
+- log.info("cmd =%s" % (cmd))
+- sts, out = utils.run(cmd, self.passwordObj)
+- if sts != 0 or "Failed" in out:
+- log.warn(
+- "Failed to update Repository, check if any update/installation is running.")
+-
+- if user_input == 'c':
+- log.info(log.bold("Installing missing/incompatible packages"))
+- log.info(
+- log.bold('-' * len("Installing missing/incompatible packages")))
+- for d in overall_install_cmds:
+- ok, user_input = tui.enter_choice(
+- "Do you want to install '%s' package?(y=yes*, n=no):" % d, ['y', 'n'], 'y')
+- if ok and user_input == 'y':
+- if 'hpaio' in overall_install_cmds[d]:
+- self.update_hpaio()
+- else:
+- log.info("cmd =%s" % overall_install_cmds[d])
+- sts, out = utils.run(overall_install_cmds[
+- d], self.passwordObj)
+- if sts != 0 or "Failed" in out:
+- log.error(
+- "Failed to install '%s' package, please install manually. " % d)
+- if 'cups' in d:
+- if not services.start_service('cups', self.passwordObj):
+- log.error(
+- "Failed to start CUPS service. Please start CUPS manually or restart system.")
+- for cmd in missing_cmd:
+- ok, user_input = tui.enter_choice(
+- "Do you want to run '%s' command?(y=yes*, n=no):" % d, ['y', 'n'], 'y')
+- if ok and user_input == 'y':
+- sts, out = utils.run(cmd, self.passwordObj)
+- if sts != 0 or "Failed" in out:
+- log.error(
+- "Failed to run '%s' command, please run manually. " % d)
+-
+- elif user_input == 'a':
+- log.info(log.bold("Installing Missing/Incompatible packages"))
+- log.info(
+- log.bold('-' * len("Installing Missing/Incompatible packages")))
+- for d in overall_install_cmds:
+- if 'hpaio' in overall_install_cmds[d]:
+- self.update_hpaio()
+- else:
+- log.info("cmd =%s" % overall_install_cmds[d])
+- sts, out = utils.run(overall_install_cmds[
+- d], self.passwordObj)
+- if sts != 0 or "Failed" in out:
+- log.error(
+- "Failed to install '%s' package, please install manually. " % d)
+- if 'cups' in d:
+- if not services.start_service('cups', self.passwordObj):
+- log.error(
+- "Failed to start CUPS sevice. Please start CUPS manually or restart system.")
+- for cmd in missing_cmd:
+- sts, out = utils.run(cmd, self.passwordObj)
+- if sts != 0 or "Failed" in out:
+- log.error(
+- "Failed to run '%s' command, please run manually. " % d)
+-
+- else:
+- log.error("GUI is not yet supported..1")
+- # TBD
++ # Do not allow HPLIP to run APT or anything else, especially not as root.
+
+ return 0
diff --git a/debian/patches/0038-Removed-all-page-size-choices-named-Custom-.-they-br.patch b/debian/patches/0038-Removed-all-page-size-choices-named-Custom-.-they-br.patch
new file mode 100644
index 000000000..7a5c79df4
--- /dev/null
+++ b/debian/patches/0038-Removed-all-page-size-choices-named-Custom-.-they-br.patch
@@ -0,0 +1,96 @@
+From: Till Kamppeter <till.kamppeter@gmail.com>
+Date: Tue, 1 Oct 2019 19:57:58 +0200
+Subject: Removed all page size choices named "Custom". they break with CUPS
+ and are also identical with US Legal
+
+See CUPS upstream issue #5639
+
+Made with:
+ sed -e '/CustomMedia.*"Custom.*612 1008/,+1d' -i prnt/drv/*drv.in.template
+---
+ prnt/drv/hpcups.drv.in.template | 14 --------------
+ prnt/drv/hpijs.drv.in.template | 4 ----
+ 2 files changed, 18 deletions(-)
+
+diff --git a/prnt/drv/hpcups.drv.in.template b/prnt/drv/hpcups.drv.in.template
+index 5895d95..e92b099 100644
+--- a/prnt/drv/hpcups.drv.in.template
++++ b/prnt/drv/hpcups.drv.in.template
+@@ -4118,8 +4118,6 @@ Manufacturer "HP"
+ CustomMedia "JB5.FB/JB5 Borderless 182x257mm" 515.90 728.50 0 0 0 0 "<</cupsInteger0 45/PageSize[515.90 728.50]/ImagingBBox null>>setpagedevice"
+ "<</cupsInteger0 45/PageSize [515.90 728.50]/ImagingBBox null>>setpagedevice"
+
+- CustomMedia "Custom1/Custom 1" 612 1008 8.4 8.4 8.4 8.4 "<</cupsInteger0 101/PageSize[612 1008]/ImagingBBox null>>setpagedevice"
+- "<</cupsInteger0 101/PageSize[612 1008]/ImagingBBox null>>setpagedevice"
+
+ CustomMedia "Env10/#10 Envelope 4.125x9.5in" 297 684 8.4 8.4 8.4 8.4 "<</cupsInteger0 81/PageSize[297 684]/ImagingBBox null>>setpagedevice"
+ "<</cupsInteger0 81/PageSize[297 684]/ImagingBBox null>>setpagedevice"
+@@ -4276,8 +4274,6 @@ Manufacturer "HP"
+ "<</cupsInteger0 65/PageSize[498.72 708.48]/ImagingBBox null>>setpagedevice"
+ CustomMedia "B5/B5 182x257" 515.76 728.4 8.4 8.4 8.4 41.04 "<</cupsInteger0 45/PageSize[515.76 728.4]/ImagingBBox null>>setpagedevice"
+ "<</cupsInteger0 45/PageSize[515.76 728.4]/ImagingBBox null>>setpagedevice"
+- CustomMedia "Custom/Custom1" 612 1008 8.4 8.4 8.4 41.04 "<</cupsInteger0 101/PageSize[612 1008]/ImagingBBox null>>setpagedevice"
+- "<</cupsInteger0 101/PageSize[612 1008]/ImagingBBox null>>setpagedevice"
+ CustomMedia "Env10/#10 Envelope 4.1x9.5in" 296.88 684 8.4 8.4 8.4 41.04 "<</cupsInteger0 81/PageSize[296.88 684]/ImagingBBox null>>setpagedevice"
+ "<</cupsInteger0 81/PageSize[296.88 684]/ImagingBBox null>>setpagedevice"
+ CustomMedia "EnvA2/A2 Envelope 111x146in" 314.88 414 8.4 8.4 8.4 41.04 "<</cupsInteger0 109/PageSize[314.88 414]/ImagingBBox null>>setpagedevice"
+@@ -4395,8 +4391,6 @@ Manufacturer "HP"
+ "<</cupsInteger0 65/PageSize[498.72 708.48]/ImagingBBox null>>setpagedevice"
+ CustomMedia "B5/B5 182x257" 515.76 728.4 8.4 8.4 8.4 36 "<</cupsInteger0 45/PageSize[515.76 728.4]/ImagingBBox null>>setpagedevice"
+ "<</cupsInteger0 45/PageSize[515.76 728.4]/ImagingBBox null>>setpagedevice"
+- CustomMedia "Custom/Custom1" 612 1008 8.4 8.4 8.4 36 "<</cupsInteger0 101/PageSize[612 1008]/ImagingBBox null>>setpagedevice"
+- "<</cupsInteger0 101/PageSize[612 1008]/ImagingBBox null>>setpagedevice"
+ CustomMedia "Env10/#10 Envelope 4.1x9.5in" 296.88 684 8.4 8.4 8.4 36 "<</cupsInteger0 81/PageSize[296.88 684]/ImagingBBox null>>setpagedevice"
+ "<</cupsInteger0 81/PageSize[296.88 684]/ImagingBBox null>>setpagedevice"
+ CustomMedia "EnvA2/A2 Envelope 111x146in" 314.88 414 8.4 8.4 8.4 36 "<</cupsInteger0 109/PageSize[314.88 414]/ImagingBBox null>>setpagedevice"
+@@ -4525,8 +4519,6 @@ Manufacturer "HP"
+ "<</cupsInteger0 65/PageSize[498.72 708.48]/ImagingBBox null>>setpagedevice"
+ CustomMedia "B5/B5 182x257" 515.76 728.4 8.4 8.4 8.4 36 "<</cupsInteger0 45/PageSize[515.76 728.4]/ImagingBBox null>>setpagedevice"
+ "<</cupsInteger0 45/PageSize[515.76 728.4]/ImagingBBox null>>setpagedevice"
+- CustomMedia "Custom/Custom1" 612 1008 8.4 8.4 8.4 36 "<</cupsInteger0 101/PageSize[612 1008]/ImagingBBox null>>setpagedevice"
+- "<</cupsInteger0 101/PageSize[612 1008]/ImagingBBox null>>setpagedevice"
+ CustomMedia "Env10/#10 Envelope 4.1x9.5in" 296.88 684 8.4 8.4 8.4 36 "<</cupsInteger0 81/PageSize[296.88 684]/ImagingBBox null>>setpagedevice"
+ "<</cupsInteger0 81/PageSize[296.88 684]/ImagingBBox null>>setpagedevice"
+ CustomMedia "EnvA2/A2 Envelope 111x146in" 314.88 414 8.4 8.4 8.4 36 "<</cupsInteger0 109/PageSize[314.88 414]/ImagingBBox null>>setpagedevice"
+@@ -10149,10 +10141,6 @@ Manufacturer "HP"
+ "<</cupsInteger0 45/PageSize[515.76 728.4]/ImagingBBox null>>setpagedevice"
+ CustomMedia "JB5.FB/Borderless JB5" 515.76 728.4 0 0 0 0 "<</cupsInteger0 45/PageSize [515.76 728.4]/ImagingBBox null>>setpagedevice"
+ "<</cupsInteger0 45/PageSize[515.76 728.4]/ImagingBBox null>>setpagedevice"
+- CustomMedia "Custom/Custom" 612 1008 8.4 8.4 8.4 8.4 "<</cupsInteger0 101/PageSize [612 1008]/ImagingBBox null>>setpagedevice"
+- "<</cupsInteger0 101/PageSize[612 1008]/ImagingBBox null>>setpagedevice"
+- CustomMedia "Custom.FB/Borderless Custom" 612 1008 0 0 0 0 "<</cupsInteger0 101/PageSize [612 1008]/ImagingBBox null>>setpagedevice"
+- "<</cupsInteger0 101/PageSize[612 1008]/ImagingBBox null>>setpagedevice"
+ CustomMedia "Envelope#10/Envelope #10" 296.88 684 8.4 8.4 8.4 8.4 "<</cupsInteger0 81/PageSize [296.88 684]/ImagingBBox null>>setpagedevice"
+ "<</cupsInteger0 81/PageSize[612 1008]/ImagingBBox null>>setpagedevice"
+ CustomMedia "EnvelopeA2/Envelope A2" 314.88 414 8.4 8.4 8.4 8.4 "<</cupsInteger0 109/PageSize [314.88 414]/ImagingBBox null>>setpagedevice"
+@@ -12205,8 +12193,6 @@ Manufacturer "HP"
+ "<</cupsInteger0 2/PageSize[612 1008]/ImagingBBox null>>setpagedevice"
+ CustomMedia "Statement/Statement " 396 612 8.4 8.4 8.4 8.4 "<</cupsInteger0 15/PageSize[396 612]/ImagingBBox null>>setpagedevice"
+ "<</cupsInteger0 15/PageSize[396 612]/ImagingBBox null>>setpagedevice"
+- CustomMedia "Custom/Custom " 612 1008 8.4 8.4 8.4 8.4 "<</cupsInteger0 101/PageSize[612 1008]/ImagingBBox null>>setpagedevice"
+- "<</cupsInteger0 101/PageSize[612 1008]/ImagingBBox null>>setpagedevice"
+ CustomMedia "Tabloid/Tabloid " 792 1224 8.4 8.4 8.4 8.4 "<</cupsInteger0 6/PageSize[792 1224]/ImagingBBox null>>setpagedevice"
+ "<</cupsInteger0 6/PageSize[792 1224]/ImagingBBox null>>setpagedevice"
+ CustomMedia "Tabloid.FB/Tabloid Borderless " 792 1224 0 0 0 0 "<</cupsInteger0 6/PageSize[792 1224]/ImagingBBox null>>setpagedevice"
+diff --git a/prnt/drv/hpijs.drv.in.template b/prnt/drv/hpijs.drv.in.template
+index 0c60fdc..71a0ef0 100644
+--- a/prnt/drv/hpijs.drv.in.template
++++ b/prnt/drv/hpijs.drv.in.template
+@@ -7726,8 +7726,6 @@ lity:PenSet=2,Quality:FullBleed=1"
+ "<</cupsInteger0 65/PageSize[498.72 708.48]/ImagingBBox null>>setpagedevice"
+ CustomMedia "B5/B5 182x257" 515.76 728.4 8.4 8.4 8.4 36 "<</cupsInteger0 45/PageSize[515.76 728.4]/ImagingBBox null>>setpagedevice"
+ "<</cupsInteger0 45/PageSize[515.76 728.4]/ImagingBBox null>>setpagedevice"
+- CustomMedia "Custom/Custom1" 612 1008 8.4 8.4 8.4 36 "<</cupsInteger0 101/PageSize[612 1008]/ImagingBBox null>>setpagedevice"
+- "<</cupsInteger0 101/PageSize[612 1008]/ImagingBBox null>>setpagedevice"
+ CustomMedia "Env10/#10 Envelope 4.1x9.5in" 296.88 684 8.4 8.4 8.4 36 "<</cupsInteger0 81/PageSize[296.88 684]/ImagingBBox null>>setpagedevice"
+ "<</cupsInteger0 81/PageSize[296.88 684]/ImagingBBox null>>setpagedevice"
+ CustomMedia "EnvA2/A2 Envelope 111x146in" 314.88 414 8.4 8.4 8.4 36 "<</cupsInteger0 109/PageSize[314.88 414]/ImagingBBox null>>setpagedevice"
+@@ -7896,8 +7894,6 @@ lity:PenSet=2,Quality:FullBleed=1"
+ "<</cupsInteger0 65/PageSize[498.72 708.48]/ImagingBBox null>>setpagedevice"
+ CustomMedia "B5/B5 182x257" 515.76 728.4 8.4 8.4 8.4 36 "<</cupsInteger0 45/PageSize[515.76 728.4]/ImagingBBox null>>setpagedevice"
+ "<</cupsInteger0 45/PageSize[515.76 728.4]/ImagingBBox null>>setpagedevice"
+- CustomMedia "Custom/Custom1" 612 1008 8.4 8.4 8.4 36 "<</cupsInteger0 101/PageSize[612 1008]/ImagingBBox null>>setpagedevice"
+- "<</cupsInteger0 101/PageSize[612 1008]/ImagingBBox null>>setpagedevice"
+ CustomMedia "Env10/#10 Envelope 4.1x9.5in" 296.88 684 8.4 8.4 8.4 36 "<</cupsInteger0 81/PageSize[296.88 684]/ImagingBBox null>>setpagedevice"
+ "<</cupsInteger0 81/PageSize[296.88 684]/ImagingBBox null>>setpagedevice"
+ CustomMedia "EnvA2/A2 Envelope 111x146in" 314.88 414 8.4 8.4 8.4 36 "<</cupsInteger0 109/PageSize[314.88 414]/ImagingBBox null>>setpagedevice"
diff --git a/debian/patches/0039-PY3-Fix-dat2drv.py.patch b/debian/patches/0039-PY3-Fix-dat2drv.py.patch
new file mode 100644
index 000000000..d84c1ceb7
--- /dev/null
+++ b/debian/patches/0039-PY3-Fix-dat2drv.py.patch
@@ -0,0 +1,21 @@
+From: Didier Raboud <odyx@debian.org>
+Date: Tue, 1 Oct 2019 21:49:49 +0200
+Subject: PY3: Fix dat2drv.py
+
+---
+ dat2drv.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/dat2drv.py b/dat2drv.py
+index 4b3e460..0bee28f 100755
+--- a/dat2drv.py
++++ b/dat2drv.py
+@@ -94,7 +94,7 @@ def usage(typ='text'):
+ def _encode(v):
+ if isinstance(v, text_type):
+ v = v.encode(enc)
+- return v
++ return str(v)
+
+
+
diff --git a/debian/patches/0040-Replace-rubbish-pstotiff-filter.patch b/debian/patches/0040-Replace-rubbish-pstotiff-filter.patch
new file mode 100644
index 000000000..45687478c
--- /dev/null
+++ b/debian/patches/0040-Replace-rubbish-pstotiff-filter.patch
@@ -0,0 +1,76 @@
+From: Tim Waugh <twaugh@fedoraproject.org>
+Date: Fri, 31 Jan 2020 12:10:47 +0100
+Subject: Replace rubbish pstotiff filter
+
+Bug-Ubuntu: #528394
+Origin: https://src.fedoraproject.org/rpms/hplip/blob/master/f/hplip-pstotiff-is-rubbish.patch
+---
+ fax/filters/pstotiff | 61 ++++++++++++++--------------------------------------
+ 1 file changed, 16 insertions(+), 45 deletions(-)
+
+diff --git a/fax/filters/pstotiff b/fax/filters/pstotiff
+index bd2ff3f..819bf92 100755
+--- a/fax/filters/pstotiff
++++ b/fax/filters/pstotiff
+@@ -1,45 +1,16 @@
+-#!/usr/bin/env python
+-
+-import os
+-import os.path
+-import time
+-import sys
+-import tempfile
+-
+-PY3 = sys.version_info[0] == 3
+-
+-READ_SIZE = 8192
+-
+-total_bytes_read = 0
+-temp_in_file = "-"
+-
+-if (len(sys.argv) > 6):
+- temp_in_file = sys.argv[6]
+-
+-temp_out_handle, temp_out_fname = tempfile.mkstemp()
+-
+-font = "-I/usr/share/cups/fonts"
+-device = "-sDEVICE=tiffg4 -dMaxStripSize=0 -r204x196 -dNOPAUSE -dBATCH -dSAFER -dPARANOIDSAFER -dSHORTERRORS -dWRITESYSTEMDICT -dGHOSTSCRIPT -sstdout=%stderr -sOutputFile=" + temp_out_fname + " " + temp_in_file
+-
+-gs_command = "/usr/bin/gs" + " " + font + " " + device
+-
+-exit_code = os.system(gs_command)
+-
+-file_len = os.stat(temp_out_fname).st_size
+-if (file_len < READ_SIZE):
+- READ_SIZE = file_len
+-
+-os.close(temp_out_handle)
+-
+-out_handle = open(temp_out_fname, mode='rb')
+-while (total_bytes_read < file_len):
+- data = out_handle.read(READ_SIZE)
+- if PY3:
+- sys.stdout.buffer.write(data)
+- else:
+- sys.stdout.write(data)
+- total_bytes_read += READ_SIZE
+-out_handle.close()
+-
+-os.remove(temp_out_fname)
+-sys.exit(0)
++#!/bin/sh
++if [ $# -lt 6 ]; then
++ IN=-_
++else
++ IN="$6"
++fi
++
++TMPFILE=`mktemp /tmp/pstotiff.XXXXXX` || exit 1
++gs -I/usr/share/cups/fonts -sDEVICE=tiffg4 -dMaxStripSize=0 -r204x196 \
++ -dNOPAUSE -dBATCH -dSAFER -dPARANOIDSAFER \
++ -dSHORTERRORS -dWRITESYSTEMDICT -dGHOSTSCRIPT \
++ -sstdout=%stderr -sOutputFile="$TMPFILE" "$IN"
++RET=$?
++cat "$TMPFILE"
++rm -f "$TMPFILE"
++exit $RET
diff --git a/debian/patches/0041-Fix-strstr-const.patch b/debian/patches/0041-Fix-strstr-const.patch
new file mode 100644
index 000000000..8e5c98d2d
--- /dev/null
+++ b/debian/patches/0041-Fix-strstr-const.patch
@@ -0,0 +1,62 @@
+From: Tim Waugh <twaugh@fedoraproject.org>
+Date: Fri, 31 Jan 2020 12:14:24 +0100
+Subject: Fix strstr const
+
+Origin: https://src.fedoraproject.org/rpms/hplip/blob/master/f/hplip-strstr-const.patch
+---
+ prnt/hpijs/dj3320.cpp | 2 +-
+ prnt/hpijs/registry.cpp | 14 +++++++-------
+ 2 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/prnt/hpijs/dj3320.cpp b/prnt/hpijs/dj3320.cpp
+index 496be98..40e4f0c 100644
+--- a/prnt/hpijs/dj3320.cpp
++++ b/prnt/hpijs/dj3320.cpp
+@@ -405,7 +405,7 @@ DISPLAY_STATUS DJ3320::ParseError (BYTE byStatusReg)
+ {
+ DRIVER_ERROR err = NO_ERROR;
+ BYTE byDevIDBuffer[DevIDBuffSize];
+- char *pcStr = NULL;
++ const char *pcStr = NULL;
+ BYTE byStatus1, byStatus2;
+
+ memset(byDevIDBuffer, 0, sizeof(byDevIDBuffer));
+diff --git a/prnt/hpijs/registry.cpp b/prnt/hpijs/registry.cpp
+index ce587c3..853418d 100644
+--- a/prnt/hpijs/registry.cpp
++++ b/prnt/hpijs/registry.cpp
+@@ -290,14 +290,14 @@ DRIVER_ERROR DeviceRegistry::SelectDevice(char* model, int *pVIPVersion, char* p
+ 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::SelectDevice(char* model, int *pVIPVersion, char* p
+ }
+ 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/debian/patches/0042-Added-several-IEEE-1284-Device-IDs.patch b/debian/patches/0042-Added-several-IEEE-1284-Device-IDs.patch
new file mode 100644
index 000000000..2536f6322
--- /dev/null
+++ b/debian/patches/0042-Added-several-IEEE-1284-Device-IDs.patch
@@ -0,0 +1,760 @@
+From: =?utf-8?b?SmnFmcOtIFBvcGVsa2E=?= <jpopelka@fedoraproject.org>
+Date: Fri, 31 Jan 2020 12:18:40 +0100
+Subject: Added several IEEE 1284 Device IDs
+
+Origin: https://src.fedoraproject.org/rpms/hplip/blob/master/f/hplip-deviceIDs-drv.patch
+---
+ prnt/drv/hpcups.drv.in | 166 ++++++++++++++++++++++++-------------------------
+ 1 file changed, 83 insertions(+), 83 deletions(-)
+
+diff --git a/prnt/drv/hpcups.drv.in b/prnt/drv/hpcups.drv.in
+index 90ec75b..f9a5d5e 100644
+--- a/prnt/drv/hpcups.drv.in
++++ b/prnt/drv/hpcups.drv.in
+@@ -487,7 +487,7 @@ Manufacturer "HP"
+ ModelName "HP Deskjet 3820"
+ Attribute "NickName" "" "HP Deskjet 3820, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Deskjet 3820 hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:deskjet 3820;DES:deskjet 3820;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:DESKJET 3820;DES:Hewlett-Packard DeskJet 3820;"
+ PCFileName "hp-deskjet_3820.ppd"
+ Attribute "Product" "" "(HP Deskjet 3820 Color Inkjet Printer)"
+ Attribute "Product" "" "(HP Deskjet 3820v Color Inkjet Printer)"
+@@ -521,7 +521,7 @@ Manufacturer "HP"
+ ModelName "HP Deskjet 920c"
+ Attribute "NickName" "" "HP Deskjet 920c, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Deskjet 920c hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:deskjet 920c;DES:deskjet 920c;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:DESKJET 920C;DES:Hewlett-Packard DeskJet 920C;"
+ PCFileName "hp-deskjet_920c.ppd"
+ Attribute "Product" "" "(HP Deskjet 920c Printer)"
+ Attribute "Product" "" "(HP Deskjet 920cvr Printer)"
+@@ -532,7 +532,7 @@ Manufacturer "HP"
+ ModelName "HP Deskjet 930c"
+ Attribute "NickName" "" "HP Deskjet 930c, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Deskjet 930c hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:deskjet 930c;DES:deskjet 930c;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:DESKJET 930C;DES:Hewlett-Packard DeskJet 930C;"
+ PCFileName "hp-deskjet_930c.ppd"
+ Attribute "Product" "" "(HP Deskjet 930c Printer)"
+ Attribute "Product" "" "(HP Deskjet 930cm Printer)"
+@@ -573,7 +573,7 @@ Manufacturer "HP"
+ ModelName "HP Deskjet 940c"
+ Attribute "NickName" "" "HP Deskjet 940c, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Deskjet 940c hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:deskjet 940c;DES:deskjet 940c;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:DESKJET 940C;DES:Hewlett-Packard DeskJet 940C;"
+ PCFileName "hp-deskjet_940c.ppd"
+ Attribute "Product" "" "(HP Deskjet 940cvr Printer)"
+ Attribute "Product" "" "(HP Deskjet 940c Printer)"
+@@ -592,7 +592,7 @@ Manufacturer "HP"
+ ModelName "HP Deskjet 950c"
+ Attribute "NickName" "" "HP Deskjet 950c, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Deskjet 950c hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:deskjet 950c;DES:deskjet 950c;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:DESKJET 950C;DES:Hewlett-Packard DeskJet 950C;"
+ PCFileName "hp-deskjet_950c.ppd"
+ Attribute "Product" "" "(HP Deskjet 950c Printer)"
+ }
+@@ -625,7 +625,7 @@ Manufacturer "HP"
+ ModelName "HP Deskjet 959c"
+ Attribute "NickName" "" "HP Deskjet 959c, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Deskjet 959c hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:deskjet 959c;DES:deskjet 959c;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:DESKJET 950C;DES:Hewlett-Packard DeskJet 950C;"
+ PCFileName "hp-deskjet_959c.ppd"
+ Attribute "Product" "" "(HP Deskjet 959c Printer)"
+ }
+@@ -633,7 +633,7 @@ Manufacturer "HP"
+ ModelName "HP Deskjet 970c"
+ Attribute "NickName" "" "HP Deskjet 970c, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Deskjet 970c hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:deskjet 970c;DES:deskjet 970c;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:DESKJET 970C;DES:Hewlett-Packard DeskJet 970C;"
+ PCFileName "hp-deskjet_970c.ppd"
+ Attribute "Product" "" "(HP Deskjet 970cxi Printer)"
+ Attribute "Product" "" "(HP Deskjet 970cse Printer)"
+@@ -665,7 +665,7 @@ Manufacturer "HP"
+ ModelName "HP Officejet g55"
+ Attribute "NickName" "" "HP Officejet g55, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Officejet g55 hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:officejet g55;DES:officejet g55;"
++ Attribute "1284DeviceID" "" "MFG:Hewlett-Packard;MDL:OfficeJet G55;DES:Hewlett-Packard OfficeJet G Series;"
+ PCFileName "hp-officejet_g55.ppd"
+ Attribute "Product" "" "(HP Officejet g55 All-in-one Printer)"
+ }
+@@ -681,7 +681,7 @@ Manufacturer "HP"
+ ModelName "HP Officejet g85"
+ Attribute "NickName" "" "HP Officejet g85, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Officejet g85 hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:officejet g85;DES:officejet g85;"
++ Attribute "1284DeviceID" "" "MFG:Hewlett-Packard;MDL:OfficeJet G85;DES:Hewlett-Packard OfficeJet G Series;"
+ PCFileName "hp-officejet_g85.ppd"
+ Attribute "Product" "" "(HP Officejet g85 All-in-one Printer)"
+ }
+@@ -697,7 +697,7 @@ Manufacturer "HP"
+ ModelName "HP Officejet g95"
+ Attribute "NickName" "" "HP Officejet g95, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Officejet g95 hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:officejet g95;DES:officejet g95;"
++ Attribute "1284DeviceID" "" "MFG:Hewlett-Packard;MDL:OfficeJet G95;DES:Hewlett-Packard OfficeJet G Series;"
+ PCFileName "hp-officejet_g95.ppd"
+ Attribute "Product" "" "(HP Officejet g95 All-in-one Printer)"
+ }
+@@ -745,7 +745,7 @@ Manufacturer "HP"
+ ModelName "HP Officejet v40"
+ Attribute "NickName" "" "HP Officejet v40, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Officejet v40 hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:officejet v40;DES:officejet v40;"
++ Attribute "1284DeviceID" "" "MFG:Hewlett-Packard;MDL:OfficeJet V40;DES:Hewlett-Packard OfficeJet V Series;"
+ PCFileName "hp-officejet_v40.ppd"
+ Attribute "Product" "" "(HP Officejet v40 All-in-one Printer)"
+ Attribute "Product" "" "(HP Officejet v40s All-in-one Printer)"
+@@ -754,7 +754,7 @@ Manufacturer "HP"
+ ModelName "HP Officejet v40xi"
+ Attribute "NickName" "" "HP Officejet v40xi, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Officejet v40xi hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:officejet v40xi;DES:officejet v40xi;"
++ Attribute "1284DeviceID" "" "MFG:Hewlett-Packard;MDL:OfficeJet V40xi;DES:Hewlett-Packard OfficeJet V Series;"
+ PCFileName "hp-officejet_v40xi.ppd"
+ Attribute "Product" "" "(HP Officejet v40xi All-in-one Printer)"
+ }
+@@ -770,7 +770,7 @@ Manufacturer "HP"
+ ModelName "HP Photosmart p1000"
+ Attribute "NickName" "" "HP Photosmart p1000, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Photosmart p1000 hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:photosmart p1000;DES:photosmart p1000;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:PHOTOSMART P1100;DES:Hewlett-Packard PhotoSmart P1100;"
+ PCFileName "hp-photosmart_p1000.ppd"
+ Attribute "Product" "" "(HP Photosmart p1000/1000 Printer)"
+ Attribute "Product" "" "(HP Photosmart p1000xi Printer)"
+@@ -779,7 +779,7 @@ Manufacturer "HP"
+ ModelName "HP Photosmart p1100"
+ Attribute "NickName" "" "HP Photosmart p1100, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Photosmart p1100 hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:photosmart p1100;DES:photosmart p1100;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:PHOTOSMART P1000;DES:Hewlett-Packard PhotoSmart P1000;"
+ PCFileName "hp-photosmart_p1100.ppd"
+ Attribute "Product" "" "(HP Photosmart p1100 Printer)"
+ Attribute "Product" "" "(HP Photosmart p1100xi Printer)"
+@@ -796,7 +796,7 @@ Manufacturer "HP"
+ ModelName "HP PSC 750"
+ Attribute "NickName" "" "HP PSC 750, hpcups $Version"
+ Attribute "ShortNickName" "" "HP PSC 750 hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:psc 750;DES:psc 750;"
++ Attribute "1284DeviceID" "" "MFG:Hewlett-Packard;MDL:PSC 750;DES:Hewlett-Packard PSC 700 Series;"
+ PCFileName "hp-psc_750.ppd"
+ Attribute "Product" "" "(HP PSC 750 All-in-one Printer)"
+ }
+@@ -804,7 +804,7 @@ Manufacturer "HP"
+ ModelName "HP PSC 750xi"
+ Attribute "NickName" "" "HP PSC 750xi, hpcups $Version"
+ Attribute "ShortNickName" "" "HP PSC 750xi hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:psc 750xi;DES:psc 750xi;"
++ Attribute "1284DeviceID" "" "MFG:Hewlett-Packard;MDL:PSC 750xi;DES:Hewlett-Packard PSC 700 Series;"
+ PCFileName "hp-psc_750xi.ppd"
+ Attribute "Product" "" "(HP PSC 750xi All-in-one Printer)"
+ }
+@@ -836,7 +836,7 @@ Manufacturer "HP"
+ ModelName "HP PSC 900 Series"
+ Attribute "NickName" "" "HP PSC 900 Series, hpcups $Version"
+ Attribute "ShortNickName" "" "HP PSC 900 Series hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:psc 900 series;DES:psc 900 series;"
++ Attribute "1284DeviceID" "" "MFG:Hewlett-Packard;MDL:PSC 900 Series;DES:Hewlett-Packard PSC 900 Series;"
+ PCFileName "hp-psc_900_series.ppd"
+ Attribute "Product" "" "(HP PSC 900 All-in-one Printer)"
+ }
+@@ -910,7 +910,7 @@ Manufacturer "HP"
+ ModelName "HP Deskjet 1220c"
+ Attribute "NickName" "" "HP Deskjet 1220c, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Deskjet 1220c hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:deskjet 1220c;DES:deskjet 1220c;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:DESKJET 1220C;DES:Hewlett-Packard DeskJet 1220;"
+ PCFileName "hp-deskjet_1220c.ppd"
+ Attribute "Product" "" "(HP Deskjet 1220c Printer)"
+ Attribute "Product" "" "(HP Deskjet 1220cse Printer)"
+@@ -1100,7 +1100,7 @@ Manufacturer "HP"
+ ModelName "HP 2000c"
+ Attribute "NickName" "" "HP 2000c, hpcups $Version"
+ Attribute "ShortNickName" "" "HP 2000c hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:hp 2000c;DES:hp 2000c;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:HP 2000C;DES:hp 2000c;"
+ PCFileName "hp-2000c.ppd"
+ Attribute "Product" "" "(HP 2000cse Printer)"
+ Attribute "Product" "" "(HP 2000c Printer)"
+@@ -1564,7 +1564,7 @@ Manufacturer "HP"
+ ModelName "HP Deskjet 960c"
+ Attribute "NickName" "" "HP Deskjet 960c, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Deskjet 960c hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:deskjet 960c;DES:deskjet 960c;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:DESKJET 960C;DES:Hewlett-Packard DeskJet 960C;"
+ PCFileName "hp-deskjet_960c.ppd"
+ Attribute "Product" "" "(HP Deskjet 960cse Printer)"
+ Attribute "Product" "" "(HP Deskjet 960cxi Printer)"
+@@ -1574,7 +1574,7 @@ Manufacturer "HP"
+ ModelName "HP Deskjet 980c"
+ Attribute "NickName" "" "HP Deskjet 980c, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Deskjet 980c hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:deskjet 980c;DES:deskjet 980c;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:DESKJET 980C;DES:Hewlett-Packard DeskJet 980C;"
+ PCFileName "hp-deskjet_980c.ppd"
+ Attribute "Product" "" "(HP Deskjet 980cxi Printer)"
+ Attribute "Product" "" "(HP Deskjet 980c Printer)"
+@@ -1583,7 +1583,7 @@ Manufacturer "HP"
+ ModelName "HP Deskjet 990c"
+ Attribute "NickName" "" "HP Deskjet 990c, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Deskjet 990c hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:deskjet 990c;DES:deskjet 990c;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:DESKJET 990C;DES:Hewlett-Packard DeskJet 990C;"
+ PCFileName "hp-deskjet_990c.ppd"
+ Attribute "Product" "" "(HP Deskjet 990cxi Printer)"
+ Attribute "Product" "" "(HP Deskjet 990cse Printer)"
+@@ -1614,7 +1614,7 @@ Manufacturer "HP"
+ ModelName "HP Officejet 7100 Series"
+ Attribute "NickName" "" "HP Officejet 7100 Series, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Officejet 7100 Series hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:officejet 7100 series;DES:officejet 7100 series;"
++ Attribute "1284DeviceID" "" "MFG:Hewlett-Packard;MDL:officejet 7100 series;DES:officejet 7100 series;"
+ PCFileName "hp-officejet_7100_series.ppd"
+ Attribute "Product" "" "(HP Officejet 7100 All-in-one Printer)"
+ Attribute "Product" "" "(HP Officejet 7110 All-in-one Printer)"
+@@ -1629,7 +1629,7 @@ Manufacturer "HP"
+ ModelName "HP Officejet D Series"
+ Attribute "NickName" "" "HP Officejet D Series, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Officejet D Series hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:officejet d series;DES:officejet d series;"
++ Attribute "1284DeviceID" "" "MFG:Hewlett-Packard;MDL:officejet d series;DES:officejet d series;"
+ PCFileName "hp-officejet_d_series.ppd"
+ Attribute "Product" "" "(HP Officejet d125xi All-in-one Printer)"
+ Attribute "Product" "" "(HP Officejet d135 All-in-one Printer)"
+@@ -1676,7 +1676,7 @@ Manufacturer "HP"
+ ModelName "HP PSC 2100 Series"
+ Attribute "NickName" "" "HP PSC 2100 Series, hpcups $Version"
+ Attribute "ShortNickName" "" "HP PSC 2100 Series hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:psc 2100 series;DES:psc 2100 series;"
++ Attribute "1284DeviceID" "" "MFG:Hewlett-Packard;MDL:PSC 2100 Series;DES:psc 2100 series;"
+ PCFileName "hp-psc_2100_series.ppd"
+ Attribute "Product" "" "(HP PSC 2105 All-in-one Printer)"
+ Attribute "Product" "" "(HP PSC 2108 All-in-one Printer)"
+@@ -1689,7 +1689,7 @@ Manufacturer "HP"
+ ModelName "HP PSC 2150 Series"
+ Attribute "NickName" "" "HP PSC 2150 Series, hpcups $Version"
+ Attribute "ShortNickName" "" "HP PSC 2150 Series hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:psc 2150 series;DES:psc 2150 series;"
++ Attribute "1284DeviceID" "" "MFG:Hewlett-Packard;MDL:PSC 2150 Series;DES:psc 2150 series;"
+ PCFileName "hp-psc_2150_series.ppd"
+ Attribute "Product" "" "(HP PSC 2150 All-in-one Printer)"
+ }
+@@ -1697,7 +1697,7 @@ Manufacturer "HP"
+ ModelName "HP PSC 2170 Series"
+ Attribute "NickName" "" "HP PSC 2170 Series, hpcups $Version"
+ Attribute "ShortNickName" "" "HP PSC 2170 Series hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:psc 2170 series;DES:psc 2170 series;"
++ Attribute "1284DeviceID" "" "MFG:Hewlett-Packard;MDL:PSC 2170 Series;DES:psc 2170 series;"
+ PCFileName "hp-psc_2170_series.ppd"
+ Attribute "Product" "" "(HP PSC 2170 All-in-one Printer)"
+ Attribute "Product" "" "(HP PSC 2171 All-in-one Printer)"
+@@ -1744,7 +1744,7 @@ Manufacturer "HP"
+ ModelName "HP Color Inkjet Printer cp1700"
+ Attribute "NickName" "" "HP Color Inkjet Printer cp1700, hpcups $Version"
+ Attribute "ShortNickName" "" "HP CJ IJ Printer cp1700 hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:hp color inkjet printer cp1700;DES:hp color inkjet printer cp1700;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:HP Color Inkjet CP1700;DES:HP Color Inkjet CP1700;"
+ PCFileName "hp-color_inkjet_printer_cp1700.ppd"
+ Attribute "Product" "" "(HP Color Inkjet cp1700 Printer)"
+ Attribute "Product" "" "(HP Color Inkjet cp1700ps Printer)"
+@@ -1919,7 +1919,7 @@ Manufacturer "HP"
+ ModelName "HP Business Inkjet 2200"
+ Attribute "NickName" "" "HP Business Inkjet 2200, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Business Inkjet 2200 hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:hp business inkjet 2200;DES:hp business inkjet 2200;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:HP BUSINESS INKJET 2200;DES:Hewlett-Packard Business Inkjet 2200;"
+ PCFileName "hp-business_inkjet_2200.ppd"
+ Attribute "Product" "" "(HP Business Inkjet 2200 Printer)"
+ Attribute "Product" "" "(HP Business Inkjet 2200se Printer)"
+@@ -1929,7 +1929,7 @@ Manufacturer "HP"
+ ModelName "HP Business Inkjet 2230"
+ Attribute "NickName" "" "HP Business Inkjet 2230, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Business Inkjet 2230 hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:hp business inkjet 2230;DES:hp business inkjet 2230;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:HP BUSINESS INKJET 2230;DES:Hewlett-Packard Business Inkjet 2230;"
+ PCFileName "hp-business_inkjet_2230.ppd"
+ Attribute "Product" "" "(HP Business Inkjet 2230 Printer)"
+ }
+@@ -1937,7 +1937,7 @@ Manufacturer "HP"
+ ModelName "HP Business Inkjet 2250"
+ Attribute "NickName" "" "HP Business Inkjet 2250 pcl3, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Business Inkjet 2250 hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:hp business inkjet 2250;DES:hp business inkjet 2250;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:HP BUSINESS INKJET 2250;DES:Hewlett-Packard Business Inkjet 2250;"
+ PCFileName "hp-business_inkjet_2250-pcl3.ppd"
+ Attribute "Product" "" "(HP Business Inkjet 2250 Printer)"
+ Attribute "Product" "" "(HP Business Inkjet 2250tn Printer)"
+@@ -1946,7 +1946,7 @@ Manufacturer "HP"
+ ModelName "HP Business Inkjet 2280"
+ Attribute "NickName" "" "HP Business Inkjet 2280 pcl3, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Business Inkjet 2280 hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:hp business inkjet 2280;DES:hp business inkjet 2280;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:HP BUSINESS INKJET 2280;DES:Hewlett-Packard Business Inkjet 2280;"
+ PCFileName "hp-business_inkjet_2280-pcl3.ppd"
+ Attribute "Product" "" "(HP Business Inkjet 2280 Printer)"
+ Attribute "Product" "" "(HP Business Inkjet 2280tn Printer)"
+@@ -2690,7 +2690,7 @@ Manufacturer "HP"
+ ModelName "HP Officejet 7200 Series"
+ Attribute "NickName" "" "HP Officejet 7200 Series, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Officejet 7200 Series hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:officejet 7200 series;DES:officejet 7200 series;"
++ Attribute "1284DeviceID" "" "MFG:Hewlett-Packard;MDL:officejet 7200 series;DES:officejet 7200 series;"
+ PCFileName "hp-officejet_7200_series.ppd"
+ Attribute "Product" "" "(HP Officejet 7205 All-in-one Printer)"
+ Attribute "Product" "" "(HP Officejet 7208 All-in-one Printer)"
+@@ -2714,7 +2714,7 @@ Manufacturer "HP"
+ ModelName "HP Officejet 7400 Series"
+ Attribute "NickName" "" "HP Officejet 7400 Series, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Officejet 7400 Series hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:officejet 7400 series;DES:officejet 7400 series;"
++ Attribute "1284DeviceID" "" "MFG:Hewlett-Packard;MDL:officejet 7400 series;DES:officejet 7400 series;"
+ PCFileName "hp-officejet_7400_series.ppd"
+ Attribute "Product" "" "(HP Officejet 7408 All-in-one Printer)"
+ Attribute "Product" "" "(HP Officejet 7410 All-in-one Printer)"
+@@ -2758,7 +2758,7 @@ Manufacturer "HP"
+ ModelName "HP Officejet j5700 Series"
+ Attribute "NickName" "" "HP Officejet j5700 Series, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Officejet j5700 Series hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:officejet j5700 series;DES:officejet j5700 series;"
++ Attribute "1284DeviceID" "" "MFG:Hewlett-Packard;MDL:Officejet J5700 series;DES:officejet j5700 series;"
+ PCFileName "hp-officejet_j5700_series.ppd"
+ Attribute "Product" "" "(HP Officejet j5725 All-in-one Printer)"
+ Attribute "Product" "" "(HP Officejet j5785 All-in-one Printer)"
+@@ -3379,7 +3379,7 @@ Manufacturer "HP"
+ ModelName "HP PSC 2200 Series"
+ Attribute "NickName" "" "HP PSC 2200 Series, hpcups $Version"
+ Attribute "ShortNickName" "" "HP PSC 2200 Series hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:psc 2200 series;DES:psc 2200 series;"
++ Attribute "1284DeviceID" "" "MFG:Hewlett-Packard;MDL:PSC 2200 Series;DES:psc 2200 series;"
+ PCFileName "hp-psc_2200_series.ppd"
+ Attribute "Product" "" "(HP PSC 2200 All-in-one Printer)"
+ }
+@@ -3397,7 +3397,7 @@ Manufacturer "HP"
+ ModelName "HP PSC 2300 Series"
+ Attribute "NickName" "" "HP PSC 2300 Series, hpcups $Version"
+ Attribute "ShortNickName" "" "HP PSC 2300 Series hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:psc 2300 series;DES:psc 2300 series;"
++ Attribute "1284DeviceID" "" "MFG:Hewlett-Packard;MDL:PSC 2300 Series;DES:psc 2300 series;"
+ PCFileName "hp-psc_2300_series.ppd"
+ Attribute "Product" "" "(HP PSC 2300 Series All-in-one Printer)"
+ Attribute "Product" "" "(HP PSC 2310 All-in-one Printer)"
+@@ -3405,8 +3405,7 @@ Manufacturer "HP"
+ {
+ ModelName "HP PSC 2350 Series"
+ Attribute "NickName" "" "HP PSC 2350 Series, hpcups $Version"
+- Attribute "ShortNickName" "" "HP PSC 2350 Series hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:psc 2350 series;DES:psc 2350 series;"
++ Attribute "1284DeviceID" "" "MFG:Hewlett-Packard;MDL:PSC 2350 Series;DES:psc 2350 series;"
+ PCFileName "hp-psc_2350_series.ppd"
+ Attribute "Product" "" "(HP PSC 2350 All-in-one Printer)"
+ Attribute "Product" "" "(HP PSC 2358 All-in-one Printer)"
+@@ -3436,7 +3435,7 @@ Manufacturer "HP"
+ ModelName "HP PSC 2500 Series"
+ Attribute "NickName" "" "HP PSC 2500 Series, hpcups $Version"
+ Attribute "ShortNickName" "" "HP PSC 2500 Series hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:psc 2500 series;DES:psc 2500 series;"
++ Attribute "1284DeviceID" "" "MFG:Hewlett-Packard;MDL:PSC 2500 Series;DES:psc 2500 series;"
+ PCFileName "hp-psc_2500_series.ppd"
+ Attribute "Product" "" "(HP PSC 2500 Photosmart All-in-one Printer)"
+ Attribute "Product" "" "(HP PSC 2510 Photosmart All-in-one Printer)"
+@@ -7011,7 +7010,7 @@ Manufacturer "HP"
+ ModelName "HP Officejet 6100"
+ Attribute "NickName" "" "HP Officejet 6100, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Officejet 6100 hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:officejet 6100;DES:officejet 6100;"
++ Attribute "1284DeviceID" "" "MFG:Hewlett-Packard;MDL:OfficeJet 6100 Series;DES:officejet 6100 series;"
+ PCFileName "hp-officejet_6100.ppd"
+ Attribute "Product" "" "(HP Officejet 6100 Eprinter h611a)"
+ }
+@@ -16696,7 +16695,7 @@ Manufacturer "HP"
+ ModelName "HP Officejet 4100 Series"
+ Attribute "NickName" "" "HP Officejet 4100 Series, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Officejet 4100 Series hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:officejet 4100 series;DES:officejet 4100 series;"
++ Attribute "1284DeviceID" "" "MFG:Hewlett-packard;MDL:officejet 4100 series;DES:officejet 4100 series;"
+ PCFileName "hp-officejet_4100_series.ppd"
+ Attribute "Product" "" "(HP Officejet 4100 Series All-in-one Printer)"
+ Attribute "Product" "" "(HP Officejet 4110xi All-in-one Printer)"
+@@ -16723,7 +16722,7 @@ Manufacturer "HP"
+ ModelName "HP Officejet 4300 Series"
+ Attribute "NickName" "" "HP Officejet 4300 Series, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Officejet 4300 Series hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:officejet 4300 series;DES:officejet 4300 series;"
++ Attribute "1284DeviceID" "" "MFG:Hewlett-Packard;MDL:Officejet 4300 series;DES:officejet 4300 series;"
+ PCFileName "hp-officejet_4300_series.ppd"
+ Attribute "Product" "" "(HP Officejet 4308 All-in-one Printer)"
+ Attribute "Product" "" "(HP Officejet 4338 All-in-one Printer)"
+@@ -16753,7 +16752,7 @@ Manufacturer "HP"
+ ModelName "HP PSC 1100 Series"
+ Attribute "NickName" "" "HP PSC 1100 Series, hpcups $Version"
+ Attribute "ShortNickName" "" "HP PSC 1100 Series hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:psc 1100 series;DES:psc 1100 series;"
++ Attribute "1284DeviceID" "" "MFG:Hewlett-Packard;MDL:psc 1100 series;DES:psc 1100 series;"
+ PCFileName "hp-psc_1100_series.ppd"
+ Attribute "Product" "" "(HP PSC 1110 All-in-one Printer)"
+ Attribute "Product" "" "(HP PSC 1110v All-in-one Printer)"
+@@ -16763,7 +16762,7 @@ Manufacturer "HP"
+ ModelName "HP PSC 1200 Series"
+ Attribute "NickName" "" "HP PSC 1200 Series, hpcups $Version"
+ Attribute "ShortNickName" "" "HP PSC 1200 Series hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:psc 1200 series;DES:psc 1200 series;"
++ Attribute "1284DeviceID" "" "MFG:Hewlett-Packard;MDL:psc 1200 series;DES:psc 1200 series;"
+ PCFileName "hp-psc_1200_series.ppd"
+ Attribute "Product" "" "(HP PSC 1200 All-in-one Printer)"
+ Attribute "Product" "" "(HP PSC 1217 All-in-one Printer)"
+@@ -17063,7 +17062,7 @@ Manufacturer "HP"
+ ModelName "HP Officejet 4200 Series"
+ Attribute "NickName" "" "HP Officejet 4200 Series, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Officejet 4200 Series hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:officejet 4200 series;DES:officejet 4200 series;"
++ Attribute "1284DeviceID" "" "MFG:Hewlett-Packard;MDL:officejet 4200 series;DES:officejet 4200 series;"
+ PCFileName "hp-officejet_4200_series.ppd"
+ Attribute "Product" "" "(HP Officejet 4200 All-in-one Printer)"
+ Attribute "Product" "" "(HP Officejet 4211 All-in-one Printer)"
+@@ -17128,7 +17127,7 @@ Manufacturer "HP"
+ ModelName "HP Officejet j3600 Series"
+ Attribute "NickName" "" "HP Officejet j3600 Series, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Officejet j3600 Series hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:officejet j3600 series;DES:officejet j3600 series;"
++ Attribute "1284DeviceID" "" "MFG:Hewlett-Packard;MDL:Officejet J3600 series;DES:officejet j3600 series;"
+ PCFileName "hp-officejet_j3600_series.ppd"
+ Attribute "Product" "" "(HP Officejet j3608 All-in-one Printer)"
+ Attribute "Product" "" "(HP Officejet j3625 All-in-one Printer)"
+@@ -17625,6 +17624,7 @@ Manufacturer "HP"
+ Attribute "NickName" "" "HP Photosmart 380 Series, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Photosmart 380 Series hpijs"
+ Attribute "1284DeviceID" "" "MFG:HP;MDL:photosmart 380 series;DES:photosmart 380 series;"
++ Attribute "1284DeviceID" "" "MFG:HP;MDL:Photosmart 380 series_BT;DES:385;"
+ PCFileName "hp-photosmart_380_series.ppd"
+ Attribute "Product" "" "(HP Photosmart 385 Compact Photo Printer)"
+ Attribute "Product" "" "(HP Photosmart 385xi Compact Photo Printer)"
+@@ -19362,7 +19362,7 @@ Group "RLT/HP Real Life Technologies"
+ ModelName "HP Business Inkjet 2300"
+ Attribute "NickName" "" "HP Business Inkjet 2300 pcl3, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Business Inkjet 2300 hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:hp business inkjet 2300;DES:hp business inkjet 2300;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:HP BUSINESS INKJET 2300;DES:Hewlett-Packard Business Inkjet 2300;"
+ PCFileName "hp-business_inkjet_2300-pcl3.ppd"
+ Attribute "Product" "" "(HP Business Inkjet 2300 Printer)"
+ Attribute "Product" "" "(HP Business Inkjet 2300n Printer)"
+@@ -19743,7 +19743,7 @@ Group "RLT/HP Real Life Technologies"
+ ModelName "HP Officejet 9100 Series"
+ Attribute "NickName" "" "HP Officejet 9100 Series pcl3, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Officejet 9100 Series hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:officejet 9100 series;DES:officejet 9100 series;"
++ Attribute "1284DeviceID" "" "MFG:Hewlett-Packard;MDL:officejet 9100 series;DES:officejet 9100 series;"
+ PCFileName "hp-officejet_9100_series-pcl3.ppd"
+ Attribute "Product" "" "(HP Officejet 9110 All-in-one Printer)"
+ Attribute "Product" "" "(HP Officejet 9120 All-in-one Printer)"
+@@ -19827,7 +19827,7 @@ Group "RLT/HP Real Life Technologies"
+ ModelName "HP Business Inkjet 2800"
+ Attribute "NickName" "" "HP Business Inkjet 2800 pcl3, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Business Inkjet 2800 hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:hp business inkjet 2800;DES:hp business inkjet 2800;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:HP BUSINESS INKJET 2800;DES:Hewlett-Packard Business Inkjet 2800;"
+ PCFileName "hp-business_inkjet_2800-pcl3.ppd"
+ Attribute "Product" "" "(HP Business Inkjet 2800 Printer)"
+ Attribute "Product" "" "(HP Business Inkjet 2800dt Printer)"
+@@ -20364,7 +20364,7 @@ Group "RLT/HP Real Life Technologies"
+ ModelName "HP Officejet Lx"
+ Attribute "NickName" "" "HP Officejet Lx, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Officejet Lx hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:officejet lx;DES:officejet lx;"
++ Attribute "1284DeviceID" "" "MFG:Hewlett-Packard;MDL:OfficeJet;DES:officejet lx;"
+ PCFileName "hp-officejet_lx.ppd"
+ Attribute "Product" "" "(HP Officejet Lx All-in-one Printer)"
+ }
+@@ -20501,7 +20501,7 @@ Group "RLT/HP Real Life Technologies"
+ ModelName "HP Deskjet 540"
+ Attribute "NickName" "" "HP Deskjet 540, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Deskjet 540 hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:deskjet 540;DES:deskjet 540;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:DESKJET 540;DES:Hewlett-Packard DeskJet 540;"
+ PCFileName "hp-deskjet_540.ppd"
+ Attribute "Product" "" "(HP Deskjet 540 Printer)"
+ }
+@@ -20509,7 +20509,7 @@ Group "RLT/HP Real Life Technologies"
+ ModelName "HP Deskjet 400"
+ Attribute "NickName" "" "HP Deskjet 400, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Deskjet 400 hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:hp deskjet 400;DES:hp deskjet 400;"
++ Attribute "1284DeviceID" "" "MFG:Hewlett-Packard;MDL:HP DeskJet 400;DES:HP DeskJet 400 Printer;"
+ PCFileName "hp-deskjet_400.ppd"
+ Attribute "Product" "" "(HP Deskjet 400 Printer)"
+ Attribute "Product" "" "(HP Deskjet 400 Color Capable Printer)"
+@@ -20526,7 +20526,7 @@ Group "RLT/HP Real Life Technologies"
+ ModelName "HP Officejet Series 300"
+ Attribute "NickName" "" "HP Officejet Series 300, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Officejet Series 300 hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:officejet series 300;DES:officejet series 300;"
++ Attribute "1284DeviceID" "" "MFG:Hewlett-Packard;MDL:OfficeJet Series 300;DES:Hewlett-Packard OfficeJet Series 300;"
+ PCFileName "hp-officejet_series_300.ppd"
+ Attribute "Product" "" "(HP Officejet 300 All-in-one Printer)"
+ }
+@@ -20659,7 +20659,7 @@ Group "RLT/HP Real Life Technologies"
+ ModelName "HP Deskjet 630c"
+ Attribute "NickName" "" "HP Deskjet 630c, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Deskjet 630c hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:deskjet 630c;DES:deskjet 630c;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:DESKJET 630C;DES:Hewlett-Packard DeskJet 630C;"
+ PCFileName "hp-deskjet_630c.ppd"
+ Attribute "Product" "" "(HP Deskjet 630c Printer)"
+ }
+@@ -20675,7 +20675,7 @@ Group "RLT/HP Real Life Technologies"
+ ModelName "HP Deskjet 656c"
+ Attribute "NickName" "" "HP Deskjet 656c, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Deskjet 656c hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:deskjet 656c;DES:deskjet 656c;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:DESKJET 656C;DES:DESKJET 656C;"
+ PCFileName "hp-deskjet_656c.ppd"
+ Attribute "Product" "" "(HP Deskjet 656c Printer)"
+ Attribute "Product" "" "(HP Deskjet 656cvr Printer)"
+@@ -20788,7 +20788,7 @@ Group "RLT/HP Real Life Technologies"
+ ModelName "HP Deskjet 600"
+ Attribute "NickName" "" "HP Deskjet 600, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Deskjet 600 hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:deskjet 600;DES:deskjet 600;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:DESKJET 600;DES:Hewlett-Packard DeskJet 600;"
+ PCFileName "hp-deskjet_600.ppd"
+ Attribute "Product" "" "(HP Deskjet 600c Printer)"
+ Attribute "Product" "" "(HP Deskjet 600 Printer)"
+@@ -20828,7 +20828,7 @@ Group "RLT/HP Real Life Technologies"
+ ModelName "HP Deskjet 670c"
+ Attribute "NickName" "" "HP Deskjet 670c, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Deskjet 670c hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:deskjet 670c;DES:deskjet 670c;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:DESKJET 670C;DES:Hewlett-Packard DeskJet 670C;"
+ PCFileName "hp-deskjet_670c.ppd"
+ Attribute "Product" "" "(HP Deskjet 670c Printer)"
+ }
+@@ -20900,7 +20900,7 @@ Group "RLT/HP Real Life Technologies"
+ ModelName "HP Officejet Series 600"
+ Attribute "NickName" "" "HP Officejet Series 600, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Officejet Series 600 hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:officejet series 600;DES:officejet series 600;"
++ Attribute "1284DeviceID" "" "MFG:Hewlett-Packard;MDL:OfficeJet Series 600;DES:officejet series 600;"
+ PCFileName "hp-officejet_series_600.ppd"
+ Attribute "Product" "" "(HP Officejet 600 All-in-one Printer)"
+ }
+@@ -21045,7 +21045,7 @@ Group "RLT/HP Real Life Technologies"
+ ModelName "HP Deskjet 610c"
+ Attribute "NickName" "" "HP Deskjet 610c, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Deskjet 610c hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:deskjet 610c;DES:deskjet 610c;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:DESKJET 610C;DES:Hewlett-Packard DeskJet 610C;"
+ PCFileName "hp-deskjet_610c.ppd"
+ Attribute "Product" "" "(HP Deskjet 610c Printer)"
+ }
+@@ -21069,7 +21069,7 @@ Group "RLT/HP Real Life Technologies"
+ ModelName "HP Deskjet 640c"
+ Attribute "NickName" "" "HP Deskjet 640c, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Deskjet 640c hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:deskjet 640c;DES:deskjet 640c;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:DESKJET 640C;DES:Hewlett-Packard DeskJet 640C;"
+ PCFileName "hp-deskjet_640c.ppd"
+ Attribute "Product" "" "(HP Deskjet 640c Lite Printer)"
+ Attribute "Product" "" "(HP Deskjet 640c Printer)"
+@@ -21089,7 +21089,7 @@ Group "RLT/HP Real Life Technologies"
+ ModelName "HP Deskjet 690c"
+ Attribute "NickName" "" "HP Deskjet 690c, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Deskjet 690c hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:deskjet 690c;DES:deskjet 690c;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:DESKJET 690C;DES:Hewlett-Packard DeskJet 690C;"
+ PCFileName "hp-deskjet_690c.ppd"
+ Attribute "Product" "" "(HP Deskjet 690 Printer)"
+ Attribute "Product" "" "(HP Deskjet 690c Plus Printer)"
+@@ -21141,7 +21141,7 @@ Group "RLT/HP Real Life Technologies"
+ ModelName "HP Officejet Series 700"
+ Attribute "NickName" "" "HP Officejet Series 700, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Officejet Series 700 hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:officejet series 700;DES:officejet series 700;"
++ Attribute "1284DeviceID" "" "MFG:Hewlett-Packard;MDL:OfficeJet Series 700;DES:officejet series 700;"
+ PCFileName "hp-officejet_series_700.ppd"
+ Attribute "Product" "" "(HP Officejet 700 All-in-one Printer)"
+ }
+@@ -21292,7 +21292,7 @@ Group "RLT/HP Real Life Technologies"
+ ModelName "HP Deskjet 812c"
+ Attribute "NickName" "" "HP Deskjet 812c, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Deskjet 812c hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:deskjet 812c;DES:deskjet 812c;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:DESKJET 810C;DES:Hewlett-Packard DeskJet 810C;"
+ PCFileName "hp-deskjet_812c.ppd"
+ Attribute "Product" "" "(HP Deskjet 812c Printer)"
+ }
+@@ -21300,7 +21300,7 @@ Group "RLT/HP Real Life Technologies"
+ ModelName "HP Deskjet 815c"
+ Attribute "NickName" "" "HP Deskjet 815c, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Deskjet 815c hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:deskjet 815c;DES:deskjet 815c;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:DESKJET 815C;DES:Hewlett-Packard DeskJet 815C;"
+ PCFileName "hp-deskjet_815c.ppd"
+ Attribute "Product" "" "(HP Deskjet 815c Printer)"
+ }
+@@ -21332,7 +21332,7 @@ Group "RLT/HP Real Life Technologies"
+ ModelName "HP Deskjet 840c"
+ Attribute "NickName" "" "HP Deskjet 840c, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Deskjet 840c hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:deskjet 840c;DES:deskjet 840c;"
++ Attribute "1284DeviceID" "" "MFG:Hewlett-Packard;MDL:DeskJet 840C;DES:deskjet 840c;"
+ PCFileName "hp-deskjet_840c.ppd"
+ Attribute "Product" "" "(HP Deskjet 840c Printer)"
+ }
+@@ -21340,7 +21340,7 @@ Group "RLT/HP Real Life Technologies"
+ ModelName "HP Deskjet 841c"
+ Attribute "NickName" "" "HP Deskjet 841c, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Deskjet 841c hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:deskjet 841c;DES:deskjet 841c;"
++ Attribute "1284DeviceID" "" "MFG:Hewlett-Packard;MDL:DeskJet 841C;DES:deskjet 841c;"
+ PCFileName "hp-deskjet_841c.ppd"
+ Attribute "Product" "" "(HP Deskjet 841c Printer)"
+ }
+@@ -21356,7 +21356,7 @@ Group "RLT/HP Real Life Technologies"
+ ModelName "HP Deskjet 843c"
+ Attribute "NickName" "" "HP Deskjet 843c, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Deskjet 843c hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:deskjet 843c;DES:deskjet 843c;"
++ Attribute "1284DeviceID" "" "MFG:Hewlett-Packard;MDL:DeskJet 843C;DES:deskjet 843c;"
+ PCFileName "hp-deskjet_843c.ppd"
+ Attribute "Product" "" "(HP Deskjet 843c Printer)"
+ Attribute "Product" "" "(HP Deskjet 843cxe Printer)"
+@@ -21365,7 +21365,7 @@ Group "RLT/HP Real Life Technologies"
+ ModelName "HP Deskjet 880c"
+ Attribute "NickName" "" "HP Deskjet 880c, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Deskjet 880c hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:deskjet 880c;DES:deskjet 880c;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:DESKJET 880C;DES:Hewlett-Packard DeskJet 880C;"
+ PCFileName "hp-deskjet_880c.ppd"
+ Attribute "Product" "" "(HP Deskjet 880c Printer)"
+ }
+@@ -21381,7 +21381,7 @@ Group "RLT/HP Real Life Technologies"
+ ModelName "HP Deskjet 895c"
+ Attribute "NickName" "" "HP Deskjet 895c, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Deskjet 895c hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:deskjet 895c;DES:deskjet 895c;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:DESKJET 895C;DES:Hewlett-Packard DeskJet 895C;"
+ PCFileName "hp-deskjet_895c.ppd"
+ Attribute "Product" "" "(HP Deskjet 895cse Printer)"
+ Attribute "Product" "" "(HP Deskjet 895c Printer)"
+@@ -21391,7 +21391,7 @@ Group "RLT/HP Real Life Technologies"
+ ModelName "HP Officejet r40"
+ Attribute "NickName" "" "HP Officejet r40, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Officejet r40 hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:officejet r40;DES:officejet r40;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:OFFICEJET R40;DES:Hewlett-Packard OfficeJet R40;"
+ PCFileName "hp-officejet_r40.ppd"
+ Attribute "Product" "" "(HP Officejet r40 All-in-one Printer)"
+ }
+@@ -21415,7 +21415,7 @@ Group "RLT/HP Real Life Technologies"
+ ModelName "HP Officejet r60"
+ Attribute "NickName" "" "HP Officejet r60, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Officejet r60 hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:officejet r60;DES:officejet r60;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:OFFICEJET R60;DES:Hewlett-Packard OfficeJet R60;"
+ PCFileName "hp-officejet_r60.ppd"
+ Attribute "Product" "" "(HP Officejet r60 All-in-one Printer)"
+ }
+@@ -21423,7 +21423,7 @@ Group "RLT/HP Real Life Technologies"
+ ModelName "HP Officejet r65"
+ Attribute "NickName" "" "HP Officejet r65, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Officejet r65 hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:officejet r65;DES:officejet r65;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:OFFICEJET R65;DES:Hewlett-Packard OfficeJet R65;"
+ PCFileName "hp-officejet_r65.ppd"
+ Attribute "Product" "" "(HP Officejet r65 All-in-one Printer)"
+ }
+@@ -21431,7 +21431,7 @@ Group "RLT/HP Real Life Technologies"
+ ModelName "HP Officejet r80"
+ Attribute "NickName" "" "HP Officejet r80, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Officejet r80 hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:officejet r80;DES:officejet r80;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:OFFICEJET R80;DES:Hewlett-Packard OfficeJet R80;"
+ PCFileName "hp-officejet_r80.ppd"
+ Attribute "Product" "" "(HP Officejet r80 All-in-one Printer)"
+ }
+@@ -21447,7 +21447,7 @@ Group "RLT/HP Real Life Technologies"
+ ModelName "HP Officejet T Series"
+ Attribute "NickName" "" "HP Officejet T Series, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Officejet T Series hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:officejet t series;DES:officejet t series;"
++ Attribute "1284DeviceID" "" "MFG:Hewlett-Packard;MDL:OfficeJet T Series;DES:Hewlett-Packard OfficeJet T Series;"
+ PCFileName "hp-officejet_t_series.ppd"
+ Attribute "Product" "" "(HP Officejet t45 All-in-one Printer)"
+ Attribute "Product" "" "(HP Officejet t45xi All-in-one Printer)"
+@@ -21458,7 +21458,7 @@ Group "RLT/HP Real Life Technologies"
+ ModelName "HP PSC 500"
+ Attribute "NickName" "" "HP PSC 500, hpcups $Version"
+ Attribute "ShortNickName" "" "HP PSC 500 hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:psc 500;DES:psc 500;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:PSC 500;DES:Hewlett-Packard PSC 500;"
+ PCFileName "hp-psc_500.ppd"
+ Attribute "Product" "" "(HP PSC 500 All-in-one Printer)"
+ Attribute "Product" "" "(HP PSC 500xi All-in-one Printer)"
+@@ -21574,7 +21574,7 @@ Group "RLT/HP Real Life Technologies"
+ ModelName "HP Deskjet 825c"
+ Attribute "NickName" "" "HP Deskjet 825c, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Deskjet 825c hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:deskjet 825c;DES:deskjet 825c;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:DESKJET 825C;DES:Hewlett-Packard DeskJet 825C;"
+ PCFileName "hp-deskjet_825c.ppd"
+ Attribute "Product" "" "(HP Deskjet 825cvr Printer)"
+ Attribute "Product" "" "(HP Deskjet 825c Printer)"
+@@ -21583,7 +21583,7 @@ Group "RLT/HP Real Life Technologies"
+ ModelName "HP Deskjet 845c"
+ Attribute "NickName" "" "HP Deskjet 845c, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Deskjet 845c hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:deskjet 845c;DES:deskjet 845c;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:DESKJET 845C;DES:Hewlett-Packard DeskJet 845C;"
+ PCFileName "hp-deskjet_845c.ppd"
+ Attribute "Product" "" "(HP Deskjet 845c Printer)"
+ Attribute "Product" "" "(HP Deskjet 845cvr Printer)"
+@@ -21694,7 +21694,7 @@ Group "RLT/HP Real Life Technologies"
+ ModelName "HP Deskjet 850c"
+ Attribute "NickName" "" "HP Deskjet 850c, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Deskjet 850c hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:deskjet 850c;DES:deskjet 850c;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:DESKJET 850C;DES:Hewlett-Packard Deskjet 850C;"
+ PCFileName "hp-deskjet_850c.ppd"
+ Attribute "Product" "" "(HP Deskjet 850k Printer)"
+ Attribute "Product" "" "(HP Deskjet 850c Printer)"
+@@ -21713,7 +21713,7 @@ Group "RLT/HP Real Life Technologies"
+ ModelName "HP Deskjet 870c"
+ Attribute "NickName" "" "HP Deskjet 870c, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Deskjet 870c hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:deskjet 870c;DES:deskjet 870c;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:DESKJET 870C;DES:Hewlett-Packard Deskjet 870C;"
+ PCFileName "hp-deskjet_870c.ppd"
+ Attribute "Product" "" "(HP Deskjet 870k Printer)"
+ Attribute "Product" "" "(HP Deskjet 870c Printer)"
+@@ -21724,7 +21724,7 @@ Group "RLT/HP Real Life Technologies"
+ ModelName "HP Officejet Pro 1150c"
+ Attribute "NickName" "" "HP Officejet Pro 1150c, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Officejet Pro 1150c hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:officejet pro 1150c;DES:officejet pro 1150c;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:OFFICEJET PRO 1150C;DES:Hewlett-Packard OfficeJet Pro 1150C;"
+ PCFileName "hp-officejet_pro_1150c.ppd"
+ Attribute "Product" "" "(HP Officejet Pro 1150c All-in-one Printer)"
+ Attribute "Product" "" "(HP Officejet Pro 1150cse All-in-one Printer)"
+@@ -21838,7 +21838,7 @@ Group "RLT/HP Real Life Technologies"
+ ModelName "HP Deskjet 890c"
+ Attribute "NickName" "" "HP Deskjet 890c, hpcups $Version"
+ Attribute "ShortNickName" "" "HP Deskjet 890c hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:deskjet 890c;DES:deskjet 890c;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:DESKJET 890C;DES:Hewlett-Packard Deskjet 890C;"
+ PCFileName "hp-deskjet_890c.ppd"
+ Attribute "Product" "" "(HP Deskjet 890cse Printer)"
+ Attribute "Product" "" "(HP Deskjet 890c Printer)"
+@@ -21847,7 +21847,7 @@ Group "RLT/HP Real Life Technologies"
+ ModelName "HP Officejet Pro 1170c Series"
+ Attribute "NickName" "" "HP Officejet Pro 1170c Series, hpcups $Version"
+ Attribute "ShortNickName" "" "HP OJ Pro 1170c Series hpijs"
+- Attribute "1284DeviceID" "" "MFG:HP;MDL:officejet pro 1170c series;DES:officejet pro 1170c series;"
++ Attribute "1284DeviceID" "" "MFG:HEWLETT-PACKARD;MDL:OFFICEJET PRO 1170C SERIES;DES:Hewlett-Packard OfficeJet Pro 1170C Series;"
+ PCFileName "hp-officejet_pro_1170c_series.ppd"
+ Attribute "Product" "" "(HP Officejet Pro 1170c All-in-one Printer)"
+ Attribute "Product" "" "(HP Officejet Pro 1170cse All-in-one Printer)"
diff --git a/debian/patches/0043-Retry-when-connecting-to-device-fails.patch b/debian/patches/0043-Retry-when-connecting-to-device-fails.patch
new file mode 100644
index 000000000..a19c33886
--- /dev/null
+++ b/debian/patches/0043-Retry-when-connecting-to-device-fails.patch
@@ -0,0 +1,26 @@
+From: Tim Waugh <twaugh@fedoraproject.org>
+Date: Fri, 31 Jan 2020 12:21:17 +0100
+Subject: Retry when connecting to device fails
+
+Origin: https://src.fedoraproject.org/rpms/hplip/blob/master/f/hplip-retry-open.patch
+---
+ prnt/backend/hp.c | 6 ------
+ 1 file changed, 6 deletions(-)
+
+diff --git a/prnt/backend/hp.c b/prnt/backend/hp.c
+index 066866e..9aa0bf3 100644
+--- a/prnt/backend/hp.c
++++ b/prnt/backend/hp.c
+@@ -819,12 +819,6 @@ int main(int argc, char *argv[])
+ goto bugout;
+ }
+
+- if (stat != HPMUD_R_DEVICE_BUSY)
+- {
+- BUG("ERROR: open device failed stat=%d: %s\n", stat, argv[0]);
+- goto bugout;
+- }
+-
+ /* Display user error. */
+ device_event(argv[0], printer, 5000+stat, argv[2], argv[1], argv[3]);
+
diff --git a/debian/patches/0044-Mark-SNMP-quirks-for-two-lying-devices.patch b/debian/patches/0044-Mark-SNMP-quirks-for-two-lying-devices.patch
new file mode 100644
index 000000000..e42cc1e4d
--- /dev/null
+++ b/debian/patches/0044-Mark-SNMP-quirks-for-two-lying-devices.patch
@@ -0,0 +1,31 @@
+From: Tim Waugh <twaugh@fedoraproject.org>
+Date: Fri, 31 Jan 2020 12:23:46 +0100
+Subject: Mark SNMP quirks for two lying devices
+
+Origin: https://src.fedoraproject.org/rpms/hplip/blob/master/f/hplip-snmp-quirks.patch
+---
+ prnt/drv/hpcups.drv.in | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/prnt/drv/hpcups.drv.in b/prnt/drv/hpcups.drv.in
+index f9a5d5e..4e9a96b 100644
+--- a/prnt/drv/hpcups.drv.in
++++ b/prnt/drv/hpcups.drv.in
+@@ -10322,6 +10322,8 @@ Manufacturer "HP"
+ Attribute "NickName" "" "HP Officejet Pro 8500 a909a, hpcups $Version"
+ Attribute "ShortNickName" "" "HP OJ Pro 8500 a909a hpijs"
+ Attribute "1284DeviceID" "" "MFG:HP;MDL:officejet pro 8500 a909a;DES:officejet pro 8500 a909a;"
++ // This device lies about its supplies capacity.
++ Attribute "cupsSNMPQuirks" "" "capacity"
+ PCFileName "hp-officejet_pro_8500_a909a.ppd"
+ Attribute "Product" "" "(HP Officejet Pro 8500 All-in-one Printer - a909a)"
+ }
+@@ -10330,6 +10332,8 @@ Manufacturer "HP"
+ Attribute "NickName" "" "HP Officejet Pro 8500 a909g, hpcups $Version"
+ Attribute "ShortNickName" "" "HP OJ Pro 8500 a909g hpijs"
+ Attribute "1284DeviceID" "" "MFG:HP;MDL:officejet pro 8500 a909g;DES:officejet pro 8500 a909g;"
++ // This device lies about its supplies capacity.
++ Attribute "cupsSNMPQuirks" "" "capacity"
+ PCFileName "hp-officejet_pro_8500_a909g.ppd"
+ Attribute "Product" "" "(HP Officejet Pro 8500 Wireless All-in-one Printer - a909g)"
+ }
diff --git a/debian/patches/0045-Fix-bogus-low-ink-warning-from-hpijs-driver.patch b/debian/patches/0045-Fix-bogus-low-ink-warning-from-hpijs-driver.patch
new file mode 100644
index 000000000..ecc0bcbb7
--- /dev/null
+++ b/debian/patches/0045-Fix-bogus-low-ink-warning-from-hpijs-driver.patch
@@ -0,0 +1,41 @@
+From: Tim Waugh <twaugh@fedoraproject.org>
+Date: Fri, 31 Jan 2020 12:30:39 +0100
+Subject: Fix bogus low ink warning from hpijs driver
+
+Origin: https://src.fedoraproject.org/rpms/hplip/blob/master/f/hplip-hpijs-marker-supply.patch
+---
+ prnt/hpijs/hpijs.cpp | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/prnt/hpijs/hpijs.cpp b/prnt/hpijs/hpijs.cpp
+index 64b0121..8ad7cf2 100644
+--- a/prnt/hpijs/hpijs.cpp
++++ b/prnt/hpijs/hpijs.cpp
+@@ -588,6 +588,7 @@ int main (int argc, char *argv[], char *evenp[])
+ char *raster = NULL, *k_raster = NULL;
+ int status = EXIT_FAILURE;
+ int ret, n, i, kn=0, width, k_width;
++ int low_marker = 0;
+ char user_name[32]={0,};
+
+ openlog("hpijs", LOG_PID, LOG_DAEMON);
+@@ -675,14 +676,17 @@ int main (int argc, char *argv[], char *evenp[])
+ case WARN_LOW_INK_YELLOW:
+ case WARN_LOW_INK_MULTIPLE_PENS:
+ {
+- fputs("STATE: +marker-supply-low-warning\n", stderr);
++ low_marker = 1;
+ break;
+ }
+ default:
+- fputs("STATE: +marker-supply-low-warning\n", stderr);
++ low_marker = 1;
+ }
+ }
+
++ fprintf(stderr, "STATE: %cmarker-supply-low-warning\n",
++ low_marker ? '+' : '-');
++
+ #if 0
+ BUG("device model=%s\n", pSS->pPC->PrinterModel());
+ BUG("device class=%s\n", pSS->pPC->PrintertypeToString(pSS->pPC->SelectedDevice()));
diff --git a/debian/patches/0046-Clear-old-state-reasons.patch b/debian/patches/0046-Clear-old-state-reasons.patch
new file mode 100644
index 000000000..71b3fbf7f
--- /dev/null
+++ b/debian/patches/0046-Clear-old-state-reasons.patch
@@ -0,0 +1,27 @@
+From: Tim Waugh <twaugh@fedoraproject.org>
+Date: Fri, 31 Jan 2020 12:33:50 +0100
+Subject: Clear old state reasons
+
+Origin: https://src.fedoraproject.org/rpms/hplip/blob/master/f/hplip-clear-old-state-reasons.patch
+---
+ prnt/hpcups/HPCupsFilter.cpp | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/prnt/hpcups/HPCupsFilter.cpp b/prnt/hpcups/HPCupsFilter.cpp
+index 0bacfaf..541719b 100644
+--- a/prnt/hpcups/HPCupsFilter.cpp
++++ b/prnt/hpcups/HPCupsFilter.cpp
+@@ -562,6 +562,13 @@ int HPCupsFilter::StartPrintJob(int argc, char *argv[])
+
+ signal(SIGTERM, HPCancelJob);
+
++/*
++ * Prior to the re-write of hpcups, this filter managed the
++ * marker-supply-low-warning printer state reason. Make sure to
++ * clear that state reason so that upgrades work correctly.
++ */
++ fputs ("STATE: -marker-supply-low-warning\n", stderr);
++
+ cups_raster = cupsRasterOpen(fd, CUPS_RASTER_READ);
+
+ if (cups_raster == NULL) {
diff --git a/debian/patches/0047-Avoid-busy-loop-in-hpcups-when-backend-has-exited.patch b/debian/patches/0047-Avoid-busy-loop-in-hpcups-when-backend-has-exited.patch
new file mode 100644
index 000000000..44a80b170
--- /dev/null
+++ b/debian/patches/0047-Avoid-busy-loop-in-hpcups-when-backend-has-exited.patch
@@ -0,0 +1,39 @@
+From: Tim Waugh <twaugh@fedoraproject.org>
+Date: Fri, 31 Jan 2020 12:35:31 +0100
+Subject: Avoid busy loop in hpcups when backend has exited
+
+Origin: https://src.fedoraproject.org/rpms/hplip/blob/master/f/hplip-hpcups-sigpipe.patch
+---
+ prnt/hpijs/services.cpp | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/prnt/hpijs/services.cpp b/prnt/hpijs/services.cpp
+index 026ef1a..2938c8d 100644
+--- a/prnt/hpijs/services.cpp
++++ b/prnt/hpijs/services.cpp
+@@ -29,6 +29,7 @@
+ POSSIBILITY OF SUCH DAMAGE.
+ \*****************************************************************************/
+
++#include <errno.h>
+ #include <sys/stat.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+@@ -385,8 +386,16 @@ DRIVER_ERROR UXServices::ToDevice(const BYTE * pBuffer, DWORD * Count)
+ if (write(OutputPath, pBuffer, *Count) != (ssize_t)*Count)
+ {
+ static int cnt=0;
+- if (cnt++ < 5)
++ if (cnt < 5)
++ {
++ cnt++;
+ BUG("unable to write to output, fd=%d, count=%d: %m\n", OutputPath, *Count);
++ }
++
++ if (errno == EPIPE)
++ /* The backend has exited. There's no recovering from that. */
++ exit (1);
++
+ return IO_ERROR;
+ }
+
diff --git a/debian/patches/0048-CUPS-filters-should-use-TMPDIR-when-available.patch b/debian/patches/0048-CUPS-filters-should-use-TMPDIR-when-available.patch
new file mode 100644
index 000000000..566ec7111
--- /dev/null
+++ b/debian/patches/0048-CUPS-filters-should-use-TMPDIR-when-available.patch
@@ -0,0 +1,36 @@
+From: Tim Waugh <twaugh@fedoraproject.org>
+Date: Fri, 31 Jan 2020 12:39:29 +0100
+Subject: CUPS filters should use TMPDIR when available
+
+Origin: https://src.fedoraproject.org/rpms/hplip/blob/master/f/hplip-logdir.patch
+---
+ prnt/hpcups/HPCupsFilter.cpp | 2 +-
+ prnt/hpcups/SystemServices.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/prnt/hpcups/HPCupsFilter.cpp b/prnt/hpcups/HPCupsFilter.cpp
+index 541719b..f7f1a98 100644
+--- a/prnt/hpcups/HPCupsFilter.cpp
++++ b/prnt/hpcups/HPCupsFilter.cpp
+@@ -642,7 +642,7 @@ int HPCupsFilter::processRasterData(cups_raster_t *cups_raster)
+ char hpPreProcessedRasterFile[MAX_FILE_PATH_LEN]; //temp file needed to store raster data with swaped pages.
+
+
+- sprintf(hpPreProcessedRasterFile, "%s/hp_%s_cups_SwapedPagesXXXXXX",CUPS_TMP_DIR, m_JA.user_name);
++ snprintf(hpPreProcessedRasterFile, sizeof (hpPreProcessedRasterFile), "%s/hp_%s_cups_SwapedPagesXXXXXX",CUPS_TMP_DIR, m_JA.user_name);
+
+ while (cupsRasterReadHeader2(cups_raster, &cups_header))
+ {
+diff --git a/prnt/hpcups/SystemServices.cpp b/prnt/hpcups/SystemServices.cpp
+index f227837..318e539 100644
+--- a/prnt/hpcups/SystemServices.cpp
++++ b/prnt/hpcups/SystemServices.cpp
+@@ -38,7 +38,7 @@ SystemServices::SystemServices(int iLogLevel, int job_id, char* user_name) : m_i
+ if (iLogLevel & SAVE_OUT_FILE)
+ {
+ char fname[MAX_FILE_PATH_LEN];
+- sprintf(fname, "%s/hpcups_%s_out_job%d_XXXXXX",CUPS_TMP_DIR, user_name, job_id);
++ snprintf(fname, sizeof(fname), "%s/hpcups_%s_out_job%d_XXXXXX",CUPS_TMP_DIR, user_name, job_id);
+ createTempFile(fname, &m_fp);
+ if (m_fp)
+ {
diff --git a/debian/patches/0049-Fixed-Device-ID-parsing-code-in-hpijs-s-dj9xxvip.c.patch b/debian/patches/0049-Fixed-Device-ID-parsing-code-in-hpijs-s-dj9xxvip.c.patch
new file mode 100644
index 000000000..42598fb95
--- /dev/null
+++ b/debian/patches/0049-Fixed-Device-ID-parsing-code-in-hpijs-s-dj9xxvip.c.patch
@@ -0,0 +1,49 @@
+From: Tim Waugh <twaugh@fedoraproject.org>
+Date: Fri, 31 Jan 2020 12:46:25 +0100
+Subject: Fixed Device ID parsing code in hpijs's dj9xxvip.c
+
+Origin: https://src.fedoraproject.org/rpms/hplip/blob/master/f/hplip-bad-low-ink-warning.patch
+---
+ prnt/hpijs/dj9xxvip.cpp | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/prnt/hpijs/dj9xxvip.cpp b/prnt/hpijs/dj9xxvip.cpp
+index 519036c..1133b5b 100644
+--- a/prnt/hpijs/dj9xxvip.cpp
++++ b/prnt/hpijs/dj9xxvip.cpp
+@@ -2239,7 +2239,7 @@ DRIVER_ERROR DJ9xxVIP::CheckInkLevel()
+ {
+ case '5':
+ {
+- if ((*(pStr+1) & 0xf3) > 1)
++ if ((*(pStr+1) & 0xf3) > '1')
+ {
+ if (err != NO_ERROR)
+ {
+@@ -2254,7 +2254,7 @@ DRIVER_ERROR DJ9xxVIP::CheckInkLevel()
+ }
+ case '6':
+ {
+- if ((*(pStr+1) & 0xf3) > 1)
++ if ((*(pStr+1) & 0xf3) > '1')
+ {
+ if (err != NO_ERROR)
+ {
+@@ -2269,7 +2269,7 @@ DRIVER_ERROR DJ9xxVIP::CheckInkLevel()
+ }
+ case '7':
+ {
+- if ((*(pStr+1) & 0xf3) > 1)
++ if ((*(pStr+1) & 0xf3) > '1')
+ {
+ if (err != NO_ERROR)
+ {
+@@ -2285,7 +2285,7 @@ DRIVER_ERROR DJ9xxVIP::CheckInkLevel()
+ }
+ case '8':
+ {
+- if ((*(pStr+1) & 0xf3) > 1)
++ if ((*(pStr+1) & 0xf3) > '1')
+ {
+ if (err != NO_ERROR)
+ {
diff --git a/debian/patches/0050-IEEE1284-Device-ID-for-HP-LaserJet-4000.patch b/debian/patches/0050-IEEE1284-Device-ID-for-HP-LaserJet-4000.patch
new file mode 100644
index 000000000..92b367597
--- /dev/null
+++ b/debian/patches/0050-IEEE1284-Device-ID-for-HP-LaserJet-4000.patch
@@ -0,0 +1,21 @@
+From: =?utf-8?b?SmnFmcOtIFBvcGVsa2E=?= <jpopelka@fedoraproject.org>
+Date: Fri, 31 Jan 2020 12:48:11 +0100
+Subject: IEEE1284 Device ID for HP LaserJet 4000
+
+Origin: https://src.fedoraproject.org/rpms/hplip/blob/master/f/hplip-deviceIDs-ppd.patch
+---
+ prnt/ps/hp-lj_300_400_color_m351_m451-ps.ppd | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/prnt/ps/hp-lj_300_400_color_m351_m451-ps.ppd b/prnt/ps/hp-lj_300_400_color_m351_m451-ps.ppd
+index 68a538f..65f9cb4 100644
+--- a/prnt/ps/hp-lj_300_400_color_m351_m451-ps.ppd
++++ b/prnt/ps/hp-lj_300_400_color_m351_m451-ps.ppd
+@@ -83,6 +83,7 @@
+ *cupsManualCopies: False
+ *cupsLanguages: "en da de es fi fr it ja ko nb nl pt ru sv zh_CN zh_TW"
+ *cupsFilter: "application/vnd.cups-postscript 0 hpps"
++*1284DeviceID: "MFG:Hewlett-Packard;MDL:HP LaserJet 400 color M451dn;DES:HP LaserJet 400 color M451dn;"
+ *UIConstraints: *HPOption_Duplexer False *Duplex
+ *UIConstraints: *Duplex *HPOption_Duplexer False
+ *UIConstraints: *HPOption_Tray3 False *InputSlot Tray3
diff --git a/debian/patches/0051-Fix-ImageableArea-for-Laserjet-8150-9000.patch b/debian/patches/0051-Fix-ImageableArea-for-Laserjet-8150-9000.patch
new file mode 100644
index 000000000..96252a20d
--- /dev/null
+++ b/debian/patches/0051-Fix-ImageableArea-for-Laserjet-8150-9000.patch
@@ -0,0 +1,473 @@
+From: =?utf-8?b?SmnFmcOtIFBvcGVsa2E=?= <jpopelka@fedoraproject.org>
+Date: Fri, 31 Jan 2020 12:49:35 +0100
+Subject: Fix ImageableArea for Laserjet 8150/9000
+
+Origin: https://src.fedoraproject.org/rpms/hplip/blob/master/f/hplip-ppd-ImageableArea.patch
+---
+ prnt/ps/hp-laserjet_8150_mfp-ps.ppd | 40 +++++++++++++++++-----------------
+ prnt/ps/hp-laserjet_9000_mfp-ps.ppd | 30 ++++++++++++-------------
+ prnt/ps/hp-laserjet_9000_series-ps.ppd | 30 ++++++++++++-------------
+ 3 files changed, 50 insertions(+), 50 deletions(-)
+
+diff --git a/prnt/ps/hp-laserjet_8150_mfp-ps.ppd b/prnt/ps/hp-laserjet_8150_mfp-ps.ppd
+index 8b51cfc..77ec0af 100644
+--- a/prnt/ps/hp-laserjet_8150_mfp-ps.ppd
++++ b/prnt/ps/hp-laserjet_8150_mfp-ps.ppd
+@@ -3431,7 +3431,7 @@ restore
+ *CloseUI: *PageRegion
+
+ *DefaultImageableArea: Letter
+-*ImageableArea Letter/Letter: "4.00 3.00 606.00 786.00"
++*ImageableArea Letter/Letter: "12.00 12.00 599.76 779.76"
+ *da.ImageableArea Letter/Letter: ""
+ *de.ImageableArea Letter/Letter: ""
+ *es.ImageableArea Letter/Letter: ""
+@@ -3463,7 +3463,7 @@ restore
+ *zh_CN.ImageableArea LetterSmall/信纸 (小): ""
+ *zh_TW.ImageableArea LetterSmall/Letter (小): ""
+
+-*ImageableArea Executive/Executive: "3.00 3.00 516.00 750.00"
++*ImageableArea Executive/Executive: "12.00 12.00 509.76 743.76"
+ *da.ImageableArea Executive/Executive: ""
+ *de.ImageableArea Executive/Executive: ""
+ *es.ImageableArea Executive/Exec: ""
+@@ -3479,7 +3479,7 @@ restore
+ *zh_CN.ImageableArea Executive/Executive: ""
+ *zh_TW.ImageableArea Executive/Executive: ""
+
+-*ImageableArea Legal/Legal: "64.00 54.00 606.00 1002.00"
++*ImageableArea Legal/Legal: "12.00 12.00 599.76 995.76"
+ *da.ImageableArea Legal/Legal: ""
+ *de.ImageableArea Legal/Legal: ""
+ *es.ImageableArea Legal/Legal: ""
+@@ -3495,7 +3495,7 @@ restore
+ *zh_CN.ImageableArea Legal/Legal: ""
+ *zh_TW.ImageableArea Legal/Legal: ""
+
+-*ImageableArea LegalSmall/Legal (Small): "3.00 3.00 548.00 954.00"
++*ImageableArea LegalSmall/Legal (Small): "64.00 54.00 548.00 954.00"
+ *da.ImageableArea LegalSmall/Legal (lille): ""
+ *de.ImageableArea LegalSmall/Legal (Klein): ""
+ *es.ImageableArea LegalSmall/Legal (pequeño): ""
+@@ -3511,7 +3511,7 @@ restore
+ *zh_CN.ImageableArea LegalSmall/Legal (小): ""
+ *zh_TW.ImageableArea LegalSmall/Legal (小): ""
+
+-*ImageableArea Tabloid/11x17: "3.00 3.00 786.00 1218.00"
++*ImageableArea Tabloid/11x17: "12.00 12.00 779.76 1211.76"
+ *da.ImageableArea Tabloid/11x17: ""
+ *de.ImageableArea Tabloid/11x17 Zoll: ""
+ *es.ImageableArea Tabloid/11x17: ""
+@@ -3527,7 +3527,7 @@ restore
+ *zh_CN.ImageableArea Tabloid/11x17: ""
+ *zh_TW.ImageableArea Tabloid/11x17 : ""
+
+-*ImageableArea w842h1274/11x17 (Oversize 11.7x17.7): "3.00 3.00 836.00 1268.00"
++*ImageableArea w842h1274/11x17 (Oversize 11.7x17.7): "12.00 12.00 829.68 1261.68"
+ *da.ImageableArea w842h1274/11x17 (overstr. 297 x 450 mm): ""
+ *de.ImageableArea w842h1274/11x17 Zoll (Übergröße 11,7x17,7 Zoll): ""
+ *es.ImageableArea w842h1274/11x17 (Extra 11,7x17,7) : ""
+@@ -3543,7 +3543,7 @@ restore
+ *zh_CN.ImageableArea w842h1274/11x17 (超大尺寸 11.7x17.7): ""
+ *zh_TW.ImageableArea w842h1274/11x17 (Oversize 11.7x17.7): ""
+
+-*ImageableArea A3/A3: "3.00 3.00 836.00 1185.00"
++*ImageableArea A3/A3: "12.00 12.00 829.44 1178.16"
+ *da.ImageableArea A3/A3: ""
+ *de.ImageableArea A3/A3: ""
+ *es.ImageableArea A3/A3: ""
+@@ -3559,7 +3559,7 @@ restore
+ *zh_CN.ImageableArea A3/A3: ""
+ *zh_TW.ImageableArea A3/A3: ""
+
+-*ImageableArea A4/A4: "4.00 3.00 586.00 836.00"
++*ImageableArea A4/A4: "12.00 12.00 582.96 829.44"
+ *da.ImageableArea A4/A4: ""
+ *de.ImageableArea A4/A4: ""
+ *es.ImageableArea A4/A4: ""
+@@ -3591,7 +3591,7 @@ restore
+ *zh_CN.ImageableArea A4Small/A4 (小): ""
+ *zh_TW.ImageableArea A4Small/A4 (小): ""
+
+-*ImageableArea A5/A5: "3.00 3.00 414.00 589.00"
++*ImageableArea A5/A5: "12.00 12.00 407.28 582.96"
+ *da.ImageableArea A5/A5: ""
+ *de.ImageableArea A5/A5: ""
+ *es.ImageableArea A5/A5: ""
+@@ -3607,7 +3607,7 @@ restore
+ *zh_CN.ImageableArea A5/A5: ""
+ *zh_TW.ImageableArea A5/A5: ""
+
+-*ImageableArea B4/JIS B4: "3.00 3.00 723.00 1026.00"
++*ImageableArea B4/JIS B4: "12.00 12.00 716.16 1019.52"
+ *da.ImageableArea B4/JIS B4: ""
+ *de.ImageableArea B4/B4 (JIS): ""
+ *es.ImageableArea B4/JIS B4: ""
+@@ -3623,7 +3623,7 @@ restore
+ *zh_CN.ImageableArea B4/JIS B4: ""
+ *zh_TW.ImageableArea B4/JIS B4: ""
+
+-*ImageableArea B5/JIS B5: "3.00 3.00 510.00 723.00"
++*ImageableArea B5/JIS B5: "12.00 12.00 503.52 716.16"
+ *da.ImageableArea B5/JIS B5: ""
+ *de.ImageableArea B5/JIS B5: ""
+ *es.ImageableArea B5/JIS B5: ""
+@@ -3639,7 +3639,7 @@ restore
+ *zh_CN.ImageableArea B5/JIS B5: ""
+ *zh_TW.ImageableArea B5/JIS B5: ""
+
+-*ImageableArea DoublePostcard/Double Postcard (JIS): "3.00 3.00 413.50 561.00"
++*ImageableArea DoublePostcard/Double Postcard (JIS): "12.00 12.00 407.28 554.64"
+ *da.ImageableArea DoublePostcard/Dobbelt postkort (JIS): ""
+ *de.ImageableArea DoublePostcard/Doppelte Postkarte (JIS): ""
+ *es.ImageableArea DoublePostcard/Tarjeta postal doble (JIS): ""
+@@ -3655,7 +3655,7 @@ restore
+ *zh_CN.ImageableArea DoublePostcard/大号明信片 (JIS): ""
+ *zh_TW.ImageableArea DoublePostcard/雙聯明信片(JIS): ""
+
+-*ImageableArea w612h935/Executive (JIS): "3.00 3.00 606.00 929.00"
++*ImageableArea w612h935/Executive (JIS): "12.00 12.00 599.76 922.76"
+ *da.ImageableArea w612h935/Executive (JIS): ""
+ *de.ImageableArea w612h935/Executive (JIS): ""
+ *es.ImageableArea w612h935/Exec (JIS): ""
+@@ -3671,7 +3671,7 @@ restore
+ *zh_CN.ImageableArea w612h935/Executive (JIS): ""
+ *zh_TW.ImageableArea w612h935/Executive (JIS): ""
+
+-*ImageableArea w558h774/16K: "3.00 3.00 552.00 768.00"
++*ImageableArea w558h774/16K: "12.00 12.00 545.76 761.76"
+ *da.ImageableArea w558h774/16K: ""
+ *de.ImageableArea w558h774/16K: ""
+ *es.ImageableArea w558h774/16K: ""
+@@ -3687,7 +3687,7 @@ restore
+ *zh_CN.ImageableArea w558h774/16K: ""
+ *zh_TW.ImageableArea w558h774/16K: ""
+
+-*ImageableArea w774h1116/8K: "3.00 3.00 768.00 1110.00"
++*ImageableArea w774h1116/8K: "12.00 12.00 761.76 1103.76"
+ *da.ImageableArea w774h1116/8K: ""
+ *de.ImageableArea w774h1116/8K: ""
+ *es.ImageableArea w774h1116/8K: ""
+@@ -3703,7 +3703,7 @@ restore
+ *zh_CN.ImageableArea w774h1116/8K: ""
+ *zh_TW.ImageableArea w774h1116/8K: ""
+
+-*ImageableArea Env10/Env Comm10: "3.00 3.00 291.00 678.00"
++*ImageableArea Env10/Env Comm10: "12.00 12.00 284.64 671.76"
+ *da.ImageableArea Env10/Konvolut Comm10: ""
+ *de.ImageableArea Env10/Umschlag Comm10: ""
+ *es.ImageableArea Env10/Sobre Comm10: ""
+@@ -3719,7 +3719,7 @@ restore
+ *zh_CN.ImageableArea Env10/Comm10号信封: ""
+ *zh_TW.ImageableArea Env10/Comm10 信封: ""
+
+-*ImageableArea EnvMonarch/Env Monarch: "3.00 3.00 273.00 534.00"
++*ImageableArea EnvMonarch/Env Monarch: "12.00 12.00 266.64 527.76"
+ *da.ImageableArea EnvMonarch/Konvolut Monarch: ""
+ *de.ImageableArea EnvMonarch/Umschlag Monarch: ""
+ *es.ImageableArea EnvMonarch/Sobre Monarch: ""
+@@ -3735,7 +3735,7 @@ restore
+ *zh_CN.ImageableArea EnvMonarch/Monarch号信封: ""
+ *zh_TW.ImageableArea EnvMonarch/Monarch 信封: ""
+
+-*ImageableArea EnvDL/Env DL: "3.00 3.00 306.00 618.00"
++*ImageableArea EnvDL/Env DL: "12.00 12.00 299.52 611.28"
+ *da.ImageableArea EnvDL/Konvolut DL: ""
+ *de.ImageableArea EnvDL/Umschlag DL: ""
+ *es.ImageableArea EnvDL/Sobre DL: ""
+@@ -3751,7 +3751,7 @@ restore
+ *zh_CN.ImageableArea EnvDL/DL号信封: ""
+ *zh_TW.ImageableArea EnvDL/DL 信封: ""
+
+-*ImageableArea EnvC5/Env C5: "3.00 3.00 453.00 643.00"
++*ImageableArea EnvC5/Env C5: "12.00 12.00 446.88 636.72"
+ *da.ImageableArea EnvC5/Konvolut C5: ""
+ *de.ImageableArea EnvC5/Umschlag C5: ""
+ *es.ImageableArea EnvC5/Sobre C5: ""
+@@ -3767,7 +3767,7 @@ restore
+ *zh_CN.ImageableArea EnvC5/C5号信封: ""
+ *zh_TW.ImageableArea EnvC5/C5 信封: ""
+
+-*ImageableArea EnvISOB5/Env ISO B5: "3.00 3.00 493.00 703.00"
++*ImageableArea EnvISOB5/Env ISO B5: "12.00 12.00 486.48 696.24"
+ *da.ImageableArea EnvISOB5/Konvolut ISO B5: ""
+ *de.ImageableArea EnvISOB5/Umschlag ISO B5: ""
+ *es.ImageableArea EnvISOB5/Sobre ISO B5: ""
+diff --git a/prnt/ps/hp-laserjet_9000_mfp-ps.ppd b/prnt/ps/hp-laserjet_9000_mfp-ps.ppd
+index cea9ae7..cd25343 100644
+--- a/prnt/ps/hp-laserjet_9000_mfp-ps.ppd
++++ b/prnt/ps/hp-laserjet_9000_mfp-ps.ppd
+@@ -2594,7 +2594,7 @@ currentpagedevice /MediaProcessing known
+ *CloseUI: *PageRegion
+
+ *DefaultImageableArea: Letter
+-*ImageableArea Letter/Letter: "6.00 6.00 606.00 786.00"
++*ImageableArea Letter/Letter: "12.00 12.00 599.76 779.76"
+ *da.ImageableArea Letter/Letter: ""
+ *de.ImageableArea Letter/Letter: ""
+ *es.ImageableArea Letter/Letter: ""
+@@ -2626,7 +2626,7 @@ currentpagedevice /MediaProcessing known
+ *zh_CN.ImageableArea LetterSmall/信纸 (小): ""
+ *zh_TW.ImageableArea LetterSmall/Letter (小): ""
+
+-*ImageableArea Executive/Executive: "6.00 6.00 516.00 750.00"
++*ImageableArea Executive/Executive: "12.00 12.00 509.76 743.76"
+ *da.ImageableArea Executive/Executive: ""
+ *de.ImageableArea Executive/Executive: ""
+ *es.ImageableArea Executive/Exec: ""
+@@ -2642,7 +2642,7 @@ currentpagedevice /MediaProcessing known
+ *zh_CN.ImageableArea Executive/Executive: ""
+ *zh_TW.ImageableArea Executive/Executive: ""
+
+-*ImageableArea Legal/Legal: "6.00 6.00 606.00 1002.00"
++*ImageableArea Legal/Legal: "12.00 12.00 599.76 995.76"
+ *da.ImageableArea Legal/Legal: ""
+ *de.ImageableArea Legal/Legal: ""
+ *es.ImageableArea Legal/Legal: ""
+@@ -2674,7 +2674,7 @@ currentpagedevice /MediaProcessing known
+ *zh_CN.ImageableArea LegalSmall/Legal (小): ""
+ *zh_TW.ImageableArea LegalSmall/Legal (小): ""
+
+-*ImageableArea Tabloid/11x17: "6.00 6.00 786.00 1218.00"
++*ImageableArea Tabloid/11x17: "12.00 12.00 779.76 1211.76"
+ *da.ImageableArea Tabloid/11x17: ""
+ *de.ImageableArea Tabloid/11x17 Zoll: ""
+ *es.ImageableArea Tabloid/11x17: ""
+@@ -2690,7 +2690,7 @@ currentpagedevice /MediaProcessing known
+ *zh_CN.ImageableArea Tabloid/11x17: ""
+ *zh_TW.ImageableArea Tabloid/11x17 : ""
+
+-*ImageableArea w842h1274/11x17 (Oversize 11.7x17.7): "6.00 6.00 836.00 1268.00"
++*ImageableArea w842h1274/11x17 (Oversize 11.7x17.7): "12.00 12.00 829.68 1261.68"
+ *da.ImageableArea w842h1274/11x17 (overstr. 297 x 450 mm): ""
+ *de.ImageableArea w842h1274/11x17 Zoll (Übergröße 11,7x17,7 Zoll): ""
+ *es.ImageableArea w842h1274/11x17 (Extra 11,7x17,7) : ""
+@@ -2706,7 +2706,7 @@ currentpagedevice /MediaProcessing known
+ *zh_CN.ImageableArea w842h1274/11x17 (超大尺寸 11.7x17.7): ""
+ *zh_TW.ImageableArea w842h1274/11x17 (Oversize 11.7x17.7): ""
+
+-*ImageableArea A3/A3: "6.00 6.00 836.00 1185.00"
++*ImageableArea A3/A3: "12.00 12.00 829.44 1178.16"
+ *da.ImageableArea A3/A3: ""
+ *de.ImageableArea A3/A3: ""
+ *es.ImageableArea A3/A3: ""
+@@ -2722,7 +2722,7 @@ currentpagedevice /MediaProcessing known
+ *zh_CN.ImageableArea A3/A3: ""
+ *zh_TW.ImageableArea A3/A3: ""
+
+-*ImageableArea A4/A4: "6.00 6.00 589.00 836.00"
++*ImageableArea A4/A4: "12.00 12.00 582.96 829.44"
+ *da.ImageableArea A4/A4: ""
+ *de.ImageableArea A4/A4: ""
+ *es.ImageableArea A4/A4: ""
+@@ -2754,7 +2754,7 @@ currentpagedevice /MediaProcessing known
+ *zh_CN.ImageableArea A4Small/A4 (小): ""
+ *zh_TW.ImageableArea A4Small/A4 (小): ""
+
+-*ImageableArea A5/A5: "6.00 6.00 414.00 589.00"
++*ImageableArea A5/A5: "12.00 12.00 407.28 582.96"
+ *da.ImageableArea A5/A5: ""
+ *de.ImageableArea A5/A5: ""
+ *es.ImageableArea A5/A5: ""
+@@ -2770,7 +2770,7 @@ currentpagedevice /MediaProcessing known
+ *zh_CN.ImageableArea A5/A5: ""
+ *zh_TW.ImageableArea A5/A5: ""
+
+-*ImageableArea B4/JIS B4: "6.00 6.00 723.00 1026.00"
++*ImageableArea B4/JIS B4: "12.00 12.00 716.16 1019.52"
+ *da.ImageableArea B4/JIS B4: ""
+ *de.ImageableArea B4/B4 (JIS): ""
+ *es.ImageableArea B4/JIS B4: ""
+@@ -2786,7 +2786,7 @@ currentpagedevice /MediaProcessing known
+ *zh_CN.ImageableArea B4/JIS B4: ""
+ *zh_TW.ImageableArea B4/JIS B4: ""
+
+-*ImageableArea B5/JIS B5: "6.00 6.00 510.00 723.00"
++*ImageableArea B5/JIS B5: "12.00 12.00 503.52 716.16"
+ *da.ImageableArea B5/JIS B5: ""
+ *de.ImageableArea B5/JIS B5: ""
+ *es.ImageableArea B5/JIS B5: ""
+@@ -2802,7 +2802,7 @@ currentpagedevice /MediaProcessing known
+ *zh_CN.ImageableArea B5/JIS B5: ""
+ *zh_TW.ImageableArea B5/JIS B5: ""
+
+-*ImageableArea DoublePostcard/Double Postcard (JIS): "6.00 6.00 413.50 561.00"
++*ImageableArea DoublePostcard/Double Postcard (JIS): "12.00 12.00 407.28 554.64"
+ *da.ImageableArea DoublePostcard/Dobbelt postkort (JIS): ""
+ *de.ImageableArea DoublePostcard/Doppelte Postkarte (JIS): ""
+ *es.ImageableArea DoublePostcard/Tarjeta postal doble (JIS): ""
+@@ -2818,7 +2818,7 @@ currentpagedevice /MediaProcessing known
+ *zh_CN.ImageableArea DoublePostcard/大号明信片 (JIS): ""
+ *zh_TW.ImageableArea DoublePostcard/雙聯明信片(JIS): ""
+
+-*ImageableArea w612h935/Executive (JIS): "6.00 6.00 606.00 929.00"
++*ImageableArea w612h935/Executive (JIS): "12.00 12.00 599.76 922.76"
+ *da.ImageableArea w612h935/Executive (JIS): ""
+ *de.ImageableArea w612h935/Executive (JIS): ""
+ *es.ImageableArea w612h935/Exec (JIS): ""
+@@ -2834,7 +2834,7 @@ currentpagedevice /MediaProcessing known
+ *zh_CN.ImageableArea w612h935/Executive (JIS): ""
+ *zh_TW.ImageableArea w612h935/Executive (JIS): ""
+
+-*ImageableArea w558h774/16K: "6.00 6.00 552.00 768.00"
++*ImageableArea w558h774/16K: "12.00 12.00 545.76 761.76"
+ *da.ImageableArea w558h774/16K: ""
+ *de.ImageableArea w558h774/16K: ""
+ *es.ImageableArea w558h774/16K: ""
+@@ -2850,7 +2850,7 @@ currentpagedevice /MediaProcessing known
+ *zh_CN.ImageableArea w558h774/16K: ""
+ *zh_TW.ImageableArea w558h774/16K: ""
+
+-*ImageableArea w774h1116/8K: "6.00 6.00 768.00 1110.00"
++*ImageableArea w774h1116/8K: "12.00 12.00 761.76 1103.76"
+ *da.ImageableArea w774h1116/8K: ""
+ *de.ImageableArea w774h1116/8K: ""
+ *es.ImageableArea w774h1116/8K: ""
+@@ -2866,7 +2866,7 @@ currentpagedevice /MediaProcessing known
+ *zh_CN.ImageableArea w774h1116/8K: ""
+ *zh_TW.ImageableArea w774h1116/8K: ""
+
+-*ImageableArea Env10/Env Comm10: "11.00 11.00 286.00 673.00"
++*ImageableArea Env10/Env Comm10: "12.00 12.00 284.64 671.76"
+ *da.ImageableArea Env10/Konvolut Comm10: ""
+ *de.ImageableArea Env10/Umschlag Comm10: ""
+ *es.ImageableArea Env10/Sobre Comm10: ""
+diff --git a/prnt/ps/hp-laserjet_9000_series-ps.ppd b/prnt/ps/hp-laserjet_9000_series-ps.ppd
+index a82cf43..8d90946 100644
+--- a/prnt/ps/hp-laserjet_9000_series-ps.ppd
++++ b/prnt/ps/hp-laserjet_9000_series-ps.ppd
+@@ -2661,7 +2661,7 @@ currentpagedevice /MediaProcessing known
+ *CloseUI: *PageRegion
+
+ *DefaultImageableArea: Letter
+-*ImageableArea Letter/Letter: "6.00 6.00 606.00 786.00"
++*ImageableArea Letter/Letter: "12.00 12.00 599.76 779.76"
+ *da.ImageableArea Letter/Letter: ""
+ *de.ImageableArea Letter/Letter: ""
+ *es.ImageableArea Letter/Letter: ""
+@@ -2693,7 +2693,7 @@ currentpagedevice /MediaProcessing known
+ *zh_CN.ImageableArea LetterSmall/信纸 (小): ""
+ *zh_TW.ImageableArea LetterSmall/Letter (小): ""
+
+-*ImageableArea Executive/Executive: "6.00 6.00 516.00 750.00"
++*ImageableArea Executive/Executive: "12.00 12.00 509.76 743.76"
+ *da.ImageableArea Executive/Executive: ""
+ *de.ImageableArea Executive/Executive: ""
+ *es.ImageableArea Executive/Exec: ""
+@@ -2709,7 +2709,7 @@ currentpagedevice /MediaProcessing known
+ *zh_CN.ImageableArea Executive/Executive: ""
+ *zh_TW.ImageableArea Executive/Executive: ""
+
+-*ImageableArea Legal/Legal: "6.00 6.00 606.00 1002.00"
++*ImageableArea Legal/Legal: "12.00 12.00 599.76 995.76"
+ *da.ImageableArea Legal/Legal: ""
+ *de.ImageableArea Legal/Legal: ""
+ *es.ImageableArea Legal/Legal: ""
+@@ -2741,7 +2741,7 @@ currentpagedevice /MediaProcessing known
+ *zh_CN.ImageableArea LegalSmall/Legal (小): ""
+ *zh_TW.ImageableArea LegalSmall/Legal (小): ""
+
+-*ImageableArea Tabloid/11x17: "6.00 6.00 786.00 1218.00"
++*ImageableArea Tabloid/11x17: "12.00 12.00 779.76 1211.76"
+ *da.ImageableArea Tabloid/11x17: ""
+ *de.ImageableArea Tabloid/11x17 Zoll: ""
+ *es.ImageableArea Tabloid/11x17: ""
+@@ -2757,7 +2757,7 @@ currentpagedevice /MediaProcessing known
+ *zh_CN.ImageableArea Tabloid/11x17: ""
+ *zh_TW.ImageableArea Tabloid/11x17 : ""
+
+-*ImageableArea w842h1274/11x17 (Oversize 11.7x17.7): "6.00 6.00 836.00 1268.00"
++*ImageableArea w842h1274/11x17 (Oversize 11.7x17.7): "12.00 12.00 829.68 1261.68"
+ *da.ImageableArea w842h1274/11x17 (overstr. 297 x 450 mm): ""
+ *de.ImageableArea w842h1274/11x17 Zoll (Übergröße 11,7x17,7 Zoll): ""
+ *es.ImageableArea w842h1274/11x17 (Extra 11,7x17,7) : ""
+@@ -2773,7 +2773,7 @@ currentpagedevice /MediaProcessing known
+ *zh_CN.ImageableArea w842h1274/11x17 (超大尺寸 11.7x17.7): ""
+ *zh_TW.ImageableArea w842h1274/11x17 (Oversize 11.7x17.7): ""
+
+-*ImageableArea A3/A3: "6.00 6.00 836.00 1185.00"
++*ImageableArea A3/A3: "12.00 12.00 829.44 1178.16"
+ *da.ImageableArea A3/A3: ""
+ *de.ImageableArea A3/A3: ""
+ *es.ImageableArea A3/A3: ""
+@@ -2789,7 +2789,7 @@ currentpagedevice /MediaProcessing known
+ *zh_CN.ImageableArea A3/A3: ""
+ *zh_TW.ImageableArea A3/A3: ""
+
+-*ImageableArea A4/A4: "6.00 6.00 589.00 836.00"
++*ImageableArea A4/A4: "12.00 12.00 582.96 829.44"
+ *da.ImageableArea A4/A4: ""
+ *de.ImageableArea A4/A4: ""
+ *es.ImageableArea A4/A4: ""
+@@ -2821,7 +2821,7 @@ currentpagedevice /MediaProcessing known
+ *zh_CN.ImageableArea A4Small/A4 (小): ""
+ *zh_TW.ImageableArea A4Small/A4 (小): ""
+
+-*ImageableArea A5/A5: "6.00 6.00 414.00 589.00"
++*ImageableArea A5/A5: "12.00 12.00 407.28 582.96"
+ *da.ImageableArea A5/A5: ""
+ *de.ImageableArea A5/A5: ""
+ *es.ImageableArea A5/A5: ""
+@@ -2837,7 +2837,7 @@ currentpagedevice /MediaProcessing known
+ *zh_CN.ImageableArea A5/A5: ""
+ *zh_TW.ImageableArea A5/A5: ""
+
+-*ImageableArea B4/JIS B4: "6.00 6.00 723.00 1026.00"
++*ImageableArea B4/JIS B4: "12.00 12.00 716.16 1019.52"
+ *da.ImageableArea B4/JIS B4: ""
+ *de.ImageableArea B4/B4 (JIS): ""
+ *es.ImageableArea B4/JIS B4: ""
+@@ -2853,7 +2853,7 @@ currentpagedevice /MediaProcessing known
+ *zh_CN.ImageableArea B4/JIS B4: ""
+ *zh_TW.ImageableArea B4/JIS B4: ""
+
+-*ImageableArea B5/JIS B5: "6.00 6.00 510.00 723.00"
++*ImageableArea B5/JIS B5: "12.00 12.00 503.52 716.16"
+ *da.ImageableArea B5/JIS B5: ""
+ *de.ImageableArea B5/JIS B5: ""
+ *es.ImageableArea B5/JIS B5: ""
+@@ -2869,7 +2869,7 @@ currentpagedevice /MediaProcessing known
+ *zh_CN.ImageableArea B5/JIS B5: ""
+ *zh_TW.ImageableArea B5/JIS B5: ""
+
+-*ImageableArea DoublePostcard/Double Postcard (JIS): "6.00 6.00 413.50 561.00"
++*ImageableArea DoublePostcard/Double Postcard (JIS): "12.00 12.00 407.28 554.64"
+ *da.ImageableArea DoublePostcard/Dobbelt postkort (JIS): ""
+ *de.ImageableArea DoublePostcard/Doppelte Postkarte (JIS): ""
+ *es.ImageableArea DoublePostcard/Tarjeta postal doble (JIS): ""
+@@ -2885,7 +2885,7 @@ currentpagedevice /MediaProcessing known
+ *zh_CN.ImageableArea DoublePostcard/大号明信片 (JIS): ""
+ *zh_TW.ImageableArea DoublePostcard/雙聯明信片(JIS): ""
+
+-*ImageableArea w612h935/Executive (JIS): "6.00 6.00 606.00 929.00"
++*ImageableArea w612h935/Executive (JIS): "12.00 12.00 599.76 922.76"
+ *da.ImageableArea w612h935/Executive (JIS): ""
+ *de.ImageableArea w612h935/Executive (JIS): ""
+ *es.ImageableArea w612h935/Exec (JIS): ""
+@@ -2901,7 +2901,7 @@ currentpagedevice /MediaProcessing known
+ *zh_CN.ImageableArea w612h935/Executive (JIS): ""
+ *zh_TW.ImageableArea w612h935/Executive (JIS): ""
+
+-*ImageableArea w558h774/16K: "6.00 6.00 552.00 768.00"
++*ImageableArea w558h774/16K: "12.00 12.00 545.76 761.76"
+ *da.ImageableArea w558h774/16K: ""
+ *de.ImageableArea w558h774/16K: ""
+ *es.ImageableArea w558h774/16K: ""
+@@ -2917,7 +2917,7 @@ currentpagedevice /MediaProcessing known
+ *zh_CN.ImageableArea w558h774/16K: ""
+ *zh_TW.ImageableArea w558h774/16K: ""
+
+-*ImageableArea w774h1116/8K: "6.00 6.00 768.00 1110.00"
++*ImageableArea w774h1116/8K: "12.00 12.00 761.76 1103.76"
+ *da.ImageableArea w774h1116/8K: ""
+ *de.ImageableArea w774h1116/8K: ""
+ *es.ImageableArea w774h1116/8K: ""
+@@ -2933,7 +2933,7 @@ currentpagedevice /MediaProcessing known
+ *zh_CN.ImageableArea w774h1116/8K: ""
+ *zh_TW.ImageableArea w774h1116/8K: ""
+
+-*ImageableArea Env10/Env Comm10: "11.00 11.00 286.00 673.00"
++*ImageableArea Env10/Env Comm10: "12.00 12.00 284.64 671.76"
+ *da.ImageableArea Env10/Konvolut Comm10: ""
+ *de.ImageableArea Env10/Umschlag Comm10: ""
+ *es.ImageableArea Env10/Sobre Comm10: ""
diff --git a/debian/patches/0052-Fix-parsing-of-avahi-daemon-output.patch b/debian/patches/0052-Fix-parsing-of-avahi-daemon-output.patch
new file mode 100644
index 000000000..5432b75ad
--- /dev/null
+++ b/debian/patches/0052-Fix-parsing-of-avahi-daemon-output.patch
@@ -0,0 +1,29 @@
+From: =?utf-8?b?SmnFmcOtIFBvcGVsa2E=?= <jpopelka@fedoraproject.org>
+Date: Fri, 31 Jan 2020 12:58:28 +0100
+Subject: Fix parsing of avahi-daemon output
+
+Origin: https://src.fedoraproject.org/rpms/hplip/blob/master/f/hplip-avahi-parsing.patch
+---
+ base/avahi.py | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/base/avahi.py b/base/avahi.py
+index 38a0e29..e96296b 100755
+--- a/base/avahi.py
++++ b/base/avahi.py
+@@ -52,9 +52,14 @@ def detectNetworkDevices(ttl=4, timeout=10):
+ 'status_code': 0, 'device2': '0', 'device3': '0', 'note': ''}
+ y['ip'] = ip
+ y['hn'] = bits[6].replace('.local', '')
+- details = bits[9].split('" "')
++ details = bits[9].rstrip ().strip ('"').split('" "')
+ for item in details:
+ key, value = item.split('=', 1)
++ keyvalue = item.split('=', 1)
++ if len (keyvalue) < 2:
++ # Skip parts that don't match key=value
++ continue
++ key, value = keyvalue
+ if key == 'ty':
+ y['mdns'] = value
+ y['device1'] = "MFG:Hewlett-Packard;MDL:%s;CLS:PRINTER;" % value
diff --git a/debian/patches/0053-Fixed-left-right-margins-for-HP-DeskJet-990C.patch b/debian/patches/0053-Fixed-left-right-margins-for-HP-DeskJet-990C.patch
new file mode 100644
index 000000000..ffde5af73
--- /dev/null
+++ b/debian/patches/0053-Fixed-left-right-margins-for-HP-DeskJet-990C.patch
@@ -0,0 +1,25 @@
+From: Tim Waugh <twaugh@redhat.com>
+Date: Fri, 31 Jan 2020 13:00:49 +0100
+Subject: Fixed left/right margins for HP DeskJet 990C
+
+Origin: https://src.fedoraproject.org/rpms/hplip/blob/master/f/hplip-dj990c-margin.patch
+---
+ prnt/drv/hpcups.drv.in | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/prnt/drv/hpcups.drv.in b/prnt/drv/hpcups.drv.in
+index 4e9a96b..efa2a10 100644
+--- a/prnt/drv/hpcups.drv.in
++++ b/prnt/drv/hpcups.drv.in
+@@ -1486,9 +1486,9 @@ Manufacturer "HP"
+ "<</cupsInteger0 2/PageSize[612 792]/ImagingBBox null>>setpagedevice"
+ CustomMedia "Letter.Duplex/Letter AutoDuplex 8.5x11in" 612 783 18 27 18 36 "<</cupsInteger0 2/PageSize[612 783]/ImagingBBox null>>setpagedevice"
+ "<</cupsInteger0 2/PageSize[612 783]/ImagingBBox null>>setpagedevice"
+- CustomMedia "A4/A4 210x297mm" 595.44 841.68 18 36.00 18 9.00 "<</cupsInteger0 26/PageSize[595.44 841.68]/ImagingBBox null>>setpagedevice"
++ CustomMedia "A4/A4 210x297mm" 595.44 841.68 9 36.00 9 9.00 "<</cupsInteger0 26/PageSize[595.44 841.68]/ImagingBBox null>>setpagedevice"
+ "<</cupsInteger0 26/PageSize[595.44 841.68]/ImagingBBox null>>setpagedevice"
+- CustomMedia "A4.Duplex/A4 AutoDuplex 210x297mm" 595 833 18 27 18 36 "<</cupsInteger0 26/PageSize[595 833]/ImagingBBox null>>setpagedevice"
++ CustomMedia "A4.Duplex/A4 AutoDuplex 210x297mm" 595 833 9 27 9 36 "<</cupsInteger0 26/PageSize[595 833]/ImagingBBox null>>setpagedevice"
+ "<</cupsInteger0 26/PageSize[595 833]/ImagingBBox null>>setpagedevice"
+ CustomMedia "ExecutiveJIS/Executive (JIS) 8.5x12.986in" 612 936 18 36 18 9 "<</cupsInteger0 10/PageSize[612 936]/ImagingBBox null>>setpagedevice"
+ "<</cupsInteger0 10/PageSize[612 936]/ImagingBBox null>>setpagedevice"
diff --git a/debian/patches/0054-Fixed-uses-of-strncpy-throughout.patch b/debian/patches/0054-Fixed-uses-of-strncpy-throughout.patch
new file mode 100644
index 000000000..0533afb5a
--- /dev/null
+++ b/debian/patches/0054-Fixed-uses-of-strncpy-throughout.patch
@@ -0,0 +1,62 @@
+From: Tim Waugh <twaugh@redhat.com>
+Date: Fri, 31 Jan 2020 13:01:56 +0100
+Subject: Fixed uses of strncpy throughout
+
+Origin: https://src.fedoraproject.org/rpms/hplip/blob/master/f/hplip-strncpy.patch
+---
+ prnt/hpcups/HPCupsFilter.cpp | 7 ++++---
+ prnt/hpijs/hpijs.cpp | 2 +-
+ prnt/hpijs/hpijsfax.cpp | 2 +-
+ 3 files changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/prnt/hpcups/HPCupsFilter.cpp b/prnt/hpcups/HPCupsFilter.cpp
+index f7f1a98..dbe295c 100644
+--- a/prnt/hpcups/HPCupsFilter.cpp
++++ b/prnt/hpcups/HPCupsFilter.cpp
+@@ -207,6 +207,7 @@ HPCupsFilter::HPCupsFilter() : m_pPrinterBuffer(NULL)
+ adj_k_width = 0;
+ black_raster = NULL;
+ color_raster = NULL;
++ memset (&m_JA, 0, sizeof (m_JA));
+ }
+
+ HPCupsFilter::~HPCupsFilter()
+@@ -414,9 +415,9 @@ DRIVER_ERROR HPCupsFilter::startPage (cups_page_header2_t *cups_header)
+ m_JA.media_attributes.physical_height = cups_header->PageSize[1];
+ m_JA.media_attributes.printable_width = ((cups_header->ImagingBoundingBox[2]-cups_header->ImagingBoundingBox[0]) * horz_res) / 72;
+ m_JA.media_attributes.printable_height = ((cups_header->ImagingBoundingBox[3]-cups_header->ImagingBoundingBox[1]) * vert_res) / 72;
+- strncpy(m_JA.media_attributes.PageSizeName, &cups_header->cupsString[0][0], sizeof(m_JA.media_attributes.PageSizeName));
+- strncpy(m_JA.media_attributes.MediaTypeName, cups_header->MediaType, sizeof(m_JA.media_attributes.MediaTypeName));
+- strncpy(m_JA.quality_attributes.hbpl1_print_quality, cups_header->OutputType, sizeof(m_JA.quality_attributes.hbpl1_print_quality));
++ strncpy(m_JA.media_attributes.PageSizeName, &cups_header->cupsString[0][0], sizeof(m_JA.media_attributes.PageSizeName)-1);
++ strncpy(m_JA.media_attributes.MediaTypeName, cups_header->MediaType, sizeof(m_JA.media_attributes.MediaTypeName)-1);
++ strncpy(m_JA.quality_attributes.hbpl1_print_quality, cups_header->OutputType, sizeof(m_JA.quality_attributes.hbpl1_print_quality)-1);
+ m_JA.color_mode = cups_header->cupsRowStep;
+ }
+ else {
+diff --git a/prnt/hpijs/hpijs.cpp b/prnt/hpijs/hpijs.cpp
+index 8ad7cf2..9c7f7a2 100644
+--- a/prnt/hpijs/hpijs.cpp
++++ b/prnt/hpijs/hpijs.cpp
+@@ -605,7 +605,7 @@ int main (int argc, char *argv[], char *evenp[])
+ }
+
+ if (argc > 2)
+- strncpy(user_name, argv[2], sizeof(user_name));
++ strncpy(user_name, argv[2], sizeof(user_name) - 1);
+
+ #ifdef HAVE_LIBHPIP
+ char *pDev;
+diff --git a/prnt/hpijs/hpijsfax.cpp b/prnt/hpijs/hpijsfax.cpp
+index d986d97..2e6f96c 100644
+--- a/prnt/hpijs/hpijsfax.cpp
++++ b/prnt/hpijs/hpijsfax.cpp
+@@ -282,7 +282,7 @@ int hpijsFaxServer (int argc, char **argv)
+ char user_name[32]={0,};
+
+ if (argc > 2)
+- strncpy(user_name, argv[2], sizeof(user_name));
++ strncpy(user_name, argv[2], sizeof(user_name) - 1);
+
+ snprintf(hpFileName,sizeof(hpFileName),"%s/hp_%s_ijsfax_Log_XXXXXX",CUPS_TMP_DIR, user_name);
+
diff --git a/debian/patches/0055-Ignore-IOError-when-logging-output.patch b/debian/patches/0055-Ignore-IOError-when-logging-output.patch
new file mode 100644
index 000000000..af5edc067
--- /dev/null
+++ b/debian/patches/0055-Ignore-IOError-when-logging-output.patch
@@ -0,0 +1,22 @@
+From: Tim Waugh <twaugh@redhat.com>
+Date: Fri, 31 Jan 2020 13:05:07 +0100
+Subject: Ignore IOError when logging output
+
+Origin: https://src.fedoraproject.org/rpms/hplip/blob/master/f/hplip-silence-ioerror.patch
+---
+ base/logger.py | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/base/logger.py b/base/logger.py
+index 949c2f7..1a37379 100644
+--- a/base/logger.py
++++ b/base/logger.py
+@@ -199,6 +199,8 @@ class Logger(object):
+ out.write('\n')
+
+ out.flush()
++ except IOError:
++ pass
+ finally:
+ self._lock.release()
+
diff --git a/debian/patches/0056-Exit-if-source-cannot-be-fetched-from-device.patch b/debian/patches/0056-Exit-if-source-cannot-be-fetched-from-device.patch
new file mode 100644
index 000000000..3a48ec87f
--- /dev/null
+++ b/debian/patches/0056-Exit-if-source-cannot-be-fetched-from-device.patch
@@ -0,0 +1,21 @@
+From: Zdenek Dohnal <zdohnal@redhat.com>
+Date: Fri, 31 Jan 2020 13:12:46 +0100
+Subject: Exit if source cannot be fetched from device
+
+Origin: https://src.fedoraproject.org/rpms/hplip/blob/master/f/hplip-3165-sourceoption.patch
+---
+ scan.py | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/scan.py b/scan.py
+index 1e93982..010ece9 100755
+--- a/scan.py
++++ b/scan.py
+@@ -965,6 +965,7 @@ try:
+ sys.exit(1)
+ except:
+ log.error("Failed to get the source from device.")
++ sys.exit(1)
+
+ #check if device has only ADF
+ if len(source_option) == 1 and 'ADF' in source_option:
diff --git a/debian/patches/0057-hp-check-shows-CUPS-incompatible-or-not-running-even.patch b/debian/patches/0057-hp-check-shows-CUPS-incompatible-or-not-running-even.patch
new file mode 100644
index 000000000..9eb02a3bb
--- /dev/null
+++ b/debian/patches/0057-hp-check-shows-CUPS-incompatible-or-not-running-even.patch
@@ -0,0 +1,27 @@
+From: Zdenek Dohnal <zdohnal@redhat.com>
+Date: Fri, 31 Jan 2020 13:15:42 +0100
+Subject: hp-check shows 'CUPS incompatible or not running' even if CUPS is
+ running
+
+Origin: https://src.fedoraproject.org/rpms/hplip/blob/master/f/hplip-check-cups.patch
+---
+ installer/core_install.py | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/installer/core_install.py b/installer/core_install.py
+index 461a34b..1673211 100644
+--- a/installer/core_install.py
++++ b/installer/core_install.py
+@@ -360,9 +360,9 @@ class CoreInstall(object):
+ 'automake': (True, ['prnt'], AUTOMAKE_STR, self.check_automake, DEPENDENCY_RUN_AND_COMPILE_TIME, '-', None, GENERALDEP),
+ 'libjpeg': (True, ['base', 'prnt'], JPEG_STR, self.check_libjpeg, DEPENDENCY_RUN_AND_COMPILE_TIME, '-', None, GENERALDEP),
+ 'libtool': (True, ['base', 'prnt'], LIBTOOL_STR, self.check_libtool, DEPENDENCY_COMPILE_TIME, '-', 'libtool --version', COMPILEDEP),
+- 'cups': (True, ['base', 'prnt'], CUPS_STR, self.check_cups, DEPENDENCY_RUN_TIME, '1.1', 'cups-config --version', EXTERNALDEP),
+- 'cups-devel': (True, ['base', 'prnt'], CUPS_DEV_STR, self.check_cups_devel, DEPENDENCY_COMPILE_TIME, '-', 'cups-config --version', GENERALDEP),
+- 'cups-image': (True, ['base', 'prnt'], CUPS_IMG_STR, self.check_cups_image, DEPENDENCY_COMPILE_TIME, '-', 'cups-config --version', GENERALDEP),
++ 'cups': (True, ['base', 'prnt'], CUPS_STR, self.check_cups, DEPENDENCY_RUN_TIME, '1.1', 'lpstat -r', EXTERNALDEP),
++ 'cups-devel': (True, ['base', 'prnt'], CUPS_DEV_STR, self.check_cups_devel, DEPENDENCY_COMPILE_TIME, '-', 'lpstat -r', GENERALDEP),
++ 'cups-image': (True, ['base', 'prnt'], CUPS_IMG_STR, self.check_cups_image, DEPENDENCY_COMPILE_TIME, '-', 'lpstat -r', GENERALDEP),
+ 'gcc': (True, ['base', 'prnt'], GCC_STR, self.check_gcc, DEPENDENCY_COMPILE_TIME, '-', 'gcc --version', COMPILEDEP),
+ 'make': (True, ['base', 'prnt'], MAKE_STR, self.check_make, DEPENDENCY_COMPILE_TIME, '3.0', 'make --version', COMPILEDEP),
+ 'libpthread': (True, ['base', 'prnt'], THREAD_STR, self.check_libpthread, DEPENDENCY_RUN_AND_COMPILE_TIME, '-', 'FUNC#get_libpthread_version', GENERALDEP),
diff --git a/debian/patches/0058-hp-firmware-NameError-name-INTERACTIVE_MODE4-is-not-.patch b/debian/patches/0058-hp-firmware-NameError-name-INTERACTIVE_MODE4-is-not-.patch
new file mode 100644
index 000000000..a6c5f13f3
--- /dev/null
+++ b/debian/patches/0058-hp-firmware-NameError-name-INTERACTIVE_MODE4-is-not-.patch
@@ -0,0 +1,22 @@
+From: Zdenek Dohnal <zdohnal@redhat.com>
+Date: Fri, 31 Jan 2020 13:17:05 +0100
+Subject: hp-firmware:NameError: name 'INTERACTIVE_MODE4' is not defined
+
+Origin: https://src.fedoraproject.org/rpms/hplip/blob/master/f/hplip-typo.patch
+---
+ firmware.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/firmware.py b/firmware.py
+index 33e044d..2dad8cf 100755
+--- a/firmware.py
++++ b/firmware.py
+@@ -99,7 +99,7 @@ try:
+ if mode == GUI_MODE and (ui_toolkit == 'qt4' or ui_toolkit == 'qt5'):
+ if not utils.canEnterGUIMode4():
+ log.error("%s -u/--gui requires Qt4/Qt5 GUI support. Entering interactive mode." % __mod__)
+- mode = INTERACTIVE_MODE4
++ mode = INTERACTIVE_MODE
+
+ elif mode == GUI_MODE and ui_toolkit == 'qt3':
+ if not utils.canEnterGUIMode():
diff --git a/debian/patches/0059-hp-setup-fails-on-fax-setup-use-binary-strings.patch b/debian/patches/0059-hp-setup-fails-on-fax-setup-use-binary-strings.patch
new file mode 100644
index 000000000..00f4a40fa
--- /dev/null
+++ b/debian/patches/0059-hp-setup-fails-on-fax-setup-use-binary-strings.patch
@@ -0,0 +1,52 @@
+From: Zdenek Dohnal <zdohnal@redhat.com>
+Date: Fri, 31 Jan 2020 13:24:11 +0100
+Subject: hp-setup fails on fax setup - use binary strings
+
+Origin: https://src.fedoraproject.org/rpms/hplip/blob/master/f/hplip-use-binary-str.patch
+---
+ base/utils.py | 5 +----
+ fax/pmlfax.py | 8 ++++----
+ 2 files changed, 5 insertions(+), 8 deletions(-)
+
+diff --git a/base/utils.py b/base/utils.py
+index eff780f..3e38e85 100644
+--- a/base/utils.py
++++ b/base/utils.py
+@@ -957,10 +957,7 @@ else:
+
+
+ def printable(s):
+- if s:
+- return s.translate(identity, unprintable)
+- else:
+- return ""
++ return s.translate(identity, unprintable)
+
+
+ def any(S,f=lambda x:x):
+diff --git a/fax/pmlfax.py b/fax/pmlfax.py
+index adcc1cb..b68ff6a 100644
+--- a/fax/pmlfax.py
++++ b/fax/pmlfax.py
+@@ -143,8 +143,8 @@ class PMLFaxDevice(FaxDevice):
+
+ def getPhoneNum(self):
+ if PY3:
+- data = utils.printable(self.getPML(pml.OID_FAX_LOCAL_PHONE_NUM)[1])
+- return data
++ data = utils.printable(self.getPML(pml.OID_FAX_LOCAL_PHONE_NUM)[1].encode('utf-8'))
++ return data.decode('utf-8')
+ else:
+ return utils.printable(self.getPML(pml.OID_FAX_LOCAL_PHONE_NUM)[1])
+ phone_num = property(getPhoneNum, setPhoneNum, doc="OID_FAX_LOCAL_PHONE_NUM")
+@@ -155,8 +155,8 @@ class PMLFaxDevice(FaxDevice):
+
+ def getStationName(self):
+ if PY3:
+- data = utils.printable(self.getPML(pml.OID_FAX_STATION_NAME)[1])
+- return data
++ data = utils.printable(self.getPML(pml.OID_FAX_STATION_NAME)[1].encode('utf-8'))
++ return data.decode('utf-8')
+ else:
+ return utils.printable(self.getPML(pml.OID_FAX_STATION_NAME)[1])
+
diff --git a/debian/patches/0060-Fix-TypeError.patch b/debian/patches/0060-Fix-TypeError.patch
new file mode 100644
index 000000000..fcda3abff
--- /dev/null
+++ b/debian/patches/0060-Fix-TypeError.patch
@@ -0,0 +1,84 @@
+From: Tomas Korbar <tkorbar@redhat.com>
+Date: Fri, 31 Jan 2020 13:29:31 +0100
+Subject: Fix TypeError
+
+- 1564770 - TypeError: 'Error' object does not support indexing
+
+Origin: https://src.fedoraproject.org/rpms/hplip/blob/master/f/hplip-error-print.patch
+---
+ clean.py | 2 +-
+ ui/scrollunload.py | 2 +-
+ ui4/wifisetupdialog.py | 4 ++--
+ ui5/wifisetupdialog.py | 4 ++--
+ 4 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/clean.py b/clean.py
+index 3d41f04..3a7248e 100755
+--- a/clean.py
++++ b/clean.py
+@@ -182,7 +182,7 @@ try:
+ log.error("Cleaning not needed or supported on this device.")
+
+ except Error as e:
+- log.error("An error occured: %s" % e[0])
++ log.error("An error occured: %s" % e.msg)
+
+ else:
+ log.error("Device is busy or in an error state. Please check device and try again.")
+diff --git a/ui/scrollunload.py b/ui/scrollunload.py
+index fdb48e8..345ed82 100644
+--- a/ui/scrollunload.py
++++ b/ui/scrollunload.py
+@@ -120,7 +120,7 @@ class ScrollUnloadView(ScrollView):
+ self.pc = photocard.PhotoCard(None, self.cur_device.device_uri, self.cur_printer)
+ except Error as e:
+ QApplication.restoreOverrideCursor()
+- self.form.FailureUI(self.__tr("An error occured: %s" % e[0]))
++ self.form.FailureUI(self.__tr("An error occured: %s" % e.msg))
+ self.cleanup(EVENT_PCARD_UNABLE_TO_MOUNT)
+ return False
+
+diff --git a/ui4/wifisetupdialog.py b/ui4/wifisetupdialog.py
+index 9fd1786..4d36f83 100644
+--- a/ui4/wifisetupdialog.py
++++ b/ui4/wifisetupdialog.py
+@@ -256,7 +256,7 @@ class WifiSetupDialog(QDialog, Ui_Dialog):
+ try:
+ self.dev = device.Device(self.device_uri)
+ except Error as e:
+- FailureUI(self, self.__tr("<b>Error opening device:</b><p>%s</p><p>(%s)</p>") %(self.device_uri, QString(e[0])))
++ FailureUI(self, self.__tr("<b>Error opening device:</b><p>%s</p><p>(%s)</p>") %(self.device_uri, QString(e.msg)))
+
+ if self.dev is not None:
+ self.dev.close()
+@@ -834,7 +834,7 @@ class WifiSetupDialog(QDialog, Ui_Dialog):
+
+
+ def showIOError(self, e):
+- FailureUI(self, self.__tr("<b>An I/O error occurred.</b><p>Please check the USB connection to your printer and try again.</p>(%s)" % QString(e[0])))
++ FailureUI(self, self.__tr("<b>An I/O error occurred.</b><p>Please check the USB connection to your printer and try again.</p>(%s)" % QString(e.msg)))
+
+ if self.dev is not None:
+ self.dev.close()
+diff --git a/ui5/wifisetupdialog.py b/ui5/wifisetupdialog.py
+index 32b420c..6e34d91 100644
+--- a/ui5/wifisetupdialog.py
++++ b/ui5/wifisetupdialog.py
+@@ -259,7 +259,7 @@ class WifiSetupDialog(QDialog, Ui_Dialog):
+ try:
+ self.dev = device.Device(self.device_uri)
+ except Error as e:
+- FailureUI(self, self.__tr("<b>Error opening device:</b><p>%s</p><p>(%s)</p>") %(self.device_uri, str(e[0])))
++ FailureUI(self, self.__tr("<b>Error opening device:</b><p>%s</p><p>(%s)</p>") %(self.device_uri, str(e.msg)))
+
+ if self.dev is not None:
+ self.dev.close()
+@@ -840,7 +840,7 @@ class WifiSetupDialog(QDialog, Ui_Dialog):
+
+
+ def showIOError(self, e):
+- FailureUI(self, self.__tr("<b>An I/O error occurred.</b><p>Please check the USB connection to your printer and try again.</p>(%s)" % str(e[0])))
++ FailureUI(self, self.__tr("<b>An I/O error occurred.</b><p>Please check the USB connection to your printer and try again.</p>(%s)" % str(e.msg)))
+
+ if self.dev is not None:
+ self.dev.close()
diff --git a/debian/patches/0061-Fix-TypeError-in-hpfax.patch b/debian/patches/0061-Fix-TypeError-in-hpfax.patch
new file mode 100644
index 000000000..f4ec8f969
--- /dev/null
+++ b/debian/patches/0061-Fix-TypeError-in-hpfax.patch
@@ -0,0 +1,22 @@
+From: Tomas Korbar <tkorbar@redhat.com>
+Date: Fri, 31 Jan 2020 13:30:52 +0100
+Subject: Fix TypeError in hpfax
+
+Origin: https://src.fedoraproject.org/rpms/hplip/blob/master/f/hplip-hpfax-importerror-print.patch
+---
+ fax/backend/hpfax.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/fax/backend/hpfax.py b/fax/backend/hpfax.py
+index 7aaef35..f059b4b 100755
+--- a/fax/backend/hpfax.py
++++ b/fax/backend/hpfax.py
+@@ -89,7 +89,7 @@ try:
+ from base import utils
+ from prnt import cups
+ except ImportError as e:
+- bug("Error importing HPLIP modules: %s\n" % (pid, e))
++ bug("Error importing HPLIP modules: %s\n" % (e))
+ sys.exit(1)
+
+ def handle_sigpipe():
diff --git a/debian/patches/0062-Fix-AttributeError-when-connecting-to-printer-via-wi.patch b/debian/patches/0062-Fix-AttributeError-when-connecting-to-printer-via-wi.patch
new file mode 100644
index 000000000..e586757c4
--- /dev/null
+++ b/debian/patches/0062-Fix-AttributeError-when-connecting-to-printer-via-wi.patch
@@ -0,0 +1,22 @@
+From: Tomas Korbar <tkorbar@redhat.com>
+Date: Fri, 31 Jan 2020 13:33:22 +0100
+Subject: Fix AttributeError when connecting to printer via wifi
+
+Origin: https://src.fedoraproject.org/rpms/hplip/blob/master/f/hplip-wifisetup.patch
+---
+ ui5/wifisetupdialog.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/ui5/wifisetupdialog.py b/ui5/wifisetupdialog.py
+index 6e34d91..8daff7d 100644
+--- a/ui5/wifisetupdialog.py
++++ b/ui5/wifisetupdialog.py
+@@ -570,7 +570,7 @@ class WifiSetupDialog(QDialog, Ui_Dialog):
+ try:
+ self.ip,_,addressmode, subnetmask, gateway, pridns, sec_dns= self.wifiObj.getIPConfiguration(self.dev, self.adapterName)
+ if self.ip == "0.0.0.0":
+- 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/debian/patches/0063-Fixed-hp-setup-crash-when-user-wants-to-define-path-.patch b/debian/patches/0063-Fixed-hp-setup-crash-when-user-wants-to-define-path-.patch
new file mode 100644
index 000000000..87cd17855
--- /dev/null
+++ b/debian/patches/0063-Fixed-hp-setup-crash-when-user-wants-to-define-path-.patch
@@ -0,0 +1,23 @@
+From: Zdenek Dohnal <zdohnal@redhat.com>
+Date: Fri, 31 Jan 2020 13:35:56 +0100
+Subject: Fixed hp-setup crash when user wants to define path to PPD file
+
+Origin: https://src.fedoraproject.org/rpms/hplip/blob/master/f/hplip-add-ppd-crash.patch
+---
+ setup.py | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/setup.py b/setup.py
+index 2608f95..923ef95 100755
+--- a/setup.py
++++ b/setup.py
+@@ -556,6 +556,9 @@ else: # INTERACTIVE_MODE
+ else:
+ nickname = open(file_path, 'r').read(4096)
+
++ if sys.version_info[0] > 2:
++ nickname = nickname.decode('utf-8')
++
+ try:
+ desc = nickname_pat.search(nickname).group(1)
+ except AttributeError:
diff --git a/debian/patches/0064-Ignore-symlinks-when-installing-plugins.patch b/debian/patches/0064-Ignore-symlinks-when-installing-plugins.patch
new file mode 100644
index 000000000..64958ccd8
--- /dev/null
+++ b/debian/patches/0064-Ignore-symlinks-when-installing-plugins.patch
@@ -0,0 +1,31 @@
+From: Zdenek Dohnal <zdohnal@redhat.com>
+Date: Fri, 31 Jan 2020 13:37:46 +0100
+Subject: Ignore symlinks when installing plugins
+
+External scripts, which are downloaded and run by hp-plugin, try to create links
+in non-existing dirs. These scripts ignore errors, so plugin is installed fine
+but then internal hp-plugin can check for plugin state, where links are checked too.
+It results in corrupted plugin state, which breaks printer installation by GUI hp-setup.
+Temporary workaround is to ignore these bad links and real fix should come from HP,
+because their external scripts try to create links in non-existing dirs.
+Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1671513
+Reported upstream: https://bugs.launchpad.net/hplip/+bug/1814574
+
+Origin: https://src.fedoraproject.org/rpms/hplip/blob/master/f/hplip-missing-links.patch
+---
+ installer/pluginhandler.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/installer/pluginhandler.py b/installer/pluginhandler.py
+index 4d7c1b8..1af8d85 100755
+--- a/installer/pluginhandler.py
++++ b/installer/pluginhandler.py
+@@ -164,7 +164,7 @@ class PluginHandle(object):
+ for src, trg, link in copies:
+ if link != "":
+ if not utils.check_library(link):
+- self.__plugin_state = PLUGIN_FILES_CORRUPTED
++ pass
+
+
+ def __getPluginInformation(self, callback=None):
diff --git a/debian/patches/0065-Scanning-broken-for-HP-LaserJet-3052.patch b/debian/patches/0065-Scanning-broken-for-HP-LaserJet-3052.patch
new file mode 100644
index 000000000..2b5bdb711
--- /dev/null
+++ b/debian/patches/0065-Scanning-broken-for-HP-LaserJet-3052.patch
@@ -0,0 +1,30 @@
+From: Zdenek Dohnal <zdohnal@redhat.com>
+Date: Fri, 31 Jan 2020 13:40:10 +0100
+Subject: Scanning broken for HP LaserJet 3052
+
+Origin: https://src.fedoraproject.org/rpms/hplip/blob/master/f/hplip-hplj-3052.patch
+---
+ scan/scanext/scanext.c | 10 ----------
+ 1 file changed, 10 deletions(-)
+
+diff --git a/scan/scanext/scanext.c b/scan/scanext/scanext.c
+index 3ddfb35..1e6b514 100755
+--- a/scan/scanext/scanext.c
++++ b/scan/scanext/scanext.c
+@@ -408,16 +408,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/debian/patches/0066-Cannot-scan-with-M281fdw-LaserJet-failed-Error-durin.patch b/debian/patches/0066-Cannot-scan-with-M281fdw-LaserJet-failed-Error-durin.patch
new file mode 100644
index 000000000..def9345ca
--- /dev/null
+++ b/debian/patches/0066-Cannot-scan-with-M281fdw-LaserJet-failed-Error-durin.patch
@@ -0,0 +1,24 @@
+From: Zdenek Dohnal <zdohnal@redhat.com>
+Date: Fri, 31 Jan 2020 13:41:53 +0100
+Subject: Cannot scan with M281fdw LaserJet - failed: Error during device I/O
+
+Origin: https://src.fedoraproject.org/rpms/hplip/blob/master/f/hplip-m278-m281-needs-plugin.patch
+---
+ data/models/models.dat | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/data/models/models.dat b/data/models/models.dat
+index 759569c..0d9509e 100644
+--- a/data/models/models.dat
++++ b/data/models/models.dat
+@@ -62001,8 +62001,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/debian/patches/0067-Fixed-hpcups-crash-when-required-plugin-missing.patch b/debian/patches/0067-Fixed-hpcups-crash-when-required-plugin-missing.patch
new file mode 100644
index 000000000..dc6c7c345
--- /dev/null
+++ b/debian/patches/0067-Fixed-hpcups-crash-when-required-plugin-missing.patch
@@ -0,0 +1,22 @@
+From: Tim Waugh <twaugh@redhat.com>
+Date: Fri, 31 Jan 2020 13:43:11 +0100
+Subject: Fixed hpcups crash when required plugin missing
+
+Origin: https://src.fedoraproject.org/rpms/hplip/blob/master/f/hplip-hpcups-crash.patch
+---
+ prnt/hpcups/Compressor.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+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/debian/patches/0068-Fixing-issues-found-by-coverity-scan.patch b/debian/patches/0068-Fixing-issues-found-by-coverity-scan.patch
new file mode 100644
index 000000000..2cbb87a56
--- /dev/null
+++ b/debian/patches/0068-Fixing-issues-found-by-coverity-scan.patch
@@ -0,0 +1,734 @@
+From: Zdenek Dohnal <zdohnal@redhat.com>
+Date: Fri, 31 Jan 2020 13:45:35 +0100
+Subject: Fixing issues found by coverity scan
+
+Origin: https://src.fedoraproject.org/rpms/hplip/blob/master/f/hplip-covscan.patch
+---
+ Makefile.am | 6 +++---
+ common/utils.c | 6 +++++-
+ io/hpmud/hpmud.c | 1 +
+ io/hpmud/jd.c | 1 +
+ io/hpmud/model.c | 2 ++
+ io/hpmud/musb.c | 2 +-
+ io/hpmud/pp.c | 2 +-
+ pcard/fat.c | 10 +++++++---
+ prnt/hpcups/genPCLm.cpp | 20 ++++++++++++++------
+ prnt/hpijs/context2.cpp | 1 +
+ prnt/hpijs/systemservices.cpp | 3 +++
+ prnt/hpps/hppsfilter.c | 6 +++---
+ protocol/discovery/mdns.c | 4 ++++
+ protocol/hp_ipp.h | 5 +++++
+ scan/sane/bb_ledm.c | 1 +
+ scan/sane/common.h | 2 +-
+ scan/sane/escl.c | 4 ++--
+ scan/sane/hpaio.c | 1 +
+ scan/sane/http.c | 1 +
+ scan/sane/io.c | 6 +++---
+ scan/sane/ledm.c | 4 ++--
+ scan/sane/marvell.c | 22 +++++++++++-----------
+ scan/sane/sclpml.c | 3 ++-
+ scan/sane/soap.c | 20 ++++++++++----------
+ scan/sane/soapht.c | 20 ++++++++++----------
+ 25 files changed, 95 insertions(+), 58 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index a704cdd..321c4b2 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -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)\"
+
+@@ -307,7 +307,7 @@ dist_pcard_DATA = pcard/__init__.py pcard/photocard.py
+ pcardextdir = $(pyexecdir)
+ pcardext_LTLIBRARIES = pcardext.la
+ pcardext_la_LDFLAGS = -module -avoid-version -lpython$(PYTHON_VERSION)m
+-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
+@@ -319,7 +319,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 = -lcups libhpmud.la
+
+diff --git a/common/utils.c b/common/utils.c
+index e7c5085..28abbd8 100644
+--- a/common/utils.c
++++ b/common/utils.c
+@@ -1,5 +1,9 @@
++#ifndef _GNU_SOURCE
++#define _GNU_SOURCE
++#endif
++
+ #include "utils.h"
+-#include "string.h"
++#include <string.h>
+ #include <dlfcn.h>
+ #include <sys/stat.h>
+ #include <errno.h>
+diff --git a/io/hpmud/hpmud.c b/io/hpmud/hpmud.c
+index 0eb6fff..358f279 100644
+--- a/io/hpmud/hpmud.c
++++ b/io/hpmud/hpmud.c
+@@ -759,6 +759,7 @@ enum HPMUD_RESULT hpmud_get_dstat(HPMUD_DEVICE dd, struct hpmud_dstat *ds)
+ }
+
+ 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 --git a/io/hpmud/jd.c b/io/hpmud/jd.c
+index 9079d71..1980fab 100644
+--- a/io/hpmud/jd.c
++++ b/io/hpmud/jd.c
+@@ -31,6 +31,7 @@
+ #endif
+
+ #include <signal.h>
++#include <stdlib.h>
+ #include "hpmud.h"
+ #include "hpmudi.h"
+
+diff --git a/io/hpmud/model.c b/io/hpmud/model.c
+index 4ea8990..a917d69 100644
+--- a/io/hpmud/model.c
++++ b/io/hpmud/model.c
+@@ -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 --git a/io/hpmud/musb.c b/io/hpmud/musb.c
+index fe5d50f..db6f3f5 100644
+--- a/io/hpmud/musb.c
++++ b/io/hpmud/musb.c
+@@ -776,7 +776,7 @@ static int device_id(int fd, unsigned char *buffer, int size)
+ 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 --git a/io/hpmud/pp.c b/io/hpmud/pp.c
+index 74c5fdc..021d627 100644
+--- a/io/hpmud/pp.c
++++ b/io/hpmud/pp.c
+@@ -632,7 +632,7 @@ static int device_id(int fd, char *buffer, int size)
+ 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 --git a/pcard/fat.c b/pcard/fat.c
+index caa383f..e1425c0 100644
+--- a/pcard/fat.c
++++ b/pcard/fat.c
+@@ -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 --git a/prnt/hpcups/genPCLm.cpp b/prnt/hpcups/genPCLm.cpp
+index b923e42..293a12a 100644
+--- a/prnt/hpcups/genPCLm.cpp
++++ b/prnt/hpcups/genPCLm.cpp
+@@ -1237,11 +1237,16 @@ void PCLmGenerator::writeJobTicket()
+ char orientation[256];
+ char duplex[256];
+ char colorthemes[256];
+- strncpy(colorthemes,getColorThemesString(m_pPCLmSSettings->colorTheme),256);
+- strncpy(inputBin,getInputBinString(m_pPCLmSSettings->userInputBin),256);
+- strncpy(outputBin,getOutputBin(m_pPCLmSSettings->userOutputBin),256);
+- strncpy(orientation,getOrientationString(m_pPCLmSSettings->userOrientation),256);
+- strncpy(duplex,getDuplexString(currDuplexDisposition),256);
++ strncpy(colorthemes,getColorThemesString(m_pPCLmSSettings->colorTheme), sizeof(colorthemes));
++ colorthemes[sizeof(colorthemes)-1] = '\0';
++ strncpy(inputBin,getInputBinString(m_pPCLmSSettings->userInputBin), sizeof(inputBin));
++ inputBin[sizeof(inputBin)-1] = '\0';
++ strncpy(outputBin,getOutputBin(m_pPCLmSSettings->userOutputBin), sizeof(outputBin));
++ outputBin[sizeof(outputBin)-1] = '\0';
++ strncpy(orientation,getOrientationString(m_pPCLmSSettings->userOrientation), sizeof(orientation));
++ orientation[sizeof(orientation)-1] = '\0';
++ strncpy(duplex,getDuplexString(currDuplexDisposition), sizeof(duplex));
++ duplex[sizeof(duplex)-1] = '\0';
+
+ snprintf(pOutStr,OUT_STR_SIZE,"%% genPCLm (Ver: %f)\n",PCLM_Ver); writeStr2OutBuff(pOutStr);
+ snprintf(pOutStr,OUT_STR_SIZE,"%%============= Job Ticket =============\n"); writeStr2OutBuff(pOutStr);
+@@ -1635,7 +1640,10 @@ int PCLmGenerator::StartPage(PCLmPageSetup *PCLmPageContent, void **pOutBuffer,
+ }
+
+ if(strlen(PCLmPageContent->mediaSizeName))
+- strncpy(currMediaName,PCLmPageContent->mediaSizeName,256);
++ {
++ strncpy(currMediaName,PCLmPageContent->mediaSizeName, sizeof(currMediaName));
++ currMediaName[sizeof(currMediaName)-1] = '\0';
++ }
+
+ currStripHeight=PCLmPageContent->stripHeight;
+ if(!currStripHeight)
+diff --git a/prnt/hpijs/context2.cpp b/prnt/hpijs/context2.cpp
+index c3df482..19490b1 100644
+--- a/prnt/hpijs/context2.cpp
++++ b/prnt/hpijs/context2.cpp
+@@ -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 --git a/prnt/hpijs/systemservices.cpp b/prnt/hpijs/systemservices.cpp
+index 95f5a64..f5b4bb5 100644
+--- a/prnt/hpijs/systemservices.cpp
++++ b/prnt/hpijs/systemservices.cpp
+@@ -396,7 +396,10 @@ void SystemServices::AdjustIO(IO_MODE IM, const char* model)
+ IOMode.bDevID =IM.bDevID && IOMode.bDevID;
+
+ if (model)
++ {
+ strncpy(strModel,model, sizeof(strModel));
++ strModel[sizeof(strModel)-1] = '\0';
++ }
+ }
+
+ APDK_END_NAMESPACE
+diff --git a/prnt/hpps/hppsfilter.c b/prnt/hpps/hppsfilter.c
+index d3bd8d4..25e2b4d 100644
+--- a/prnt/hpps/hppsfilter.c
++++ b/prnt/hpps/hppsfilter.c
+@@ -273,13 +273,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 --git a/protocol/discovery/mdns.c b/protocol/discovery/mdns.c
+index abca295..8dd6fa5 100644
+--- a/protocol/discovery/mdns.c
++++ b/protocol/discovery/mdns.c
+@@ -31,6 +31,10 @@
+ #include <netinet/in.h>
+ #include <netdb.h>
+ #include <arpa/inet.h>
++#include <unistd.h>
++#include <ctype.h>
++#include <stdio.h>
++#include <stdlib.h>
+ #include "mdns.h"
+
+ /* Convert "www.google.com" to "3www6google3com". */
+diff --git a/protocol/hp_ipp.h b/protocol/hp_ipp.h
+index 3853f84..de76202 100644
+--- a/protocol/hp_ipp.h
++++ b/protocol/hp_ipp.h
+@@ -166,5 +166,10 @@ int getCupsPrinters(printer_t **printer_list);
+ HPIPP_RESULT parseResponseHeader(char* header, int *content_length, int *chunked, int* header_size);
+ HPIPP_RESULT prepend_http_header(raw_ipp *raw_request);
+ enum HPMUD_RESULT sendUSBRequest(char *buf, int size, 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);
+
+ # endif //_IPP_H
+diff --git a/scan/sane/bb_ledm.c b/scan/sane/bb_ledm.c
+index 27d73a0..2657fd1 100644
+--- a/scan/sane/bb_ledm.c
++++ b/scan/sane/bb_ledm.c
+@@ -26,6 +26,7 @@
+ # include "http.h"
+ # include "xml.h"
+ # include <stdlib.h>
++# include <unistd.h>
+
+ # include <stdint.h>
+
+diff --git a/scan/sane/common.h b/scan/sane/common.h
+index cdddd94..062d3a4 100644
+--- a/scan/sane/common.h
++++ b/scan/sane/common.h
+@@ -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 --git a/scan/sane/escl.c b/scan/sane/escl.c
+index 98a9caa..1e56197 100644
+--- a/scan/sane/escl.c
++++ b/scan/sane/escl.c
+@@ -838,7 +838,7 @@ SANE_Status escl_control_option(SANE_Handle handle, SANE_Int option, SANE_Action
+ //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;
+@@ -1148,7 +1148,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 --git a/scan/sane/hpaio.c b/scan/sane/hpaio.c
+index 730a966..dd50111 100644
+--- a/scan/sane/hpaio.c
++++ b/scan/sane/hpaio.c
+@@ -40,6 +40,7 @@
+ #include "soap.h"
+ #include "soapht.h"
+ #include "marvell.h"
++#include "mdns.h"
+ #include "hpaio.h"
+ #include "ledm.h"
+ #include "sclpml.h"
+diff --git a/scan/sane/http.c b/scan/sane/http.c
+index 800df91..45668cd 100644
+--- a/scan/sane/http.c
++++ b/scan/sane/http.c
+@@ -36,6 +36,7 @@
+ #include <string.h>
+ #include <syslog.h>
+ #include <ctype.h>
++#include <unistd.h>
+ #include "hpmud.h"
+ #include "http.h"
+
+diff --git a/scan/sane/io.c b/scan/sane/io.c
+index 4508458..dbbb296 100755
+--- a/scan/sane/io.c
++++ b/scan/sane/io.c
+@@ -50,7 +50,7 @@ int __attribute__ ((visibility ("hidden"))) InitDbus(void)
+
+ 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"))) SendScanEvent(char *device_uri, int
+
+ 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"))) SendScanEvent(char *device_uri, int
+
+ if (!dbus_connection_send(dbus_conn, msg, NULL))
+ {
+- BUG("dbus message send failed!\n");
++ BUG_SCAN("dbus message send failed!\n");
+ return 0;
+ }
+
+diff --git a/scan/sane/ledm.c b/scan/sane/ledm.c
+index 8f04338..9c2799e 100644
+--- a/scan/sane/ledm.c
++++ b/scan/sane/ledm.c
+@@ -802,7 +802,7 @@ SANE_Status ledm_control_option(SANE_Handle handle, SANE_Int option, SANE_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;
+@@ -1069,7 +1069,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 --git a/scan/sane/marvell.c b/scan/sane/marvell.c
+index 6cac67a..fce2458 100644
+--- a/scan/sane/marvell.c
++++ b/scan/sane/marvell.c
+@@ -134,7 +134,7 @@ static int get_ip_data(struct marvell_session *ps, SANE_Byte *data, SANE_Int max
+
+ 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_session()
+
+ 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_Const device, SANE_Handle *handle)
+
+ 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_Const device, SANE_Handle *handle)
+
+ 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_Const device, SANE_Handle *handle)
+
+ 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_Handle handle, SANE_Int option, SANE_Act
+ 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_Handle handle, SANE_Int option, SANE_Act
+
+ 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 handle)
+
+ 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 handle)
+ /* 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 handle, SANE_Byte *data, SANE_Int maxLength
+
+ 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/scan/sane/sclpml.c b/scan/sane/sclpml.c
+index 61500da..dfeedb9 100644
+--- a/scan/sane/sclpml.c
++++ b/scan/sane/sclpml.c
+@@ -30,6 +30,7 @@
+ #include <unistd.h>
+ #include <fcntl.h>
+ #include <string.h>
++#include <sys/time.h>
+ #include "sane.h"
+ #include "saneopts.h"
+ #include "common.h"
+@@ -2087,7 +2088,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 --git a/scan/sane/soap.c b/scan/sane/soap.c
+index a45f1a0..e59fb46 100644
+--- a/scan/sane/soap.c
++++ b/scan/sane/soap.c
+@@ -142,7 +142,7 @@ static int get_ip_data(struct soap_session *ps, SANE_Byte *data, SANE_Int maxLen
+
+ 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_session()
+
+ 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 device, SANE_Handle *handle)
+
+ 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 device, SANE_Handle *handle)
+
+ 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_Handle handle, SANE_Int option, SANE_Action
+
+ 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 handle)
+ 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 handle)
+ /* 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 handle)
+
+ 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, SANE_Byte *data, SANE_Int maxLength, S
+
+ 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/scan/sane/soapht.c b/scan/sane/soapht.c
+index df0e807..c8de979 100644
+--- a/scan/sane/soapht.c
++++ b/scan/sane/soapht.c
+@@ -136,7 +136,7 @@ static int get_ip_data(struct soap_session *ps, SANE_Byte *data, SANE_Int maxLen
+
+ 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_session()
+
+ 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_Const device, SANE_Handle *handle)
+
+ 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_Const device, SANE_Handle *handle)
+
+ 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_Handle handle, SANE_Int option, SANE_Acti
+
+ 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 handle)
+
+ 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 handle)
+ /* 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 handle)
+
+ 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 handle, SANE_Byte *data, SANE_Int maxLength,
+
+ 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/debian/patches/0069-abrt-hplip-strlen-hp-killed-by-SIGSEGV.patch b/debian/patches/0069-abrt-hplip-strlen-hp-killed-by-SIGSEGV.patch
new file mode 100644
index 000000000..cf26d3fcc
--- /dev/null
+++ b/debian/patches/0069-abrt-hplip-strlen-hp-killed-by-SIGSEGV.patch
@@ -0,0 +1,26 @@
+From: Zdenek Dohnal <zdohnal@redhat.com>
+Date: Fri, 31 Jan 2020 13:46:58 +0100
+Subject: [abrt] hplip: strlen(): hp killed by SIGSEGV
+
+Segfault during logging to syslog because argument are switched
+bugzilla https://bugzilla.redhat.com/show_bug.cgi?id=1727162
+upstream https://bugs.launchpad.net/hplip/+bug/1837846
+
+Origin: https://src.fedoraproject.org/rpms/hplip/blob/master/f/hplip-logging-segfault.patch
+---
+ io/hpmud/musb.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/io/hpmud/musb.c b/io/hpmud/musb.c
+index db6f3f5..91962ff 100644
+--- a/io/hpmud/musb.c
++++ b/io/hpmud/musb.c
+@@ -1455,7 +1455,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/debian/patches/0070-abrt-hp-systray-BlockingIOError-Errno-11-Resource-te.patch b/debian/patches/0070-abrt-hp-systray-BlockingIOError-Errno-11-Resource-te.patch
new file mode 100644
index 000000000..e32220903
--- /dev/null
+++ b/debian/patches/0070-abrt-hp-systray-BlockingIOError-Errno-11-Resource-te.patch
@@ -0,0 +1,34 @@
+From: Zdenek Dohnal <zdohnal@redhat.com>
+Date: Fri, 31 Jan 2020 13:48:32 +0100
+Subject: [abrt] hp-systray:BlockingIOError: [Errno 11] Resource temporarily
+ unavailable
+
+Traceback in hp-systray when there are no resource
+wanted to report upstream, but launchpad ends with timeout error
+bugzilla https://bugzilla.redhat.com/show_bug.cgi?id=1738321
+
+Origin: https://src.fedoraproject.org/rpms/hplip/blob/master/f/hplip-logging-segfault.patch
+---
+ systray.py | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/systray.py b/systray.py
+index a47cf16..a976f64 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/debian/patches/0071-Missing-drivers.patch b/debian/patches/0071-Missing-drivers.patch
new file mode 100644
index 000000000..606f04ed9
--- /dev/null
+++ b/debian/patches/0071-Missing-drivers.patch
@@ -0,0 +1,622 @@
+From: Zdenek Dohnal <zdohnal@redhat.com>
+Date: Fri, 31 Jan 2020 13:50:05 +0100
+Subject: Missing drivers
+
+several printers were removed in 3.19.1, but actually someone still uses them
+reported upstream https://bugs.launchpad.net/hplip/+bug/1843592
+bugzillas 1742949, 1740132, 1739855
+
+Origin: https://src.fedoraproject.org/rpms/hplip/blob/master/f/hplip-missing-drivers.patch
+---
+ Makefile.in | 4 +
+ cups_drv.inc | 2 +
+ data/models/models.dat | 477 ++++++++++++++++++++++++++++++++++++++++++++++++-
+ prnt/drv/hpcups.drv.in | 16 ++
+ 4 files changed, 490 insertions(+), 9 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 32286e8..87d6954 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -1557,6 +1557,7 @@ am__dist_ppd_DATA_DIST = prnt/ps/hp-designjet_z6810ps_42in-ps.ppd.gz \
+ 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_m1120_mfp.ppd.gz \
+@@ -1670,6 +1671,7 @@ am__dist_ppd_DATA_DIST = prnt/ps/hp-designjet_z6810ps_42in-ps.ppd.gz \
+ ppd/hpcups/hp-laserjet_professional_p1608dn.ppd.gz \
+ ppd/hpcups/hp-laserjet_professional_p1609dn.ppd.gz \
+ ppd/hpcups/hp-laserjet_professional_p_1102w.ppd.gz \
++ ppd/hpcups/hp-laserjet_professional_p1102w.ppd.gz \
+ ppd/hpcups/hp-mopier_240-pcl3.ppd.gz \
+ ppd/hpcups/hp-mopier_320-pcl3.ppd.gz \
+ ppd/hpcups/hp-neverstop_laser_100x.ppd.gz \
+@@ -3922,6 +3924,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_m1120_mfp.ppd.gz \
+@@ -4034,6 +4037,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-mopier_240-pcl3.ppd.gz \
+ @HPLIP_CLASS_DRIVER_FALSE@ ppd/hpcups/hp-mopier_320-pcl3.ppd.gz \
+diff --git a/cups_drv.inc b/cups_drv.inc
+index 61fc422..842386a 100644
+--- a/cups_drv.inc
++++ b/cups_drv.inc
+@@ -398,6 +398,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_m1120_mfp.ppd.gz \
+@@ -510,6 +511,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-mopier_240-pcl3.ppd.gz \
+ ppd/hpcups/hp-mopier_320-pcl3.ppd.gz \
+diff --git a/data/models/models.dat b/data/models/models.dat
+index 0d9509e..2c88904 100644
+--- a/data/models/models.dat
++++ b/data/models/models.dat
+@@ -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 --git a/prnt/drv/hpcups.drv.in b/prnt/drv/hpcups.drv.in
+index efa2a10..f948233 100644
+--- a/prnt/drv/hpcups.drv.in
++++ b/prnt/drv/hpcups.drv.in
+@@ -22243,6 +22243,14 @@ Group "RLT/HP Real Life Technologies"
+ Attribute "Product" "" "(HP LaserJet Professional p1102 Printer)"
+ 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, requires proprietary plugin"
+@@ -22677,6 +22685,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/debian/patches/0072-Revert-3.20.2-change-to-io-hpmud-jd.c.patch b/debian/patches/0072-Revert-3.20.2-change-to-io-hpmud-jd.c.patch
new file mode 100644
index 000000000..de993e6cb
--- /dev/null
+++ b/debian/patches/0072-Revert-3.20.2-change-to-io-hpmud-jd.c.patch
@@ -0,0 +1,21 @@
+From: Didier Raboud <odyx@debian.org>
+Date: Mon, 9 Mar 2020 14:14:41 +0100
+Subject: Revert 3.20.2 change to io/hpmud/jd.c
+
+Closes: #953104
+---
+ io/hpmud/jd.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/io/hpmud/jd.c b/io/hpmud/jd.c
+index 1980fab..20df27a 100644
+--- a/io/hpmud/jd.c
++++ b/io/hpmud/jd.c
+@@ -620,7 +620,6 @@ enum HPMUD_RESULT __attribute__ ((visibility ("hidden"))) jd_s_channel_write(mud
+ FD_SET(pc->socket, &master);
+ maxfd = pc->socket;
+ size = length;
+- size=strlen(buf);
+
+ while (size > 0)
+ {
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 000000000..1062a72c5
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,72 @@
+0001-Cope-with-prnt-hpcups-ErnieFilter.-cpp-h-removal-by-.patch
+0002-Blank-ink-only-patch-by-Richard-Spencer-Smith.patch
+0003-Fix-missing-charsign.patch
+0004-Corrections-models.dat-entry-for-the-HP-PhotoSmart-P.patch
+0005-Fixed-short-edge-duplex-for-non-PS-laser-printers.patch
+0006-Make-simple-scan-the-default-scanning-frontend.patch
+0007-Try-libhpmud.so.0-directly.patch
+0008-For-the-Lidil-printers-enable-two-cartridge-modes-bl.patch
+0009-Treat-logging-before-importing-of-logger-module.patch
+0010-Simplified-the-construction-of-the-title-line-of-the.patch
+0011-Make-the-menu-of-the-hp-systray-applet-appearing-whe.patch
+0012-Fix-duplex-descriptor-uninitialized.patch
+0013-Make-sure-that-the-HPLIP-components-which-access-the.patch
+0014-Workaround-patch-for-missing-Python3-transition-of-t.patch
+0015-Allow-non-JPEG-scanning-on-the-HP-DeskJet-3520-All-i.patch
+0016-Fix-download-and-installation-of-HP-s-proprietary-pl.patch
+0017-In-hp-scan-s-manpage-sort-PAGE_SIZES-in-help-for-the.patch
+0018-Install-check-plugin.py-as-a-script.patch
+0019-LaserJet-PostScript-4000-PPD-bugfix.patch
+0020-Patch-UI-files-to-match-upstream-produced-.py-code.patch
+0021-Add-include-cups-ppd.h-in-various-places-as-CUPS-2.2.patch
+0022-Fix-list-wrapping-in-scan.py-to-fix-generated-manpag.patch
+0023-Fix-handling-of-unicode-filenames-in-sixext.py.patch
+0024-Make-dat2drv-and-locateppd-build-dependent-of-class-.patch
+0025-Remove-all-ImageProcessor-functionality-which-is-clo.patch
+0026-Call-QMessageBox-constructors-of-PyQT5-with-the-corr.patch
+0027-Fixed-incomplete-removal-of-hp-toolbox-features-whic.patch
+0028-hp-check-Fix-core.distro-vs.-core.distro_name-mixups.patch
+0029-Make-base.g.xint-more-generous-in-what-it-can-take.patch
+0030-Fix-linking-of-libhpipp-and-the-ext-python-extension.patch
+0031-Fix-some-typos-in-BUG-and-DBG-messages.patch
+0032-Fix-version-pattern-check-to-support-ghostscript-RC-.patch
+0033-Fix-the-PIL.Image-version-check-to-work-with-Pillow-.patch
+0034-Don-t-gpg-import-but-rely-on-installed-signing_key.a.patch
+0035-Shortcut-distros.dat-finding-to-point-to-where-it-is.patch
+0036-Accelerate-HTTP-check-by-doing-a-HEAD-not-a-GET.patch
+0037-Enforce-Debian-assumptions.patch
+0038-Removed-all-page-size-choices-named-Custom-.-they-br.patch
+0039-PY3-Fix-dat2drv.py.patch
+0040-Replace-rubbish-pstotiff-filter.patch
+0041-Fix-strstr-const.patch
+0042-Added-several-IEEE-1284-Device-IDs.patch
+0043-Retry-when-connecting-to-device-fails.patch
+0044-Mark-SNMP-quirks-for-two-lying-devices.patch
+0045-Fix-bogus-low-ink-warning-from-hpijs-driver.patch
+0046-Clear-old-state-reasons.patch
+0047-Avoid-busy-loop-in-hpcups-when-backend-has-exited.patch
+0048-CUPS-filters-should-use-TMPDIR-when-available.patch
+0049-Fixed-Device-ID-parsing-code-in-hpijs-s-dj9xxvip.c.patch
+0050-IEEE1284-Device-ID-for-HP-LaserJet-4000.patch
+0051-Fix-ImageableArea-for-Laserjet-8150-9000.patch
+0052-Fix-parsing-of-avahi-daemon-output.patch
+0053-Fixed-left-right-margins-for-HP-DeskJet-990C.patch
+0054-Fixed-uses-of-strncpy-throughout.patch
+0055-Ignore-IOError-when-logging-output.patch
+0056-Exit-if-source-cannot-be-fetched-from-device.patch
+0057-hp-check-shows-CUPS-incompatible-or-not-running-even.patch
+0058-hp-firmware-NameError-name-INTERACTIVE_MODE4-is-not-.patch
+0059-hp-setup-fails-on-fax-setup-use-binary-strings.patch
+0060-Fix-TypeError.patch
+0061-Fix-TypeError-in-hpfax.patch
+0062-Fix-AttributeError-when-connecting-to-printer-via-wi.patch
+0063-Fixed-hp-setup-crash-when-user-wants-to-define-path-.patch
+0064-Ignore-symlinks-when-installing-plugins.patch
+0065-Scanning-broken-for-HP-LaserJet-3052.patch
+0066-Cannot-scan-with-M281fdw-LaserJet-failed-Error-durin.patch
+0067-Fixed-hpcups-crash-when-required-plugin-missing.patch
+0068-Fixing-issues-found-by-coverity-scan.patch
+0069-abrt-hplip-strlen-hp-killed-by-SIGSEGV.patch
+0070-abrt-hp-systray-BlockingIOError-Errno-11-Resource-te.patch
+0071-Missing-drivers.patch
+0072-Revert-3.20.2-change-to-io-hpmud-jd.c.patch