revert back

This commit is contained in:
akdengi 2013-11-26 16:59:00 +04:00
parent a0bb1ace00
commit 70a0445881
26 changed files with 1117 additions and 74 deletions

View file

@ -1,6 +1,7 @@
---
removed_sources:
hplip-3.13.10.tar.gz: 8c570ea4ed64a7e1a199f70de0f72178e07de026
hplip-3.13.8.tar.gz: c91fd5231e056f03dc7e715a84afcb13074364d1
sources:
SmartInstallDisable-Tool.run: c82103aa609cd7e58f43b090266bb77216933937
hp-sendfax.png: 2201320c59c2eaba10abce5c40306c6461e79beb
hplip-3.13.11.tar.gz: 240dcaf52c75a23cd5ab6a4426364245e7c2474e
SmartInstallDisable-Tool.run: c82103aa609cd7e58f43b090266bb77216933937

16
10_shebang_fixes.dpatch Normal file
View file

@ -0,0 +1,16 @@
#! /bin/sh /usr/share/dpatch/dpatch-run
## 10_hashbang_fixes.dpatch by Henrique de Moraes Holschuh <hmh@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Fix missing, weird or otherwise broken shebang lines
@DPATCH@
Index: hplip-3.12.4/__init__.py
===================================================================
--- hplip-3.12.4.orig/__init__.py 2012-04-10 18:35:13.000000000 +1000
+++ hplip-3.12.4/__init__.py 2012-05-26 10:21:29.000000000 +1000
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# (c) Copyright 2003-2007 Hewlett-Packard Development Company, L.P.

View file

@ -0,0 +1,24 @@
#! /bin/sh /usr/share/dpatch/dpatch-run
## 87_move_documentation.dpatch by <till.kamppeter@gmail.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: place html documentation under hplip-doc/HTML/
@DPATCH@
--- a/Makefile.am
+++ b/Makefile.am
@@ -29,11 +29,11 @@
if DOC_BUILD
wwwsrc = doc
-www0dir = $(docdir)
+www0dir = $(hpdocdir)/HTML
dist_www0_DATA = $(wwwsrc)/index.html $(wwwsrc)/commandline.html $(wwwsrc)/copying.html $(wwwsrc)/devicemanager.html $(wwwsrc)/faxtrouble.html $(wwwsrc)/gettinghelp.html $(wwwsrc)/hpscan.html $(wwwsrc)/mainttask.html $(wwwsrc)/plugins.html $(wwwsrc)/print.html $(wwwsrc)/printing.html $(wwwsrc)/printoptions.html $(wwwsrc)/printtroubleshooting.html $(wwwsrc)/scanning.html $(wwwsrc)/scantrouble.html $(wwwsrc)/sendfax.html $(wwwsrc)/setup.html $(wwwsrc)/systray.html $(wwwsrc)/troubleshooting.html $(wwwsrc)/uninstalling.html $(wwwsrc)/upgrading.html
-www3dir = $(docdir)/styles
+www3dir = $(www0dir)/styles
dist_www3_DATA = $(wwwsrc)/styles/*
-www4dir = $(docdir)/images
+www4dir = $(www0dir)/images
dist_www4_DATA = $(wwwsrc)/images/*
endif

View file

@ -0,0 +1,11 @@
--- ip/xmatrix.c.orig 2004-02-18 23:43:44.000000000 +0100
+++ ip/xmatrix.c 2005-05-17 13:48:17.000000000 +0200
@@ -380,7 +380,7 @@
while (pwOut < (WORD*)pOutAfter)
{
- int prod0, prod1, prod2;
+ int prod0 = 0, prod1 = 0, prod2 = 0;
/* The fixed-point calculations below are as follows:
* 17.15 = input pixel

View file

@ -0,0 +1,43 @@
#! /bin/sh /usr/share/dpatch/dpatch-run
## hp-mkuri-take-into-account-already-installed-plugin-also-for-exit-value.dpatch by <till.kamppeter@gmail.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.
@DPATCH@
Index: hplip-3.12.4/io/hpmud/hp-mkuri.c
===================================================================
--- hplip-3.12.4.orig/io/hpmud/hp-mkuri.c 2012-04-10 18:35:06.000000000 +1000
+++ hplip-3.12.4/io/hpmud/hp-mkuri.c 2012-05-26 10:23:52.000000000 +1000
@@ -385,17 +385,23 @@
}
ret = 0;
- if (plugin == HPMUD_PLUGIN_TYPE_REQUIRED)
- ret = 2;
- else if (plugin == HPMUD_PLUGIN_TYPE_OPTIONAL)
- ret = 3;
- if (fax > 0)
+ if (!plugin_installed)
{
- ret = 4;
if (plugin == HPMUD_PLUGIN_TYPE_REQUIRED)
- ret = 5;
+ ret = 2;
else if (plugin == HPMUD_PLUGIN_TYPE_OPTIONAL)
- ret = 6;
+ ret = 3;
+ }
+ if (fax > 0)
+ {
+ ret = 4;
+ if (!plugin_installed)
+ {
+ if (plugin == HPMUD_PLUGIN_TYPE_REQUIRED)
+ ret = 5;
+ else if (plugin == HPMUD_PLUGIN_TYPE_OPTIONAL)
+ ret = 6;
+ }
}
bugout:

View file

@ -0,0 +1,32 @@
#! /bin/sh /usr/share/dpatch/dpatch-run
## hp-setup-prompt-for-custom-PPD.dpatch by <till.kamppeter@gmail.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.
@DPATCH@
Index: hplip-3.12.4/setup.py
===================================================================
--- hplip-3.12.4.orig/setup.py 2012-04-10 18:35:14.000000000 +1000
+++ hplip-3.12.4/setup.py 2012-05-26 10:21:29.000000000 +1000
@@ -487,14 +487,13 @@
print_ppd, desc = print_ppd
log.info("\nFound PPD file: %s" % print_ppd)
- if desc:
- log.info("Description: %s" % desc)
+ log.info("Description: %s" % desc)
#
- if not auto:
- log.info("\nNote: The model number may vary slightly from the actual model number on the device.")
- ok, ans = tui.enter_yes_no("\nDoes this PPD file appear to be the correct one")
- if not ok: sys.exit(0)
- if not ans: enter_ppd = True
+ if not auto:
+ log.info("\nNote: The model number may vary slightly from the actual model number on the device.")
+ ok, ans = tui.enter_yes_no("\nDoes this PPD file appear to be the correct one")
+ if not ok: sys.exit(0)
+ if not ans: enter_ppd = True
if enter_ppd:

View file

@ -0,0 +1,10 @@
--- hplip-3.12.9/prnt/cupsext/cupsext.c.addprinter 2012-09-04 14:31:10.000000000 +0200
+++ hplip-3.12.9/prnt/cupsext/cupsext.c 2012-09-11 16:42:26.229950718 +0200
@@ -324,6 +324,7 @@ PyObject * getPrinters( PyObject * self,
};
/* Connect to the HTTP server */
+ cupsSetUser ("root");
if ( ( http = httpConnectEncrypt( cupsServer(), ippPort(), cupsEncryption() ) ) == NULL )
{
goto abort;

View file

@ -0,0 +1,12 @@
diff -Naur hplip-3.13.10.orig/hplip-systray.desktop.in hplip-3.13.10/hplip-systray.desktop.in
--- hplip-3.13.10.orig/hplip-systray.desktop.in 2013-11-13 16:27:03.130195952 +0400
+++ hplip-3.13.10/hplip-systray.desktop.in 2013-11-13 16:28:12.465200259 +0400
@@ -4,7 +4,7 @@
Name=HP System Tray Service
GenericName=Printer Status Applet
Comment=HP System Tray Service
-Exec=hp-systray -x
+Exec=hp-systray
Icon=@abs_datadir@/hplip/data/images/128x128/hp_logo.png
Terminal=false
Categories=Application;Utility;

View file

@ -1,12 +0,0 @@
--- hplip-3.13.10/data/rules/56-hpmud_sysfs.rules 2013-10-11 09:38:53.000000000 +0000
+++ hplip-3.13.10/data/rules/56-hpmud_sysfs.rules.tpg 2013-10-19 11:15:57.196603385 +0000
@@ -14,9 +14,6 @@
# For RHEL 5, centos 5..
ENV{hp_test}=="yes", PROGRAM="/bin/sh -c 'X=%k; X=$${X#usbdev}; B=$${X%%%%.*}; D=$${X#*.}; logger -p user.info loading HP Device $$B $$D; printf %%03i:%%03i $$B $$D'", RUN+="/bin/sh -c '/usr/bin/python hp-config_usb_printer %c '"
-# This rule will add the printer and install plugin
-ENV{hp_test}=="yes", PROGRAM="/bin/sh -c 'logger -p user.info loading HP Device $env{BUSNUM} $env{DEVNUM}'", RUN+="/bin/sh -c 'if [ -f /usr/bin/systemctl ]; then /usr/bin/systemctl --no-block start hplip-printer@$env{BUSNUM}:$env{DEVNUM}.service; else /usr/bin/nohup /usr/bin/python /usr/bin/hp-config_usb_printer $env{BUSNUM}:$env{DEVNUM} ; fi'"
-
# If sane-bankends is installed add hpaio backend support to dll.conf if needed.
ENV{sane_hpaio}=="yes", RUN+="/bin/sh -c 'grep -q ^#hpaio /etc/sane.d/dll.conf;if [ $$? -eq 0 ];then sed -i -e s/^#hpaio/hpaio/ /etc/sane.d/dll.conf;else grep -q ^hpaio /etc/sane.d/dll.conf;if [ $$? -ne 0 ];then echo hpaio >>/etc/sane.d/dll.conf;fi;fi'"

46
hplip-CVE-2013-4325.patch Normal file
View file

@ -0,0 +1,46 @@
diff --git a/hplip/0001-pkit-Pass-system-bus-name-as-subject-not-pid.patch b/hplip/0001-pkit-Pass-system-bus-name-as-subject-not-pid.patch
new file mode 100644
index 0000000..ab21134
--- /dev/null
+++ b/hplip/0001-pkit-Pass-system-bus-name-as-subject-not-pid.patch
@@ -0,0 +1,38 @@
+From 6d7ddfd19733f2a8197c1e7ad8fdfef2b7e17c1a Mon Sep 17 00:00:00 2001
+From: Colin Walters <walters@verbum.org>
+Date: Thu, 22 Aug 2013 17:37:31 -0400
+Subject: [PATCH] pkit: Pass system-bus-name as subject, not pid
+
+Previously, we were forcing polkit to scrape /proc/pid itself for the
+uid, which is subject to a race condition if the caller execve()s a
+setuid binary. Passing system-bus-name as a subject allows polkit to
+use the valid information from the system bus.
+---
+ base/pkit.py | 9 ++-------
+ 1 files changed, 2 insertions(+), 7 deletions(-)
+
+diff --git a/base/pkit.py b/base/pkit.py
+index 0acc124..08bebc8 100644
+--- a/base/pkit.py
++++ b/base/pkit.py
+@@ -176,15 +176,10 @@ class PolicyKitService(dbus.service.Object):
+ "/org/freedesktop/PolicyKit1/Authority",
+ "org.freedesktop.PolicyKit1.Authority")
+ policy_kit = dbus.Interface(obj, "org.freedesktop.PolicyKit1.Authority")
+- info = dbus.Interface(connection.get_object("org.freedesktop.DBus",
+- "/org/freedesktop/DBus/Bus",
+- False),
+- "org.freedesktop.DBus")
+- pid = info.GetConnectionUnixProcessID(sender)
+
+ subject = (
+- 'unix-process',
+- { 'pid' : dbus.UInt32(pid, variant_level = 1) }
++ 'system-bus-name',
++ { 'name' : dbus.String(sender, variant_level = 1) }
+ )
+ details = { '' : '' }
+ flags = dbus.UInt32(1) # AllowUserInteraction = 0x00000001
+--
+1.7.1
+

View file

@ -0,0 +1,12 @@
diff -up hplip-3.10.9/ui4/printsettingstoolbox.py.UnicodeDecodeError hplip-3.10.9/ui4/printsettingstoolbox.py
--- hplip-3.10.9/ui4/printsettingstoolbox.py.UnicodeDecodeError 2010-09-26 19:07:19.000000000 +0200
+++ hplip-3.10.9/ui4/printsettingstoolbox.py 2010-10-22 15:01:13.000000000 +0200
@@ -459,7 +459,7 @@ class PrintSettingsToolbox(QToolBox):
self.beginControlGroup(g, QString(text))
- log.debug(" Text: %s" % unicode(text))
+ log.debug(" Text: %s" % repr(text))
log.debug("Num subgroups: %d" % num_subgroups)
options = cups.getOptionList(g)

41
hplip-check.patch Normal file
View file

@ -0,0 +1,41 @@
diff -up hplip-3.12.10a/check.py.check hplip-3.12.10a/check.py
diff -up hplip-3.12.10a/installer/core_install.py.check hplip-3.12.10a/installer/core_install.py
--- hplip-3.12.10a/installer/core_install.py.check 2012-11-22 13:22:58.527444444 +0000
+++ hplip-3.12.10a/installer/core_install.py 2012-11-22 13:27:11.319338942 +0000
@@ -1153,18 +1153,24 @@ class CoreInstall(object):
def check_hpaio(self):
found = False
- log.debug("'Checking for hpaio' in '/etc/sane.d/dll.conf'...")
- try:
- f = file('/etc/sane.d/dll.conf', 'r')
- except IOError:
- log.error("'/etc/sane.d/dll.conf' not found. Is SANE installed?")
- else:
- for line in f:
- lineNoSpace = re.sub(r'\s', '', line)
- hpaiomatched=re.match('hpaio',lineNoSpace)
- if hpaiomatched:
- found = True
- break
+ for path in ['/etc/sane.d/dll.conf',
+ '/etc/sane.d/dll.d/hpaio']:
+ log.debug("'Checking for hpaio' in '%s'..." % path)
+ try:
+ f = file(path, 'r')
+ except IOError:
+ log.error("'%s' not found. Is SANE installed?" % path)
+ else:
+ for line in f:
+ lineNoSpace = re.sub(r'\s', '', line)
+ hpaiomatched=re.match('hpaio',lineNoSpace)
+ if hpaiomatched:
+ found = True
+ break
+
+ if found:
+ break
+
return found
def update_hpaio(self):

188
hplip-dbglog-newline.patch Normal file
View file

@ -0,0 +1,188 @@
diff -up hplip-3.12.6/prnt/hpcups/HPCupsFilter.cpp.dbglog-newline hplip-3.12.6/prnt/hpcups/HPCupsFilter.cpp
--- hplip-3.12.6/prnt/hpcups/HPCupsFilter.cpp.dbglog-newline 2012-06-19 11:01:38.000000000 +0200
+++ hplip-3.12.6/prnt/hpcups/HPCupsFilter.cpp 2012-06-19 11:02:52.150529477 +0200
@@ -440,7 +440,7 @@ DRIVER_ERROR HPCupsFilter::startPage (cu
m_DBusComm.sendEvent(EVENT_PRINT_FAILED_MISSING_PLUGIN, "Plugin missing", m_JA.job_id, m_JA.user_name);
}
- dbglog ("m_Job initialization failed with error = %d", err);
+ dbglog ("m_Job initialization failed with error = %d\n", err);
ppdClose(m_ppd);
m_ppd = NULL;
return err;
@@ -533,7 +533,7 @@ int HPCupsFilter::StartPrintJob(int arg
close(fd);
}
if (m_iLogLevel & BASIC_LOG)
- dbglog("HPCUPS: processRasterData returned %d, calling closeFilter()", err);
+ dbglog("HPCUPS: processRasterData returned %d, calling closeFilter()\n", err);
closeFilter();
cupsRasterClose(cups_raster);
return 1;
@@ -543,7 +543,7 @@ int HPCupsFilter::StartPrintJob(int arg
close(fd);
}
if (m_iLogLevel & BASIC_LOG)
- dbglog("HPCUPS: StartPrintJob end of job, calling closeFilter()");
+ dbglog("HPCUPS: StartPrintJob end of job, calling closeFilter()\n");
closeFilter();
cupsRasterClose(cups_raster);
return 0;
@@ -678,7 +678,7 @@ int HPCupsFilter::processRasterData(cups
//Need to revisit to crosscheck if it is a firmware issue.
*m_pPrinterBuffer = 0x01;
- dbglog("First raster data plane.." );
+ dbglog("First raster data plane..\n" );
}
if (this->isBlankRaster((BYTE *) m_pPrinterBuffer, &cups_header)) {
diff -up hplip-3.12.6/prnt/hpcups/Lidil.cpp.dbglog-newline hplip-3.12.6/prnt/hpcups/Lidil.cpp
--- hplip-3.12.6/prnt/hpcups/Lidil.cpp.dbglog-newline 2012-06-18 12:40:17.000000000 +0200
+++ hplip-3.12.6/prnt/hpcups/Lidil.cpp 2012-06-19 11:01:39.598521705 +0200
@@ -103,7 +103,7 @@ DRIVER_ERROR Lidil::Configure(Pipeline *
if (m_pPM->BaseResX != m_pQA->horizontal_resolution ||
m_pPM->BaseResY != m_pQA->vertical_resolution)
{
- dbglog("Requested resolution not supported with requested printmode");
+ dbglog("Requested resolution not supported with requested printmode\n");
return UNSUPPORTED_PRINTMODE;
}
@@ -166,7 +166,7 @@ DRIVER_ERROR Lidil::StartJob(SystemServi
if (!selectPrintMode())
{
- dbglog("selectPrintMode failed, PrintMode name = %s", m_pQA->print_mode_name);
+ dbglog("selectPrintMode failed, PrintMode name = %s\n", m_pQA->print_mode_name);
return UNSUPPORTED_PRINTMODE;
}
@@ -174,7 +174,7 @@ DRIVER_ERROR Lidil::StartJob(SystemServi
if (m_pPM->BaseResX != m_pQA->horizontal_resolution ||
m_pPM->BaseResY != m_pQA->vertical_resolution)
{
- dbglog("Requested resolution not supported with requested printmode");
+ dbglog("Requested resolution not supported with requested printmode\n");
dbglog(" m_pPM->BaseResX = %d\n",m_pPM->BaseResX);
dbglog(" m_pPM->BaseResY = %d\n",m_pPM->BaseResY);
dbglog(" m_pQA->horizontal_resolution = %d\n",m_pQA->horizontal_resolution);
@@ -193,7 +193,7 @@ DRIVER_ERROR Lidil::StartJob(SystemServi
err = allocateSwathBuffers();
if (err != NO_ERROR)
{
- dbglog("allocateSwathBuffers failed, err = %d", err);
+ dbglog("allocateSwathBuffers failed, err = %d\n", err);
return err;
}
@@ -625,7 +625,7 @@ bool Lidil::selectPrintMode()
{
if (m_pJA->printer_platform[0] == 0)
{
- dbglog("printer_platform is undefined");
+ dbglog("printer_platform is undefined\n");
return false;
}
for (unsigned int i = 0; i < sizeof(lidil_print_modes_table) / sizeof(lidil_print_modes_table[0]); i++)
@@ -635,7 +635,7 @@ bool Lidil::selectPrintMode()
return selectPrintMode(i);
}
}
- dbglog("Unsupported printer_platform: %s", m_pJA->printer_platform);
+ dbglog("Unsupported printer_platform: %s\n", m_pJA->printer_platform);
return false;
}
diff -up hplip-3.12.6/prnt/hpcups/Pcl3.cpp.dbglog-newline hplip-3.12.6/prnt/hpcups/Pcl3.cpp
--- hplip-3.12.6/prnt/hpcups/Pcl3.cpp.dbglog-newline 2012-06-18 12:40:17.000000000 +0200
+++ hplip-3.12.6/prnt/hpcups/Pcl3.cpp 2012-06-19 11:01:39.599521691 +0200
@@ -66,13 +66,13 @@ DRIVER_ERROR Pcl3::Configure(Pipeline **
if (!selectPrintMode())
{
- dbglog("selectPrintMode failed, PrintMode name = %s", m_pQA->print_mode_name);
+ dbglog("selectPrintMode failed, PrintMode name = %s\n", m_pQA->print_mode_name);
return UNSUPPORTED_PRINTMODE;
}
if (m_pPM->BaseResX != m_pQA->horizontal_resolution ||
m_pPM->BaseResY != m_pQA->vertical_resolution)
{
- dbglog("Requested resolution not supported with requested printmode");
+ dbglog("Requested resolution not supported with requested printmode\n");
return UNSUPPORTED_PRINTMODE;
}
@@ -220,7 +220,7 @@ void Pcl3::configureRasterData()
{
if (m_pPM == NULL)
{
- dbglog("configureRasterData: m_pPM is NULL");
+ dbglog("configureRasterData: m_pPM is NULL\n");
return;
}
BYTE *p = cur_pcl_buffer_ptr;
@@ -255,7 +255,7 @@ bool Pcl3::selectPrintMode()
{
if (m_pJA->printer_platform[0] == 0)
{
- dbglog("printer_platform is undefined");
+ dbglog("printer_platform is undefined\n");
return false;
}
for (unsigned int i = 0; i < sizeof(pcl3_print_modes_table) / sizeof(pcl3_print_modes_table[0]); i++)
@@ -265,7 +265,7 @@ bool Pcl3::selectPrintMode()
return selectPrintMode(i);
}
}
- dbglog("Unsupported printer_platform: %s", m_pJA->printer_platform);
+ dbglog("Unsupported printer_platform: %s\n", m_pJA->printer_platform);
return false;
}
diff -up hplip-3.12.6/prnt/hpcups/Pcl3Gui.cpp.dbglog-newline hplip-3.12.6/prnt/hpcups/Pcl3Gui.cpp
--- hplip-3.12.6/prnt/hpcups/Pcl3Gui.cpp.dbglog-newline 2012-06-18 12:40:17.000000000 +0200
+++ hplip-3.12.6/prnt/hpcups/Pcl3Gui.cpp 2012-06-19 11:01:39.599521691 +0200
@@ -66,13 +66,13 @@ DRIVER_ERROR Pcl3Gui::Configure(Pipeline
if (!selectPrintMode())
{
- dbglog("selectPrintMode failed, PrintMode name = %s", m_pQA->print_mode_name);
+ dbglog("selectPrintMode failed, PrintMode name = %s\n", m_pQA->print_mode_name);
return UNSUPPORTED_PRINTMODE;
}
if (m_pPM->BaseResX != m_pQA->horizontal_resolution ||
m_pPM->BaseResY != m_pQA->vertical_resolution)
{
- dbglog("Requested resolution not supported with requested printmode");
+ dbglog("Requested resolution not supported with requested printmode\n");
return UNSUPPORTED_PRINTMODE;
}
@@ -224,7 +224,7 @@ void Pcl3Gui::configureRasterData()
{
if (m_pPM == NULL)
{
- dbglog("configureRasterData: m_pPM is NULL");
+ dbglog("configureRasterData: m_pPM is NULL\n");
return;
}
BYTE *p = cur_pcl_buffer_ptr;
@@ -259,7 +259,7 @@ bool Pcl3Gui::selectPrintMode()
{
if (m_pJA->printer_platform[0] == 0)
{
- dbglog("printer_platform is undefined");
+ dbglog("printer_platform is undefined\n");
return false;
}
for (unsigned int i = 0; i < sizeof(pcl3_gui_print_modes_table) / sizeof(pcl3_gui_print_modes_table[0]); i++)
@@ -269,7 +269,7 @@ bool Pcl3Gui::selectPrintMode()
return selectPrintMode(i);
}
}
- dbglog("Unsupported printer_platform: %s", m_pJA->printer_platform);
+ dbglog("Unsupported printer_platform: %s\n", m_pJA->printer_platform);
return false;
}

View file

@ -0,0 +1,11 @@
diff -up hplip-3.9.8/ui4/setupdialog.py.discovery-method hplip-3.9.8/ui4/setupdialog.py
--- hplip-3.9.8/ui4/setupdialog.py.discovery-method 2009-08-04 22:37:22.000000000 +0100
+++ hplip-3.9.8/ui4/setupdialog.py 2009-09-16 15:34:36.509431266 +0100
@@ -171,6 +171,7 @@ class SetupDialog(QDialog, Ui_Dialog):
QTimer.singleShot(0, self.showRemovePage)
else:
if self.skip_discovery:
+ self.discovery_method = 1 # mDNS
QTimer.singleShot(0, self.showDevicesPage)
else:
QTimer.singleShot(0, self.showDiscoveryPage)

View file

@ -0,0 +1,45 @@
diff -up hplip-3.11.10/scan/sane/hpaio.c~ hplip-3.11.10/scan/sane/hpaio.c
--- hplip-3.11.10/scan/sane/hpaio.c~ 2011-10-02 04:04:48.000000000 +0100
+++ hplip-3.11.10/scan/sane/hpaio.c 2011-10-20 16:00:38.016534755 +0100
@@ -272,25 +272,28 @@ static int DevDiscovery(int localOnly)
}
}
- /* Ignore localOnly flag (used by saned) and always look for network all-in-one scan devices (defined by cups). */
- cnt = GetCupsPrinters(&cups_printer);
- for (i=0; i<cnt; i++)
+ /* Check localOnly flag (used by saned) to decide whether to look for network all-in-one scan devices (defined by cups). */
+ if (!localOnly)
{
- hpmud_query_model(cups_printer[i], &ma);
- if (ma.scantype > 0)
- {
+ cnt = GetCupsPrinters(&cups_printer);
+ for (i=0; i<cnt; i++)
+ {
+ hpmud_query_model(cups_printer[i], &ma);
+ if (ma.scantype > 0)
+ {
hpmud_get_uri_model(cups_printer[i], model, sizeof(model));
AddDeviceList(cups_printer[i], model, &DeviceList);
total++;
- }
- else
- {
+ }
+ else
+ {
DBG(6,"unsupported scantype=%d %s\n", ma.scantype, cups_printer[i]);
- }
- free(cups_printer[i]);
+ }
+ free(cups_printer[i]);
+ }
+ if (cups_printer)
+ free(cups_printer);
}
- if (cups_printer)
- free(cups_printer);
bugout:
return total;

392
hplip-ipp-accessors.patch Normal file
View file

@ -0,0 +1,392 @@
diff -up hplip-3.12.6/prnt/cupsext/cupsext.c.ipp_accessors hplip-3.12.6/prnt/cupsext/cupsext.c
--- hplip-3.12.6/prnt/cupsext/cupsext.c.ipp_accessors 2012-06-18 12:41:19.000000000 +0200
+++ hplip-3.12.6/prnt/cupsext/cupsext.c 2012-07-19 17:11:47.606524137 +0200
@@ -87,6 +87,46 @@ typedef int Py_ssize_t;
#define PY_SSIZE_T_MIN INT_MIN
#endif
+#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 5)
+#define HAVE_CUPS_1_6 1
+#endif
+
+#ifndef HAVE_CUPS_1_6
+#define ippGetCount(attr) attr->num_values
+#define ippGetGroupTag(attr) attr->group_tag
+#define ippGetValueTag(attr) attr->value_tag
+#define ippGetName(attr) attr->name
+#define ippGetBoolean(attr, element) attr->values[element].boolean
+#define ippGetInteger(attr, element) attr->values[element].integer
+#define ippGetStatusCode(ipp) ipp->request.status.status_code
+#define ippGetString(attr, element, language) attr->values[element].string.text
+
+static ipp_attribute_t * ippFirstAttribute( ipp_t *ipp )
+{
+ if (!ipp)
+ return (NULL);
+ return (ipp->current = ipp->attrs);
+}
+
+static ipp_attribute_t * ippNextAttribute( ipp_t *ipp )
+{
+ if (!ipp || !ipp->current)
+ return (NULL);
+ return (ipp->current = ipp->current->next);
+}
+
+static int ippSetOperation( ipp_t *ipp, ipp_op_t op )
+{
+ ipp->request.op.operation_id = op;
+ return (1);
+}
+
+static int ippSetRequestId( ipp_t *ipp, int request_id )
+{
+ ipp->request.any.request_id = request_id;
+ return (1);
+}
+#endif
int g_num_options = 0;
cups_option_t * g_options;
@@ -333,8 +373,8 @@ PyObject * getPrinters( PyObject * self,
request = ippNew();
language = cupsLangDefault();
- request->request.op.operation_id = CUPS_GET_PRINTERS;
- request->request.any.request_id = 1;
+ ippSetOperation( request, CUPS_GET_PRINTERS );
+ ippSetRequestId ( request, 1);
ippAddString( request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
"attributes-charset", NULL, cupsLangEncoding( language ) );
@@ -378,10 +418,10 @@ PyObject * getPrinters( PyObject * self,
ipp_pstate_t state;
int i = 0;
- for ( attr = response->attrs; attr != NULL; attr = attr->next )
+ for ( attr = ippFirstAttribute( response ); attr != NULL; attr = ippNextAttribute( response ) )
{
- while ( attr != NULL && attr->group_tag != IPP_TAG_PRINTER )
- attr = attr->next;
+ while ( attr != NULL && ippGetGroupTag( attr ) != IPP_TAG_PRINTER )
+ attr = ippNextAttribute( response );
if ( attr == NULL )
break;
@@ -390,41 +430,41 @@ PyObject * getPrinters( PyObject * self,
state = IPP_PRINTER_IDLE;
accepting = 0;
- while ( attr != NULL && attr->group_tag == IPP_TAG_PRINTER )
+ while ( attr != NULL && ippGetGroupTag( attr ) == IPP_TAG_PRINTER )
{
- if ( strcmp( attr->name, "printer-name" ) == 0 &&
- attr->value_tag == IPP_TAG_NAME )
- name = attr->values[ 0 ].string.text;
-
- else if ( strcmp( attr->name, "device-uri" ) == 0 &&
- attr->value_tag == IPP_TAG_URI )
- device_uri = attr->values[ 0 ].string.text;
-
- else if ( strcmp( attr->name, "printer-uri-supported" ) == 0 &&
- attr->value_tag == IPP_TAG_URI )
- printer_uri = attr->values[ 0 ].string.text;
-
- else if ( strcmp( attr->name, "printer-info" ) == 0 &&
- attr->value_tag == IPP_TAG_TEXT )
- info = attr->values[ 0 ].string.text;
-
- else if ( strcmp( attr->name, "printer-location" ) == 0 &&
- attr->value_tag == IPP_TAG_TEXT )
- location = attr->values[ 0 ].string.text;
-
- else if ( strcmp( attr->name, "printer-make-and-model" ) == 0 &&
- attr->value_tag == IPP_TAG_TEXT )
- make_model = attr->values[ 0 ].string.text;
-
- else if ( strcmp( attr->name, "printer-state" ) == 0 &&
- attr->value_tag == IPP_TAG_ENUM )
- state = ( ipp_pstate_t ) attr->values[ 0 ].integer;
-
- else if (!strcmp(attr->name, "printer-is-accepting-jobs") &&
- attr->value_tag == IPP_TAG_BOOLEAN)
- accepting = attr->values[ 0 ].boolean;
+ if ( strcmp( ippGetName( attr ), "printer-name" ) == 0 &&
+ ippGetValueTag( attr ) == IPP_TAG_NAME )
+ name = ippGetString( attr, 0, NULL );
+
+ else if ( strcmp( ippGetName( attr ), "device-uri" ) == 0 &&
+ ippGetValueTag( attr ) == IPP_TAG_URI )
+ device_uri = ippGetString( attr, 0, NULL );
+
+ else if ( strcmp( ippGetName( attr ), "printer-uri-supported" ) == 0 &&
+ ippGetValueTag( attr ) == IPP_TAG_URI )
+ printer_uri = ippGetString( attr, 0, NULL );
+
+ else if ( strcmp( ippGetName( attr ), "printer-info" ) == 0 &&
+ ippGetValueTag( attr ) == IPP_TAG_TEXT )
+ info = ippGetString( attr, 0, NULL );
+
+ else if ( strcmp( ippGetName( attr ), "printer-location" ) == 0 &&
+ ippGetValueTag( attr ) == IPP_TAG_TEXT )
+ location = ippGetString( attr, 0, NULL );
+
+ else if ( strcmp( ippGetName( attr ), "printer-make-and-model" ) == 0 &&
+ ippGetValueTag( attr ) == IPP_TAG_TEXT )
+ make_model = ippGetString( attr, 0, NULL );
+
+ else if ( strcmp( ippGetName( attr ), "printer-state" ) == 0 &&
+ ippGetValueTag( attr ) == IPP_TAG_ENUM )
+ state = ( ipp_pstate_t ) ippGetInteger( attr, 0 );
+
+ else if (!strcmp(ippGetName( attr ), "printer-is-accepting-jobs") &&
+ ippGetValueTag( attr ) == IPP_TAG_BOOLEAN)
+ accepting = ippGetBoolean( attr, 0 );
- attr = attr->next;
+ attr = ippNextAttribute( response );
}
if ( device_uri == NULL )
@@ -522,8 +562,8 @@ PyObject * addPrinter( PyObject * self,
request = ippNew();
language = cupsLangDefault();
- request->request.op.operation_id = CUPS_ADD_PRINTER;
- request->request.any.request_id = 1;
+ ippSetOperation( request, CUPS_ADD_PRINTER );
+ ippSetRequestId ( request, 1 );
ippAddString( request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
"attributes-charset", NULL, cupsLangEncoding( language ) );
@@ -568,7 +608,7 @@ PyObject * addPrinter( PyObject * self,
}
else
{
- status = response->request.status.status_code;
+ status = ippGetStatusCode( response );
//ippDelete( response );
r = 1;
}
@@ -631,8 +671,8 @@ PyObject * delPrinter( PyObject * self,
*/
request = ippNew();
- request->request.op.operation_id = CUPS_DELETE_PRINTER;
- request->request.op.request_id = 1;
+ ippSetOperation( request, CUPS_DELETE_PRINTER );
+ ippSetRequestId ( request, 1 );
language = cupsLangDefault();
@@ -650,7 +690,7 @@ PyObject * delPrinter( PyObject * self,
*/
response = cupsDoRequest( http, request, "/admin/" );
- if ( ( response != NULL ) && ( response->request.status.status_code <= IPP_OK_CONFLICT ) )
+ if ( ( response != NULL ) && ( ippGetStatusCode( response ) <= IPP_OK_CONFLICT ) )
{
r = 1;
}
@@ -721,8 +761,8 @@ PyObject * setDefaultPrinter( PyObject *
request = ippNew();
- request->request.op.operation_id = CUPS_SET_DEFAULT;
- request->request.op.request_id = 1;
+ ippSetOperation( request, CUPS_SET_DEFAULT );
+ ippSetRequestId ( request, 1 );
language = cupsLangDefault();
@@ -743,7 +783,7 @@ PyObject * setDefaultPrinter( PyObject *
response = cupsDoRequest( http, request, "/admin/" );
- if ( ( response != NULL ) && ( response->request.status.status_code <= IPP_OK_CONFLICT ) )
+ if ( ( response != NULL ) && ( ippGetStatusCode( response ) <= IPP_OK_CONFLICT ) )
{
r = 1;
}
@@ -797,8 +837,8 @@ PyObject * controlPrinter( PyObject * se
request = ippNew();
- request->request.op.operation_id = op;
- request->request.op.request_id = 1;
+ ippSetOperation( request, op );
+ ippSetRequestId ( request, 1 );
language = cupsLangDefault();
@@ -822,7 +862,7 @@ PyObject * controlPrinter( PyObject * se
response = cupsDoRequest(http, request, "/admin/");
- if (( response != NULL ) && (response->request.status.status_code <= IPP_OK_CONFLICT))
+ if (( response != NULL ) && (ippGetStatusCode( response ) <= IPP_OK_CONFLICT))
{
r = 1;
}
@@ -837,7 +877,7 @@ abort:
if ( response != NULL )
ippDelete( response );
- return Py_BuildValue( "i", r );;
+ return Py_BuildValue( "i", r );
}
@@ -1116,8 +1156,8 @@ PyObject * getPPDList( PyObject * self,
request = ippNew();
- request->request.op.operation_id = CUPS_GET_PPDS;
- request->request.op.request_id = 1;
+ ippSetOperation( request, CUPS_GET_PPDS );
+ ippSetRequestId ( request, 1 );
language = cupsLangDefault();
@@ -1143,43 +1183,43 @@ PyObject * getPPDList( PyObject * self,
if ((response = cupsDoRequest(http, request, "/")) != NULL)
{
- for (attr = response->attrs; attr; attr = attr->next)
+ for (attr = ippFirstAttribute( response ); attr; attr = ippNextAttribute( response ))
{
PyObject *dict;
char *ppdname = NULL;
- while (attr && attr->group_tag != IPP_TAG_PRINTER)
- attr = attr->next;
+ while (attr && ippGetGroupTag( attr ) != IPP_TAG_PRINTER)
+ attr = ippNextAttribute( response );
if (!attr)
break;
dict = PyDict_New ();
- for (; attr && attr->group_tag == IPP_TAG_PRINTER; attr = attr->next)
+ for (; attr && ippGetGroupTag( attr ) == IPP_TAG_PRINTER; attr = ippNextAttribute( response ))
{
PyObject *val = NULL;
- if (!strcmp (attr->name, "ppd-name") && attr->value_tag == IPP_TAG_NAME)
+ if (!strcmp (ippGetName( attr ), "ppd-name") && ippGetValueTag( attr ) == IPP_TAG_NAME)
{
- ppdname = attr->values[0].string.text;
+ ppdname = ippGetString( attr, 0, NULL );
//sprintf( buf, "print '%s'", ppdname);
//PyRun_SimpleString( buf );
}
- else if (attr->value_tag == IPP_TAG_TEXT || attr->value_tag == IPP_TAG_NAME || attr->value_tag == IPP_TAG_KEYWORD)
- //else if ((!strcmp (attr->name, "ppd-natural-language") && attr->value_tag == IPP_TAG_LANGUAGE) ||
- // (!strcmp (attr->name, "ppd-make-and-model") && attr->value_tag == IPP_TAG_TEXT) ||
- // (!strcmp (attr->name, "ppd-make") && attr->value_tag == IPP_TAG_TEXT) ||
- // (!strcmp (attr->name, "ppd-device-id") && attr->value_tag == IPP_TAG_TEXT))
+ else if (ippGetValueTag( attr ) == IPP_TAG_TEXT || ippGetValueTag( attr ) == IPP_TAG_NAME || ippGetValueTag( attr ) == IPP_TAG_KEYWORD)
+ //else if ((!strcmp (ippGetName( attr ), "ppd-natural-language") && ippGetValueTag( attr ) == IPP_TAG_LANGUAGE) ||
+ // (!strcmp (ippGetName( attr ), "ppd-make-and-model") && ippGetValueTag( attr ) == IPP_TAG_TEXT) ||
+ // (!strcmp (ippGetName( attr ), "ppd-make") && ippGetValueTag( attr ) == IPP_TAG_TEXT) ||
+ // (!strcmp (ippGetName( attr ), "ppd-device-id") && ippGetValueTag( attr ) == IPP_TAG_TEXT))
{
- val = PyObj_from_UTF8(attr->values[0].string.text);
+ val = PyObj_from_UTF8(ippGetString( attr, 0, NULL ));
}
if (val)
{
- PyDict_SetItemString (dict, attr->name, val);
+ PyDict_SetItemString (dict, ippGetName( attr ), val);
Py_DECREF (val);
}
}
diff -up hplip-3.12.6/scan/sane/hpaio.c.ipp_accessors hplip-3.12.6/scan/sane/hpaio.c
--- hplip-3.12.6/scan/sane/hpaio.c.ipp_accessors 2012-06-18 12:42:51.000000000 +0200
+++ hplip-3.12.6/scan/sane/hpaio.c 2012-07-19 17:12:34.557848760 +0200
@@ -47,6 +47,43 @@
#define DEBUG_DECLARE_ONLY
#include "sanei_debug.h"
+#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 5)
+#define HAVE_CUPS_1_6 1
+#endif
+
+#ifndef HAVE_CUPS_1_6
+#define ippGetGroupTag(attr) attr->group_tag
+#define ippGetValueTag(attr) attr->value_tag
+#define ippGetName(attr) attr->name
+#define ippGetString(attr, element, language) attr->values[element].string.text
+
+static ipp_attribute_t * ippFirstAttribute( ipp_t *ipp )
+{
+ if (!ipp)
+ return (NULL);
+ return (ipp->current = ipp->attrs);
+}
+
+static ipp_attribute_t * ippNextAttribute( ipp_t *ipp )
+{
+ if (!ipp || !ipp->current)
+ return (NULL);
+ return (ipp->current = ipp->current->next);
+}
+
+static int ippSetOperation( ipp_t *ipp, ipp_op_t op )
+{
+ ipp->request.op.operation_id = op;
+ return (1);
+}
+
+static int ippSetRequestId( ipp_t *ipp, int request_id )
+{
+ ipp->request.any.request_id = request_id;
+ return (1);
+}
+#endif
+
static SANE_Device **DeviceList = NULL;
static int AddDeviceList(char *uri, char *model, SANE_Device ***pd)
@@ -186,8 +223,8 @@ static int GetCupsPrinters(char ***print
/* Assemble the IPP request */
request = ippNew();
- request->request.op.operation_id = CUPS_GET_PRINTERS;
- request->request.any.request_id = 1;
+ ippSetOperation( request, CUPS_GET_PRINTERS );
+ ippSetRequestId( request, 1 );
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, "attributes-charset", NULL, "utf-8");
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, "attributes-natural-language", NULL, "en");
@@ -197,20 +234,20 @@ static int GetCupsPrinters(char ***print
if ((response = cupsDoRequest(http, request, "/")) == NULL)
goto bugout;
- for (attr = response->attrs; attr != NULL; attr = attr->next)
+ for (attr = ippFirstAttribute ( response ); attr != NULL; attr = ippNextAttribute( response ))
{
/* Skip leading attributes until we hit a printer. */
- while (attr != NULL && attr->group_tag != IPP_TAG_PRINTER)
- attr = attr->next;
+ while (attr != NULL && ippGetGroupTag( attr ) != IPP_TAG_PRINTER)
+ attr = ippNextAttribute( response );
if (attr == NULL)
break;
- while (attr != NULL && attr->group_tag == IPP_TAG_PRINTER)
+ while (attr != NULL && ippGetGroupTag( attr ) == IPP_TAG_PRINTER)
{
- if (strcmp(attr->name, "device-uri") == 0 && attr->value_tag == IPP_TAG_URI && AddCupsList(attr->values[0].string.text, printer) == 0)
+ if (strcmp(ippGetName( attr ), "device-uri") == 0 && ippGetValueTag( attr ) == IPP_TAG_URI && AddCupsList(ippGetString( attr, 0, NULL ), printer) == 0)
cnt++;
- attr = attr->next;
+ attr = ippNextAttribute( response );
}
if (attr == NULL)

View file

@ -0,0 +1,28 @@
--- hplip-3.12.6/prnt/hpcups/HPCupsFilter.cpp.mucks-with-spooldir 2012-06-18 12:40:17.000000000 +0200
+++ hplip-3.12.6/prnt/hpcups/HPCupsFilter.cpp 2012-06-26 18:11:53.720261545 +0200
@@ -474,25 +474,6 @@ int HPCupsFilter::StartPrintJob(int arg
getLogLevel();
m_JA.job_id = atoi(argv[1]);
- FILE *fp;
- char dFileName[32];
- memset(dFileName, 0, sizeof(dFileName));
- m_JA.job_id = atoi(argv[1]);
- snprintf (dFileName, sizeof(dFileName), "/var/spool/cups/d%05d-001", m_JA.job_id);
- if ((fp = fopen (dFileName, "r")))
- {
- char line[258];
- for (int i = 0; i < 10; i++)
- {
- fgets (line, 256, fp);
- if (!strncmp (line, "%%Pages:", 8))
- {
- sscanf (line+9, "%d", &m_JA.total_pages);
- break;
- }
- }
- fclose (fp);
- }
m_ppd = ppdOpenFile(getenv("PPD"));
if (m_ppd == NULL) {

View file

@ -0,0 +1,23 @@
diff -up hplip-3.10.9/ui4/systemtray.py.notification-exception hplip-3.10.9/ui4/systemtray.py
--- hplip-3.10.9/ui4/systemtray.py.notification-exception 2011-01-05 10:45:57.000000000 +0100
+++ hplip-3.10.9/ui4/systemtray.py 2011-01-05 12:34:18.000000000 +0100
@@ -27,6 +27,7 @@ import os
import signal
import os.path
import time
+import gobject
# Local
@@ -662,7 +663,10 @@ class SystemTrayApp(QApplication):
else:
n.set_timeout(TRAY_MESSAGE_DELAY)
- n.show()
+ try:
+ n.show()
+ except gobject.GError:
+ log.error("Failed to show notification!")
else: # Use "standard" message bubbles
icon = ERROR_STATE_TO_ICON.get(error_state, QSystemTrayIcon.Information)

View file

@ -0,0 +1,11 @@
diff -up hplip-3.10.2/prnt/hpcups/LJColor.h.skip-blank-lines hplip-3.10.2/prnt/hpcups/LJColor.h
--- hplip-3.10.2/prnt/hpcups/LJColor.h.skip-blank-lines 2010-02-24 23:04:09.000000000 +0000
+++ hplip-3.10.2/prnt/hpcups/LJColor.h 2010-04-15 21:46:48.375754707 +0100
@@ -48,6 +48,7 @@ public:
DRIVER_ERROR Configure(Pipeline **pipeline);
DRIVER_ERROR EndJob();
DRIVER_ERROR FormFeed();
+ bool CanSkipRasters() {return false;}
protected:
virtual DRIVER_ERROR addJobSettings();
void configureRasterData();

View file

@ -0,0 +1,18 @@
diff -up hplip-3.12.11/ui4/systemtray.py.systray-dbus-exception hplip-3.12.11/ui4/systemtray.py
--- hplip-3.12.11/ui4/systemtray.py.systray-dbus-exception 2012-11-20 10:51:40.000000000 +0100
+++ hplip-3.12.11/ui4/systemtray.py 2012-11-27 10:08:51.333805871 +0100
@@ -802,7 +802,13 @@ def run(read_pipe):
log.set_module("hp-systray(qt4)")
log.debug("PID=%d" % os.getpid())
- app = SystemTrayApp(sys.argv, read_pipe)
+ try:
+ app = SystemTrayApp(sys.argv, read_pipe)
+ except DBusException, e:
+ # No session bus
+ log.debug("Caught exception: %s" % e)
+ sys.exit(1)
+
app.setQuitOnLastWindowClosed(False) # If not set, settings dlg closes app
i = 0

View file

@ -1 +1,2 @@
d /run/hplip 0755 root root -
d /var/run/hplip 0775 root lp -

View file

@ -1,13 +1,3 @@
<<<<<<< HEAD:hplip-3.13.10-fix-udev-rules.patch
--- hplip-3.13.10/data/rules/56-hpmud_sysfs.rules 2013-10-11 09:38:53.000000000 +0000
+++ hplip-3.13.10/data/rules/56-hpmud_sysfs.rules.tpg 2013-10-19 11:15:57.196603385 +0000
@@ -14,9 +14,6 @@
# For RHEL 5, centos 5..
ENV{hp_test}=="yes", PROGRAM="/bin/sh -c 'X=%k; X=$${X#usbdev}; B=$${X%%%%.*}; D=$${X#*.}; logger -p user.info loading HP Device $$B $$D; printf %%03i:%%03i $$B $$D'", RUN+="/bin/sh -c '/usr/bin/python hp-config_usb_printer %c '"
-# This rule will add the printer and install plugin
-ENV{hp_test}=="yes", PROGRAM="/bin/sh -c 'logger -p user.info loading HP Device $env{BUSNUM} $env{DEVNUM}'", RUN+="/bin/sh -c 'if [ -f /usr/bin/systemctl ]; then /usr/bin/systemctl --no-block start hplip-printer@$env{BUSNUM}:$env{DEVNUM}.service; else /usr/bin/nohup /usr/bin/python /usr/bin/hp-config_usb_printer $env{BUSNUM}:$env{DEVNUM} ; fi'"
=======
diff -up hplip-3.13.6/Makefile.in.udev-rules hplip-3.13.6/Makefile.in
--- hplip-3.13.6/Makefile.in.udev-rules 2013-06-24 10:28:19.868301356 +0200
+++ hplip-3.13.6/Makefile.in 2013-06-24 10:32:21.272134161 +0200
@ -29,7 +19,6 @@ diff -up hplip-3.13.6/Makefile.in.udev-rules hplip-3.13.6/Makefile.in
-# This rule will add the printer and install plugin
-ENV{hp_test}=="yes", PROGRAM="/bin/sh -c 'logger -p user.info loading HP Device $env{BUSNUM} $env{DEVNUM}'", RUN+="/bin/sh -c 'if [ -f /usr/bin/systemctl ]; then /usr/bin/systemctl --no-block start hplip-printer@$env{BUSNUM}:$env{DEVNUM}.service; else /usr/bin/nohup /usr/bin/hp-config_usb_printer $env{BUSNUM}:$env{DEVNUM} ; fi'"
>>>>>>> 8c61d1c7c9e7ec8ac21759518f57677e79581a22:hplip-udev-rules.patch
-
# If sane-bankends is installed add hpaio backend support to dll.conf if needed.
ENV{sane_hpaio}=="yes", RUN+="/bin/sh -c 'grep -q ^#hpaio /etc/sane.d/dll.conf;if [ $$? -eq 0 ];then sed -i -e s/^#hpaio/hpaio/ /etc/sane.d/dll.conf;else grep -q ^hpaio /etc/sane.d/dll.conf;if [ $$? -ne 0 ];then echo hpaio >>/etc/sane.d/dll.conf;fi;fi'"

12
hplip-wifisetup.patch Normal file
View file

@ -0,0 +1,12 @@
diff -up hplip-3.11.1/ui4/wifisetupdialog.py.wifisetup hplip-3.11.1/ui4/wifisetupdialog.py
--- hplip-3.11.1/ui4/wifisetupdialog.py.wifisetup 2011-01-19 06:18:20.000000000 +0100
+++ hplip-3.11.1/ui4/wifisetupdialog.py 2011-03-01 15:39:02.000000000 +0100
@@ -301,7 +301,7 @@ class WifiSetupDialog(QDialog, Ui_Dialog
self.dev.close()
endWaitCursor()
- self.num_networks = self.networks['numberofscanentries']
+ self.num_networks = self.networks.get('numberofscanentries')
self.clearNetworksTable()
if self.num_networks:

View file

@ -18,11 +18,11 @@
Summary: HP printer/all-in-one driver infrastructure
Name: hplip
Version: 3.13.11
Release: 12
Release: 13
License: GPLv2+ and MIT
Group: System/Printing
Url: http://hplip.sourceforge.net/
Source0: http://downloads.sourceforge.net/project/hplip/hplip/%{version}%{extraversion}/%{name}-%{version}%{extraversion}.tar.gz
Source0: http://garr.dl.sourceforge.net/sourceforge/hplip/%{name}-%{version}%{extraversion}.tar.gz
Source1: hpcups-update-ppds.sh
Source2: %{name}-tmpfiles.conf
# http://www.iconfinder.com/icondetails/6393/128/fax_hardware_icon
@ -31,21 +31,21 @@ Source4: hplip.rpmlintrc
# http://hplipopensource.com/node/367
Source5: http://hplipopensource.com/hplip-web/smartinstall/SmartInstallDisable-Tool.run
Source6: README.urpmi
# (doktor5000) fix linking with python and libsane
# taken from mandriva
Patch1: hplip-3.11.3-mdv-link.patch
# (Anssi) Apply udev rules even on ACTION=="change", otherwise the permissions
# do not get applied in %%post on a new installation:
Patch2: hplip-apply-udev-rules-on-action-change.patch
# Patch3: hplip-3.13.10-fix-systray-x.patch
# Fedora patches
Patch101: hplip-pstotiff-is-rubbish.patch
Patch102: hplip-strstr-const.patch
Patch103: hplip-ui-optional.patch
Patch104: hplip-no-asm.patch
# add
Patch105: hplip-deviceIDs-drv.patch
# add
Patch107: hplip-deviceIDs-ppd.patch
Patch105: hplip-deviceIDs-drv.patch
Patch107: hplip-deviceIDs-ppd.patch
Patch108: hplip-retry-open.patch
Patch109: hplip-snmp-quirks.patch
Patch111: hplip-hpijs-marker-supply.patch
@ -54,13 +54,12 @@ Patch114: hplip-hpcups-sigpipe.patch
Patch115: hplip-logdir.patch
Patch116: hplip-bad-low-ink-warning.patch
Patch121: hplip-ppd-ImageableArea.patch
Patch122: hplip-raw_deviceID-traceback.patch
Patch125: hplip-dbus-exception.patch
Patch127: hplip-CVE-2010-4267.patch
# fedora patch not necessary. done via sed call
#Patch129: hplip-makefile-chgrp.patch
Patch132: hplip-IEEE-1284-4.patch
Patch134: hplip-3.13.10-fix-udev-rules.patch
Patch131: hplip-ipp-accessors.patch
Patch132: hplip-IEEE-1284-4.patch
Patch133: hplip-check.patch
Patch134: hplip-udev-rules.patch
# Debian/Ubuntu patches
# taken from http://patch-tracker.debian.org/package/hplip/3.11.7-1
@ -83,6 +82,8 @@ Patch226: hp-systray-make-menu-title-visible-in-sni-qt-indicator.dpatch
Patch227: hp-systray-make-menu-appear-in-sni-qt-indicator-with-kde.dpatch
Patch228: hpaio-option-duplex.diff
Patch302: hplip-CVE-2013-4325.patch
BuildRequires: desktop-file-utils
BuildRequires: imagemagick
BuildRequires: polkit
@ -132,6 +133,7 @@ Suggests: foomatic-db-hpijs
# hp-doctor requires gui modules
Requires: hplip-gui
# foomatic-db-hpijs drivers are provided by hp and by this package now
# NOTE: remove the foomatic-db-hpijs deps sometime in 2010-10-?? ?
Provides: foomatic-db-hpijs = %{version}-%{release}
@ -251,6 +253,9 @@ flash memory cards.
%prep
%setup -qn %{name}-%{version}%{extraversion}
%patch2 -p1 -b .udev-rules-on-action-change
# %patch3 -p1 -b .systray
# Fedora patches
# The pstotiff filter is rubbish so replace it (launchpad #528394).
@ -262,17 +267,19 @@ flash memory cards.
# Make utils.checkPyQtImport() look for the gui sub-package (RH bug #243273).
%patch103 -p1 -b .ui-optional
# Make sure to avoid handwritten asm.
%patch104 -p1 -b .no-asm
%patch105 -p1 -b .ids
for ppd_file in $(grep '^diff' %{PATCH107} | cut -d " " -f 4);
do
gunzip ${ppd_file#*/}.gz
done
%patch107 -p1 -b .deviceIDs-ppd
for ppd_file in $(grep '^diff' %{PATCH107} | cut -d " " -f 4);
do
gzip -n ${ppd_file#*/}
done
%patch107 -p1 -b .deviceIDs-ppd
for ppd_file in $(grep '^diff' %{PATCH107} | cut -d " " -f 4);
do
gzip -n ${ppd_file#*/}
done
# Retry when connecting to device fails (RH bug #532112).
@ -306,13 +313,6 @@ do
gzip -n ${ppd_file#*/}
done
# Catch D-Bus exceptions in fax dialog (RH bug #645316).
#patch125 -p1 -b .dbus-exception
# Applied patch to fix CVE-2010-4267, remote stack overflow
# vulnerability (RH bug #670252).
#patch127 -p1 -b .CVE-2010-4267
# Don't run 'chgrp lp /var/log/hp' in makefile (removes all lines with "chgrp")
sed -i '/chgrp/d' Makefile.am
@ -321,7 +321,10 @@ sed -i.duplex-constraints \
prnt/drv/hpcups.drv.in
#patch132 -p1 -b .hplip-IEEE-1284-4
%patch134 -p1 -b .rules-fix
# Removed SYSFS use in udev rules and actually made them work (bug #560754).
# Move udev rules to /lib/udev/rules.d (bug #748208).
%patch134 -p1 -b .udev-rules
# Debian/Ubuntu patches
@ -344,7 +347,7 @@ sed -i.duplex-constraints \
%patch207 -p1 -b .hplip-pjl-duplex-binding
# original patch from debian, path to kdesu added for %%_libdir on x86_64
%patch208 -p1 -b .mga-kde4-kdesudo-support
# %patch208 -p1 -b .mga-kde4-kdesudo-support
# https://bugs.launchpad.net/debian/+source/hplip/+bug/530746
%patch209 -p1 -b .hp-check-groups
@ -367,6 +370,8 @@ sed -i.duplex-constraints \
%patch228 -p1 -b .hpaio-option-duplex
%patch302 -p0
# Use filter foomatic-rip instead of foomatic-rip-hplip (fix from Mandriva)
for PPDGZ in ppd/hpijs/*.ppd.gz
do
@ -395,13 +400,11 @@ WITHOUT_SANE="--without-sane"
--enable-gui-build \
--enable-fax-build \
--enable-pp-build \
--enable-qt4 \
--disable-qt3 \
--enable-qt4 --disable-qt3 \
--enable-hpcups-install \
--enable-cups-drv-install \
--enable-cups-ppd-install \
--enable-hpijs-install \
--enable-foomatic-drv-install \
--enable-udev-acl-rules \
--enable-policykit \
--with-mimedir=%{_datadir}/cups/mime
@ -437,10 +440,8 @@ rm -f %{buildroot}%{_bindir}/hp-uninstall
rm -f %{buildroot}%{_datadir}/hplip/upgrade.*
rm -f %{buildroot}%{_bindir}/hp-upgrade
rm -f %{buildroot}%{_bindir}/hp-config_usb_printer
rm -f %{buildroot}%{_unitdir}/hplip-printer@.service
rm -f %{buildroot}%{_datadir}/hplip/config_usb_printer.*
rm -f %{buildroot}%{_libdir}/*.la
rm -rf %{buildroot}%{python_sitearch}/*.la
rm -rf %{buildroot}%{_libdir}/sane/*.la
mkdir -p %{buildroot}%{_datadir}/applications
desktop-file-install --vendor='' \
@ -476,6 +477,10 @@ install -D -m 0644 48.png %{buildroot}%{_iconsdir}/hicolor/48x48/apps/hp-sendfax
install -D -m 0644 64.png %{buildroot}%{_iconsdir}/hicolor/64x64/apps/hp-sendfax.png
install -D -m 0644 %{SOURCE3} %{buildroot}%{_iconsdir}/hicolor/128x128/apps/hp-sendfax.png
# (cg) Correct the udev rules dir
mkdir -p %{buildroot}/lib
mv %{buildroot}%{_sysconfdir}/udev %{buildroot}/lib/
# switched to udev, no need for hal information
rm -rf %{buildroot}%{_datadir}/hal/fdi
@ -507,37 +512,39 @@ mv %{buildroot}%{_bindir}/hp-setup %{buildroot}%{_sbindir}/hp-setup
ln -s consolehelper %{buildroot}%{_bindir}/hp-setup
# console user, ask for root password
mkdir -p %{buildroot}%{_sysconfdir}/security/console.apps
cat > %{buildroot}%{_sysconfdir}/security/console.apps/hp-setup <<EOF
mkdir -p %{buildroot}%{_sysconfdir}/security/console.apps
cat > %{buildroot}%{_sysconfdir}/security/console.apps/hp-setup <<EOF
USER=root
PROGRAM=/usr/sbin/hp-setup
FALLBACK=false
SESSION=true
EOF
mkdir -p %{buildroot}%{_sysconfdir}/pam.d
cat > %{buildroot}%{_sysconfdir}/pam.d/hp-setup <<EOF
mkdir -p %{buildroot}%{_sysconfdir}/pam.d
cat > %{buildroot}%{_sysconfdir}/pam.d/hp-setup <<EOF
#%PAM-1.0
auth include config-util
account include config-util
session include config-util
EOF
# Make sure pyc files are generated, otherwise we can get
# difficult to debug problems
pushd %{buildroot}%{_datadir}/%{name}
python -m compileall .
popd
# create empty /var/lip/hp/hplip.state to fix hp-plugin installation (mga#5395)
mkdir -p %{buildroot}%{_localstatedir}/lib/hp/
touch %{buildroot}%{_localstatedir}/lib/hp/hplip.state
# create empty log directory so that it can be owned
mkdir -p %{buildroot}%{_localstatedir}/log/hp/tmp
mkdir -p %{buildroot}%{_unitdir}
mv -f %{buildroot}/usr/lib/systemd/system/hplip-printer@.service %{buildroot}%{_unitdir}/hplip-printer@.service
#(akdengi) we do not use 56-hpmud.rules, we need use 56-hpmud_sysfs.rules
rm -f %{buildroot}%{_sysconfdir}/udev/rules.d/56-hpmud.rules
install -m0644 data/rules/56-hpmud_sysfs.rules %{buildroot}%{_sysconfdir}/udev/rules.d/56-hpmud_sysfs.rules
sed -e 's/0664/0666/' -i %{buildroot}/lib/udev/rules.d/56-hpmud.rules
sed -e 's/ATTR{idVendor}/SYSFS{idVendor}/' %{buildroot}/lib/udev/rules.d/56-hpmud.rules
%triggerin -- hplip < 2.7.7
chkconfig --del hplip
@ -548,6 +555,7 @@ if [ -f /etc/init.d/cups ]; then
fi
%post
# We don't have this macro yes...
/bin/systemd-tmpfiles --create %{name}.conf
# tmpfiles_create %{name}
@ -598,7 +606,7 @@ fi
%{_bindir}/hp-align
%{_bindir}/hp-clean
%{_bindir}/hp-colorcal
#%{_bindir}/hp-config_usb_printer
#{_bindir}/hp-config_usb_printer
%{_bindir}/hp-devicesettings
%{_bindir}/hp-diagnose_plugin
%{_bindir}/hp-diagnose_queues
@ -627,7 +635,7 @@ fi
%{_bindir}/hp-timedate
#%{_bindir}/hp-uninstall
%{_bindir}/hp-unload
#%{_bindir}/hp-upgrade
#{_bindir}/hp-upgrade
%{_bindir}/hp-wificonfig
%{_sysconfdir}/pam.d/hp-setup
%{_sysconfdir}/security/console.apps/hp-setup
@ -643,7 +651,6 @@ fi
# Note: this must be /usr/lib not %{_libdir}, since that's the
# CUPS serverbin directory.
%attr(0755,root,root) %{_prefix}/lib/cups/backend/hp*
#%{_prefix}/lib/cups/filter/hplipjs
%{_prefix}/lib/cups/filter/hpcups
%{_prefix}/lib/cups/filter/hpcupsfax
%{_prefix}/lib/cups/filter/hpps
@ -658,7 +665,7 @@ fi
%{_datadir}/hplip/check-plugin.py*
%{_datadir}/hplip/clean.py*
%{_datadir}/hplip/colorcal.py*
#%{_datadir}/hplip/config_usb_printer.py*
#{_datadir}/hplip/config_usb_printer.py*
%{_datadir}/hplip/devicesettings.py*
%{_datadir}/hplip/diagnose_plugin.py*
%{_datadir}/hplip/diagnose_queues.py*
@ -735,7 +742,7 @@ fi
%endif
%files model-data
%{_sysconfdir}/udev/rules.d/*.rules
/lib/udev/rules.d/*.rules
%{_datadir}/hplip/data/models
%files gui
@ -761,10 +768,9 @@ fi
# the link is here
%dir %{_datadir}/ppd
%dir %{_datadir}/ppd/HP
%{_datadir}/cups/drv/hp/hpijs.drv
#{_datadir}/cups/drv/hp/hpijs.drv
%{_bindir}/hpcups-update-ppds
%files hpijs-ppds
%{_datadir}/ppd/HP/apollo*.ppd*
%{_datadir}/ppd/HP/hp-*.ppd*

View file

@ -0,0 +1,18 @@
#! /bin/sh /usr/share/dpatch/dpatch-run
## make-commafy-correctly-work-with-python-2.dpatch by <till.kamppeter@gmail.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.
@DPATCH@
--- a/base/utils.py
+++ b/base/utils.py
@@ -462,7 +462,7 @@
def commafy(val):
- return unicode(locale.format("%d", val, grouping=True))
+ return locale.format("%d", val, grouping=True).decode(locale.getpreferredencoding())
def format_bytes(s, show_bytes=False):

65
try_libhpmud.so.0.dpatch Normal file
View file

@ -0,0 +1,65 @@
#! /bin/sh /usr/share/dpatch/dpatch-run
## try_libhpmud.so.0.dpatch by <evgeni@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Try libhpmud.so.0 after libhpmud.so
@DPATCH@
--- a/scan/sane/marvell.c
+++ b/scan/sane/marvell.c
@@ -60,8 +60,14 @@
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)
- goto bugout;
+ if ((ps->hpmud_handle = dlopen("libhpmud.so", RTLD_LAZY|RTLD_GLOBAL)) == NULL)
+ {
+ if ((ps->hpmud_handle = dlopen("libhpmud.so.0", RTLD_LAZY|RTLD_GLOBAL)) == NULL)
+ {
+ BUG("unable to load restricted library: %s\n", dlerror());
+ goto bugout;
+ }
+ }
/* Load math library manually with symbols exported (Ubuntu 8.04). Otherwise the plugin will not find it. */
if ((ps->math_handle = load_library("libm.so")) == NULL)
--- a/scan/sane/soap.c
+++ b/scan/sane/soap.c
@@ -68,8 +68,14 @@
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)
- goto bugout;
+ if ((ps->hpmud_handle = dlopen("libhpmud.so", RTLD_LAZY|RTLD_GLOBAL)) == NULL)
+ {
+ if ((ps->hpmud_handle = dlopen("libhpmud.so.0", RTLD_LAZY|RTLD_GLOBAL)) == NULL)
+ {
+ BUG("unable to load restricted library: %s\n", dlerror());
+ goto bugout;
+ }
+ }
/* Load math library manually with symbols exported (Ubuntu 8.04). Otherwise the plugin will not find it. */
if ((ps->math_handle = load_library("libm.so")) == NULL)
--- a/scan/sane/soapht.c
+++ b/scan/sane/soapht.c
@@ -62,8 +62,14 @@
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)
- goto bugout;
+ if ((ps->hpmud_handle = dlopen("libhpmud.so", RTLD_LAZY|RTLD_GLOBAL)) == NULL)
+ {
+ if ((ps->hpmud_handle = dlopen("libhpmud.so.0", RTLD_LAZY|RTLD_GLOBAL)) == NULL)
+ {
+ BUG("unable to load restricted library: %s\n", dlerror());
+ goto bugout;
+ }
+ }
/* Load math library manually with symbols exported (Ubuntu 8.04). Otherwise the plugin will not find it. */
if ((ps->math_handle = load_library("libm.so")) == NULL)