diff options
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/cmd/print/scripts/getppdfile | 22 | ||||
-rw-r--r-- | usr/src/cmd/print/scripts/ppdfilename2mmp | 9 |
2 files changed, 21 insertions, 10 deletions
diff --git a/usr/src/cmd/print/scripts/getppdfile b/usr/src/cmd/print/scripts/getppdfile index b299bf25c6..b1135e2544 100644 --- a/usr/src/cmd/print/scripts/getppdfile +++ b/usr/src/cmd/print/scripts/getppdfile @@ -23,12 +23,15 @@ # # ident "%Z%%M% %I% %E% SMI" # -# Copyright 2004 Sun Microsystems, Inc. All rights reserved. +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # -# Get the path/filename for this ppd NickName +# Get the path/ppdfilename for this ppd NickName +# Input: +# make: model: ppd: +# PrintersRus: ABC Model 1234: Foomatic/Postscript (recommended): # if [[ $# -lt 3 ]]; then @@ -36,14 +39,17 @@ if [[ $# -lt 3 ]]; then fi if [[ -f /usr/lib/lp/model/ppd/ppdcache ]]; then - typeset make=$1 - shift - modelppd=$* - typeset model=$(echo $modelppd | nawk '{FS=":"; print $1}') - typeset ppd=$(echo $modelppd | nawk '{FS=":"; print $2}' | + typeset make=$(echo $* | /usr/bin/nawk '{FS=":"; print $1}') + # strip leading blanks + typeset model=$(echo $* | /usr/bin/nawk '{FS=":"; print $2}' | + sed -e 's/^[ ]*//') + typeset ppd=$(echo $* | /usr/bin/nawk '{FS=":"; print $3}' | sed -e 's/^[ ]*//') - /bin/grep ^$1 /usr/lib/lp/model/ppd/ppdcache | + # Do not use ":" with $make. printmgr collapses manufacturer name + # to first word, ie PrintersRus and PrintersRus International become + # PrintersRus + /bin/grep "${make}" /usr/lib/lp/model/ppd/ppdcache | /bin/grep "${model}:" | /bin/grep "${ppd}:" | nawk '{FS=":"; print $4}' diff --git a/usr/src/cmd/print/scripts/ppdfilename2mmp b/usr/src/cmd/print/scripts/ppdfilename2mmp index 3338f1808a..9618678d4d 100644 --- a/usr/src/cmd/print/scripts/ppdfilename2mmp +++ b/usr/src/cmd/print/scripts/ppdfilename2mmp @@ -23,7 +23,7 @@ # # ident "%Z%%M% %I% %E% SMI" # -# Copyright 2005 Sun Microsystems, Inc. All rights reserved. +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -71,8 +71,13 @@ if [[ -f /usr/lib/lp/model/ppd/ppdcache ]]; then if [[ -z "$ppdfile" ]]; then exit 1 else + # Use only first word in manufacturer entry echo $ppdfile | - nawk '{FS=":"; print $1; print $2; print $3}' + nawk '{FS=":"; print $1}' | + nawk '{print $1}' + + echo $ppdfile | + nawk '{FS=":"; print $2; print $3}' exit 0 fi fi |