0
|
1 |
#!/usr/bin/sh
|
|
2 |
#
|
|
3 |
# CDDL HEADER START
|
|
4 |
#
|
|
5 |
# The contents of this file are subject to the terms of the
|
|
6 |
# Common Development and Distribution License (the "License").
|
|
7 |
# You may not use this file except in compliance with the License.
|
|
8 |
#
|
|
9 |
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
|
10 |
# or http://www.opensolaris.org/os/licensing.
|
|
11 |
# See the License for the specific language governing permissions
|
|
12 |
# and limitations under the License.
|
|
13 |
#
|
|
14 |
# When distributing Covered Code, include this CDDL HEADER in each
|
|
15 |
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
|
16 |
# If applicable, add the following below this CDDL HEADER, with the
|
|
17 |
# fields enclosed by brackets "[]" replaced with your own identifying
|
|
18 |
# information: Portions Copyright [yyyy] [name of copyright owner]
|
|
19 |
#
|
|
20 |
# CDDL HEADER END
|
|
21 |
#
|
|
22 |
#
|
|
23 |
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
|
|
24 |
# Use is subject to license terms.
|
|
25 |
#
|
|
26 |
#ident "@(#)findunsupported.sh 1.2 08/09/23 SMI"
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
# Find the PPD files delivered by foomatic that Sun does not support.
|
|
31 |
# There are two reasons for non-support:
|
|
32 |
#
|
|
33 |
# 1. license/patent issues with the driver: foo2zjs
|
|
34 |
# 2. The driver used by the PPD file must be brought down
|
|
35 |
# and compiled and Sun has not chosen to do so.
|
|
36 |
#
|
|
37 |
# The unsupported PPD file should be listed in /tmp/ppdunsupported for review.
|
|
38 |
# The catchall file, /tmp/ppdsnomatch, should be empty. If not, a new case
|
|
39 |
# is needed in this script. The other files are there for debugging purposes.
|
|
40 |
#
|
|
41 |
# This is not part of the build process as the resulting file, ppdunsupported,
|
|
42 |
# should be reviewed.
|
|
43 |
|
|
44 |
# Notes:
|
|
45 |
# drivers come in several flavors: gs built in, gs uniprint, postscript,
|
|
46 |
# hpijs, and then the several other drivers.
|
|
47 |
# Drivers are noted in many PPD files with driverType. To sort these, look
|
|
48 |
# for: driverType G/GhostScript built-in:
|
|
49 |
# driverType U/GhostScript Uniprint:
|
|
50 |
# driverType F/Filter: ""
|
|
51 |
# Drivers are also noted in the name of the ppd file. This is used
|
|
52 |
# to cull out postscript, hpijs, and pxlmono . These do not reliably
|
|
53 |
# use driverType. note: pxlmono driver is a gs built-in but many of the
|
|
54 |
# ppd files that use this driver do not utilize the driverType line.
|
|
55 |
# driverType I/IJS: "" is not reliable for hpijs as not used in many ppds.
|
|
56 |
|
|
57 |
# driverType F/Filter: "" denotes ppd files that use GhostScript and
|
|
58 |
# then pipe that output to one or more other drivers. These will only be
|
|
59 |
# supported if Sun compiles and delivers these drivers.
|
|
60 |
|
|
61 |
VER=foomatic-filters-ppds-20080818
|
|
62 |
|
|
63 |
if [ -f ${SRC}/cmd/foomatic-ppd/ppdunsupported ]; then
|
|
64 |
/bin/rm ${SRC}/cmd/foomatic-ppd/ppdunsupported
|
|
65 |
fi
|
|
66 |
if [ -f ${SRC}/cmd/foomatic-ppd/ppdsnomatch ]; then
|
|
67 |
/bin/rm ${SRC}/cmd/foomatic-ppd/ppdsnomatch
|
|
68 |
fi
|
|
69 |
if [ -f ${SRC}/cmd/foomatic-ppd/ppdsupported ]; then
|
|
70 |
/bin/rm ${SRC}/cmd/foomatic-ppd/ppdsupported
|
|
71 |
fi
|
|
72 |
|
|
73 |
cd $VER/share/ppd
|
|
74 |
|
|
75 |
for i in *
|
|
76 |
do
|
|
77 |
cd $i
|
|
78 |
for j in *
|
|
79 |
do
|
|
80 |
# The following cases pull out supported drivers
|
|
81 |
ls $j | grep Postscript > /dev/null
|
|
82 |
if [ $? = 0 ]; then
|
|
83 |
#echo $j >> /tmp/ppdps
|
|
84 |
echo $j >> ${SRC}/cmd/foomatic-ppd/ppdsupported
|
|
85 |
continue
|
|
86 |
fi
|
|
87 |
|
|
88 |
grep "driverType G/GhostScript built-in: """ $j >> /dev/null
|
|
89 |
if [ $? = 0 ];
|
|
90 |
then
|
|
91 |
#echo $j >> /tmp/ppdsgsbuiltin
|
|
92 |
echo $j >> ${SRC}/cmd/foomatic-ppd/ppdsupported
|
|
93 |
continue
|
|
94 |
fi
|
|
95 |
|
|
96 |
grep "driverType U/GhostScript Uniprint: """ $j >> /dev/null
|
|
97 |
if [ $? = 0 ];
|
|
98 |
then
|
|
99 |
#echo $j >> /tmp/ppdgsuniprint
|
|
100 |
echo $j >> ${SRC}/cmd/foomatic-ppd/ppdsupported
|
|
101 |
continue
|
|
102 |
fi
|
|
103 |
|
|
104 |
ls $j | grep hpijs > /dev/null
|
|
105 |
if [ $? = 0 ];
|
|
106 |
then
|
|
107 |
#echo $j >> /tmp/ppdijs
|
|
108 |
# HPLIP (hpijs) supplies it's own Foomatic PPD files
|
|
109 |
echo $j >> ${SRC}/cmd/foomatic-ppd/ppdunsupported
|
|
110 |
continue
|
|
111 |
fi
|
|
112 |
|
|
113 |
ls $j | grep pxlmono > /dev/null
|
|
114 |
if [ $? = 0 ];
|
|
115 |
then
|
|
116 |
#echo $j >> /tmp/pxlmono
|
|
117 |
echo $j >> ${SRC}/cmd/foomatic-ppd/ppdsupported
|
|
118 |
continue
|
|
119 |
fi
|
|
120 |
|
|
121 |
# These are the unsupported printers unless
|
|
122 |
# we build and deliver the drivers
|
|
123 |
grep "driverType F/Filter: """ $j >> /dev/null
|
|
124 |
if [ $? = 0 ];
|
|
125 |
then
|
|
126 |
echo $j >> ${SRC}/cmd/foomatic-ppd/ppdunsupported
|
|
127 |
continue
|
|
128 |
fi
|
|
129 |
|
|
130 |
# No match : this should be empty
|
|
131 |
echo $j >> ${SRC}/cmd/foomatic-ppd/ppdunsupported/ppdsnomatch
|
|
132 |
done
|
|
133 |
cd ..
|
|
134 |
done
|
|
135 |
|
|
136 |
cd ../../..
|
|
137 |
|