Use the form of import of PIL that is pillow compatible (bug #895266).

This commit is contained in:
Jiri Popelka 2013-01-15 13:18:26 +01:00
parent 8b254142d4
commit 0a6a5c877d
2 changed files with 47 additions and 1 deletions

39
hplip-pillow.patch Normal file
View File

@ -0,0 +1,39 @@
Index: hplip-3.12.11/installer/core_install.py
===================================================================
--- hplip-3.12.11.orig/installer/core_install.py
+++ hplip-3.12.11/installer/core_install.py
@@ -1100,7 +1100,7 @@ class CoreInstall(object):
def check_pil(self):
log.debug("Checking for PIL...")
try:
- import Image
+ from PIL import Image
return True
except ImportError:
return False
Index: hplip-3.12.11/installer/dcheck.py
===================================================================
--- hplip-3.12.11.orig/installer/dcheck.py
+++ hplip-3.12.11/installer/dcheck.py
@@ -361,7 +361,7 @@ def get_xsane_version():
def get_pil_version():
try:
- import Image
+ from PIL import Image
except ImportError:
return '-'
else:
Index: hplip-3.12.11/scan.py
===================================================================
--- hplip-3.12.11.orig/scan.py
+++ hplip-3.12.11/scan.py
@@ -589,7 +589,7 @@ try:
from base import subproc as subprocess
try:
- import Image
+ from PIL import Image
except ImportError:
log.error("%s requires the Python Imaging Library (PIL). Exiting." % __mod__)
sys.exit(1)

View File

@ -1,7 +1,7 @@
Summary: HP Linux Imaging and Printing Project
Name: hplip
Version: 3.12.11
Release: 2%{?dist}
Release: 3%{?dist}
License: GPLv2+ and MIT
Group: System Environment/Daemons
@ -28,6 +28,7 @@ Patch16: hplip-bad-low-ink-warning.patch
Patch17: hplip-deviceIDs-ppd.patch
Patch18: hplip-skip-blank-lines.patch
Patch19: hplip-dbglog-newline.patch
Patch20: hplip-pillow.patch
Patch21: hplip-ppd-ImageableArea.patch
Patch22: hplip-raw_deviceID-traceback.patch
Patch23: hplip-UnicodeDecodeError.patch
@ -250,6 +251,9 @@ done
# Added missing newline to string argument in dbglog() call (bug #585275).
%patch19 -p1 -b .dbglog-newline
# Use the form of import of PIL that is pillow compatible (bug #895266).
%patch20 -p1 -b .pillow
# Fix ImageableArea for Laserjet 8150/9000 (bug #596298).
for ppd_file in $(grep '^diff' %{PATCH21} | cut -d " " -f 4);
do
@ -529,6 +533,9 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop
%postun libs -p /sbin/ldconfig
%changelog
* Tue Jan 15 2013 Jiri Popelka <jpopelka@redhat.com> 3.12.11-3
- Use the form of import of PIL that is pillow compatible (bug #895266).
* Fri Dec 07 2012 Jiri Popelka <jpopelka@redhat.com> 3.12.11-2
- desktop file: remove deprecated Encoding key and Application category