From 626402d0259f77742c8da5676eb4ad8f33020c8f Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Thu, 22 Nov 2012 13:34:59 +0000 Subject: [PATCH] Make 'hp-check' check for hpaio set-up correctly (bug #683007). Resolves: rhbz#683007 --- hplip-check.patch | 41 +++++++++++++++++++++++++++++++++++++++++ hplip.spec | 9 ++++++++- 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 hplip-check.patch diff --git a/hplip-check.patch b/hplip-check.patch new file mode 100644 index 0000000..1cd3b85 --- /dev/null +++ b/hplip-check.patch @@ -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): diff --git a/hplip.spec b/hplip.spec index 9105815..bc6e9a3 100644 --- a/hplip.spec +++ b/hplip.spec @@ -3,7 +3,7 @@ Summary: HP Linux Imaging and Printing Project Name: hplip Version: 3.12.10 -Release: 4.%{posttag}%{?dist} +Release: 5.%{posttag}%{?dist} License: GPLv2+ and MIT Group: System Environment/Daemons @@ -43,6 +43,7 @@ Patch29: hplip-makefile-chgrp.patch Patch30: hplip-hpaio-localonly.patch Patch31: hplip-ipp-accessors.patch Patch32: hplip-IEEE-1284-4.patch +Patch33: hplip-check.patch Requires(pre): /sbin/service Requires(post): /sbin/chkconfig @@ -301,6 +302,9 @@ done # Support IEEE 1284.4 protocol over USB (bug #858861). %patch32 -p1 -b .hplip-IEEE-1284-4 +# Various adjustments to make 'hp-check' run more smoothly (bug #683007). +%patch33 -p1 -b .check + sed -i.duplex-constraints \ -e 's,\(UIConstraints.* \*Duplex\),//\1,' \ prnt/drv/hpcups.drv.in @@ -530,6 +534,9 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop %postun libs -p /sbin/ldconfig %changelog +* Thu Nov 22 2012 Tim Waugh 3.12.10-5.a +- Make 'hp-check' check for hpaio set-up correctly (bug #683007). + * Wed Oct 17 2012 Tim Waugh 3.12.10-4.a - Some more CUPS filters using the wrong temporary directory (bug #865603).