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.
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.
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]
22 # Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 # Use is subject to license terms.
27 # get a list of the Models for this Model from the ppdcache
34 # <label>(<repository letter>): <driver>
35 # userlabel(U): Foomatic/hpijs (recommended)
36 # SUNWhpijs(S): Foomatic/hpijs (recommended)
44 # Return cache entries matching the specified make
45 # and model from the specified cache file.
52 for hit
in $
(/bin
/grep "${1}" "${3}" | /bin/grep ":${2}:")
58 if [[ $# -lt 2 ]]; then
62 cachefile
=/var
/lp
/ppd
/ppdcache
63 [[ -f $cachefile ]] ||
exit 1
73 # Ensure each ppdcache entry is processed as a single string
74 # otherwise it would be split up by spaces.
77 for pentry
in $
(ppd_make_entries
"${make}" "${model}" "${cachefile}")
80 ppdpath
="${pentry##*:}"
81 ppdlpath
="${ppdpath%/*/*}"
82 ppdlabel
="${ppdlpath##*/}"
83 driver
="${pentry%%:*}"
87 system
="${system}${ppdlabel}(S)${SEP}${driver}\n"
90 vendor
="${vendor}${ppdlabel}(V)${SEP}${driver}\n"
92 "/usr/local/share/ppd/"*)
93 admin
="${admin}${ppdlabel}(A)${SEP}${driver}\n"
96 user
="${user}${ppdlabel}(U)${SEP}${driver}\n"
103 echo "${user}${admin}${vendor}${system}"