From d0bc1ba9bf31c64ac97a06d08e857d2aab657715 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Fri, 26 Feb 2010 12:41:25 +0000 Subject: [PATCH] - 3.10.2. No longer need preferences-crash patch. - The pstotiff filter is rubbish so replace it (launchpad #528394). - Stopped hpcups pointlessly trying to read spool files directly (bug #552572). --- .cvsignore | 1 + hplip-3.10.2.tar.gz.asc | 7 ++++ hplip-3.9.12.tar.gz.asc | 7 ---- hplip-mucks-with-spooldir.patch | 30 +++++++++++++++++ hplip-pstotiff-is-rubbish.patch | 58 +++++++++++++++++++++++++++++++++ hplip.spec | 24 +++++++++++--- sources | 1 + 7 files changed, 116 insertions(+), 12 deletions(-) create mode 100644 hplip-3.10.2.tar.gz.asc delete mode 100644 hplip-3.9.12.tar.gz.asc create mode 100644 hplip-mucks-with-spooldir.patch create mode 100644 hplip-pstotiff-is-rubbish.patch diff --git a/.cvsignore b/.cvsignore index 21c6c76..9d80519 100644 --- a/.cvsignore +++ b/.cvsignore @@ -32,3 +32,4 @@ hplip-3.9.6b.tar.gz hplip-3.9.8.tar.gz hplip-3.9.10.tar.gz hplip-3.9.12.tar.gz +hplip-3.10.2.tar.gz diff --git a/hplip-3.10.2.tar.gz.asc b/hplip-3.10.2.tar.gz.asc new file mode 100644 index 0000000..a227003 --- /dev/null +++ b/hplip-3.10.2.tar.gz.asc @@ -0,0 +1,7 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.9 (GNU/Linux) + +iEYEABECAAYFAkuFslQACgkQc9dwzaWQR7mpowCgr3YlpISS+6eqBhwkTIdOhc3b +470An0hYImtLZznLX6oljo/gw4zCoqvh +=dMK4 +-----END PGP SIGNATURE----- diff --git a/hplip-3.9.12.tar.gz.asc b/hplip-3.9.12.tar.gz.asc deleted file mode 100644 index 36aaec5..0000000 --- a/hplip-3.9.12.tar.gz.asc +++ /dev/null @@ -1,7 +0,0 @@ ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.4.9 (GNU/Linux) - -iEYEABECAAYFAksn/zgACgkQc9dwzaWQR7nJUACgrL1YrF8ct7EEdAvDwhcsRHxi -Da4AnjHpD5VB3wwqYDEQp6Z0xGqDOhfO -=+b+Q ------END PGP SIGNATURE----- diff --git a/hplip-mucks-with-spooldir.patch b/hplip-mucks-with-spooldir.patch new file mode 100644 index 0000000..d110ce7 --- /dev/null +++ b/hplip-mucks-with-spooldir.patch @@ -0,0 +1,30 @@ +diff -up hplip-3.10.2/prnt/hpcups/HPCupsFilter.cpp.mucks-with-spooldir hplip-3.10.2/prnt/hpcups/HPCupsFilter.cpp +--- hplip-3.10.2/prnt/hpcups/HPCupsFilter.cpp.mucks-with-spooldir 2010-02-26 12:07:47.170265651 +0000 ++++ hplip-3.10.2/prnt/hpcups/HPCupsFilter.cpp 2010-02-26 12:09:13.647265807 +0000 +@@ -443,26 +443,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) { + dbglog("DEBUG: ppdOpenFile failed for %s\n", getenv("PPD")); diff --git a/hplip-pstotiff-is-rubbish.patch b/hplip-pstotiff-is-rubbish.patch new file mode 100644 index 0000000..9db74e2 --- /dev/null +++ b/hplip-pstotiff-is-rubbish.patch @@ -0,0 +1,58 @@ +diff -up hplip-3.10.2/fax/filters/pstotiff.pstotiff-is-rubbish hplip-3.10.2/fax/filters/pstotiff +--- hplip-3.10.2/fax/filters/pstotiff.pstotiff-is-rubbish 2010-02-26 12:05:42.883265245 +0000 ++++ hplip-3.10.2/fax/filters/pstotiff 2010-02-26 12:06:06.546266294 +0000 +@@ -1,43 +1,11 @@ +-#!/usr/bin/env python +- +-import os +-import os.path +-import time +-import sys +-import tempfile +- +-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 -dDEBUG -dNOPAUSE -dBATCH -dSAFER -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) +-#if exit_code != 0: +-# print("Ghostscript returned error (error code %d)!" % exit_code) +-# sys.exit(exit_code) +- +-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) +- 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 ++ ++gs -I/usr/share/cups/fonts -sDEVICE=tiffg4 -dNOPAUSE -dBATCH \ ++ -dSAFER -dPARANOIDSAFER \ ++ -dSHORTERRORS -dWRITESYSTEMDICT -dGHOSTSCRIPT \ ++ -sstdout=%stderr -sOutputFile=- "$IN" diff --git a/hplip.spec b/hplip.spec index 9a7880b..cbb7d97 100644 --- a/hplip.spec +++ b/hplip.spec @@ -1,7 +1,7 @@ Summary: HP Linux Imaging and Printing Project Name: hplip -Version: 3.9.12 -Release: 8%{?dist} +Version: 3.10.2 +Release: 1%{?dist} License: GPLv2+ and MIT Group: System Environment/Daemons Conflicts: system-config-printer < 0.6.132 @@ -13,11 +13,12 @@ Conflicts: selinux-policy < 3.0.3-3 Url: http://hplip.sourceforge.net/ Source0: http://kent.dl.sourceforge.net/sourceforge/hplip/%{name}-%{version}.tar.gz -Patch1: hplip-preferences-crash.patch +Patch1: hplip-pstotiff-is-rubbish.patch Patch2: hplip-strstr-const.patch Patch3: hplip-ui-optional.patch Patch4: hplip-no-asm.patch Patch5: hplip-device-ids.patch +Patch6: hplip-mucks-with-spooldir.patch Patch8: hplip-retry-open.patch Patch10: hplip-discovery-method.patch Patch11: hplip-device-reconnected.patch @@ -114,8 +115,8 @@ SANE driver for scanners in HP's multi-function devices (from HPOJ). rm -rf $RPM_BUILD_DIR/%{name}-%{version} %setup -q -# Fixed crash when using Preferences dialog (bug #555979). -%patch1 -p1 -b .preferences-crash +# The pstotiff filter is rubbish so replace it (launchpad #528394). +%patch1 -p1 -b .pstotiff-is-rubbish # Fix compilation. %patch2 -p1 -b .strstr-const @@ -129,6 +130,10 @@ rm -rf $RPM_BUILD_DIR/%{name}-%{version} # Corrected several IEEE 1284 Device IDs using foomatic data. %patch5 -p1 -b .device-ids +# Stopped hpcups pointlessly trying to read spool files +# directly (bug #552572). +%patch6 -p1 -b .mucks-with-spooldir + # Retry when connecting to device fails (bug #532112). %patch8 -p1 -b .retry-open @@ -208,6 +213,7 @@ rm -f %{buildroot}%{_datadir}/hplip/hpaio.desc rm -f %{buildroot}%{_datadir}/hplip/hplip-install rm -rf %{buildroot}%{_datadir}/hplip/install.* rm -f %{buildroot}%{_datadir}/hplip/hpijs.drv.in.template +rm -f %{buildroot}%{_datadir}/cups/mime/pstotiff.types # The systray applet doesn't work properly (displays icon as a # window), so don't ship the launcher yet. @@ -248,6 +254,8 @@ rm -rf %{buildroot} # CUPS serverbin directory. /usr/lib/cups/backend/hp /usr/lib/cups/backend/hpfax +/usr/lib/cups/filter/pstotiff +%{_datadir}/cups/mime/pstotiff.convs # Files %{_datadir}/hplip/align.py* %{_datadir}/hplip/clean.py* @@ -354,6 +362,12 @@ fi /usr/bin/update-desktop-database &>/dev/null ||: %changelog +* Fri Feb 26 2010 Tim Waugh - 3.10.2-1 +- 3.10.2. No longer need preferences-crash patch. +- The pstotiff filter is rubbish so replace it (launchpad #528394). +- Stopped hpcups pointlessly trying to read spool files + directly (bug #552572). + * Sat Feb 20 2010 Tim Waugh - 3.9.12-8 - Corrected several IEEE 1284 Device IDs using foomatic data (launchpad bug #523259). diff --git a/sources b/sources index 1c45967..373fe8a 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ 2b0906b4a57b437988829557ca62adfd hplip-3.9.12.tar.gz +4df6f16c47ae7edd015bf2cf5155f26f hplip-3.10.2.tar.gz