Merge branch 'f14' into f15
This commit is contained in:
commit
ad385de82c
73
copy-deviceids.py
Executable file
73
copy-deviceids.py
Executable file
@ -0,0 +1,73 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
import os
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
if len (sys.argv) < 3:
|
||||||
|
print "Specify hpcups.drv and hpijs.drv pathnames"
|
||||||
|
sys.exit (1)
|
||||||
|
|
||||||
|
hpcups_drv = sys.argv[1]
|
||||||
|
hpijs_drv = sys.argv[2]
|
||||||
|
|
||||||
|
# Match e.g. Attribute "ShortNickName" "" "blah"
|
||||||
|
# and catch 'blah' in group 0
|
||||||
|
snn_re = re.compile ('^\s*Attribute\s+"ShortNickName"\s+""\s+"(.*)"\s*$')
|
||||||
|
|
||||||
|
# Match e.g. Attribute "1284DeviceID" "" "blah"
|
||||||
|
# and catch everything before 'blah' in group 0, 'blah' in group 1,
|
||||||
|
# trailing characters in group 2
|
||||||
|
devid_re = re.compile ('^(\s*Attribute\s+"1284DeviceID"\s+""\s+")(.*)("\s*)$')
|
||||||
|
|
||||||
|
# Match e.g. }
|
||||||
|
end_re = re.compile ('^\s*}')
|
||||||
|
|
||||||
|
devid_by_snn = dict()
|
||||||
|
|
||||||
|
hpcups_lines = file (hpcups_drv, "r").readlines ()
|
||||||
|
current_snn = None
|
||||||
|
for line in hpcups_lines:
|
||||||
|
if current_snn == None:
|
||||||
|
match = snn_re.match (line)
|
||||||
|
if match == None:
|
||||||
|
continue
|
||||||
|
|
||||||
|
current_snn = match.groups ()[0]
|
||||||
|
else:
|
||||||
|
match = devid_re.match (line)
|
||||||
|
if match:
|
||||||
|
devid_by_snn[current_snn] = match.groups ()[1]
|
||||||
|
continue
|
||||||
|
|
||||||
|
if end_re.match (line):
|
||||||
|
current_snn = None
|
||||||
|
|
||||||
|
print >>sys.stderr, \
|
||||||
|
"%d IEEE 1284 Device IDs loaded from %s" % (len (devid_by_snn),
|
||||||
|
os.path.basename (hpcups_drv))
|
||||||
|
|
||||||
|
replaced = 0
|
||||||
|
hpijs_lines = file (hpijs_drv, "r").readlines ()
|
||||||
|
current_snn = None
|
||||||
|
for line in hpijs_lines:
|
||||||
|
if current_snn == None:
|
||||||
|
match = snn_re.match (line)
|
||||||
|
if match:
|
||||||
|
current_snn = match.groups ()[0]
|
||||||
|
if current_snn.endswith (" hpijs"):
|
||||||
|
current_snn = current_snn[:-6]
|
||||||
|
else:
|
||||||
|
match = devid_re.match (line)
|
||||||
|
if match:
|
||||||
|
devid = devid_by_snn.get (current_snn)
|
||||||
|
if devid:
|
||||||
|
line = (match.groups ()[0] + devid + match.groups ()[2])
|
||||||
|
replaced += 1
|
||||||
|
|
||||||
|
if end_re.match (line):
|
||||||
|
current_snn = None
|
||||||
|
|
||||||
|
print line.rstrip ("\n")
|
||||||
|
|
||||||
|
print >>sys.stderr, \
|
||||||
|
"%d IEEE 1284 Device IDs replaced in %s" % (replaced,
|
||||||
|
os.path.basename (hpijs_drv))
|
File diff suppressed because it is too large
Load Diff
13
hplip.spec
13
hplip.spec
@ -1,7 +1,7 @@
|
|||||||
Summary: HP Linux Imaging and Printing Project
|
Summary: HP Linux Imaging and Printing Project
|
||||||
Name: hplip
|
Name: hplip
|
||||||
Version: 3.11.5
|
Version: 3.11.5
|
||||||
Release: 3%{?dist}
|
Release: 4%{?dist}
|
||||||
License: GPLv2+ and MIT
|
License: GPLv2+ and MIT
|
||||||
Group: System Environment/Daemons
|
Group: System Environment/Daemons
|
||||||
Conflicts: system-config-printer < 0.6.132
|
Conflicts: system-config-printer < 0.6.132
|
||||||
@ -13,6 +13,7 @@ Provides: xojpanel = 0.91
|
|||||||
Url: http://hplip.sourceforge.net/
|
Url: http://hplip.sourceforge.net/
|
||||||
Source0: http://kent.dl.sourceforge.net/sourceforge/hplip/%{name}-%{version}.tar.gz
|
Source0: http://kent.dl.sourceforge.net/sourceforge/hplip/%{name}-%{version}.tar.gz
|
||||||
Source1: hpcups-update-ppds.sh
|
Source1: hpcups-update-ppds.sh
|
||||||
|
Source2: copy-deviceids.py
|
||||||
Patch1: hplip-pstotiff-is-rubbish.patch
|
Patch1: hplip-pstotiff-is-rubbish.patch
|
||||||
Patch2: hplip-strstr-const.patch
|
Patch2: hplip-strstr-const.patch
|
||||||
Patch3: hplip-ui-optional.patch
|
Patch3: hplip-ui-optional.patch
|
||||||
@ -172,7 +173,13 @@ rm -rf $RPM_BUILD_DIR/%{name}-%{version}
|
|||||||
# HP Color LaserJet CP2025dn (bug #651509).
|
# HP Color LaserJet CP2025dn (bug #651509).
|
||||||
# HP Color LaserJet CM4730 MFP (bug #658831).
|
# HP Color LaserJet CM4730 MFP (bug #658831).
|
||||||
# HP Color LaserJet CM3530 MFP (bug #659381).
|
# HP Color LaserJet CM3530 MFP (bug #659381).
|
||||||
|
# HP LaserJet Professional P1606dn (bug #708472).
|
||||||
%patch5 -p1 -b .deviceIDs-drv
|
%patch5 -p1 -b .deviceIDs-drv
|
||||||
|
chmod +x %{SOURCE2}
|
||||||
|
mv prnt/drv/hpijs.drv.in{,.deviceIDs-drv-hpijs}
|
||||||
|
%{SOURCE2} prnt/drv/hpcups.drv.in \
|
||||||
|
prnt/drv/hpijs.drv.in.deviceIDs-drv-hpijs \
|
||||||
|
> prnt/drv/hpijs.drv.in
|
||||||
|
|
||||||
# Stopped hpcups pointlessly trying to read spool files
|
# Stopped hpcups pointlessly trying to read spool files
|
||||||
# directly (bug #552572).
|
# directly (bug #552572).
|
||||||
@ -525,6 +532,10 @@ fi
|
|||||||
%postun libs -p /sbin/ldconfig
|
%postun libs -p /sbin/ldconfig
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Jun 28 2011 Tim Waugh <twaugh@redhat.com> 3.11.5-4
|
||||||
|
- Added Device ID for HP LaserJet Professional P1606dn (bug #708472).
|
||||||
|
- Update IEEE 1284 Device IDs in hpijs.drv from hpcups.drv.
|
||||||
|
|
||||||
* Fri Jun 10 2011 Tim Waugh <twaugh@redhat.com> 3.11.5-3
|
* Fri Jun 10 2011 Tim Waugh <twaugh@redhat.com> 3.11.5-3
|
||||||
- Fix building against CUPS 1.5.
|
- Fix building against CUPS 1.5.
|
||||||
- Re-create installed hpcups PPDs unconditionally (bug #712241).
|
- Re-create installed hpcups PPDs unconditionally (bug #712241).
|
||||||
|
Loading…
Reference in New Issue
Block a user