File make.catalog of Package ghostscript-library
#!/bin/bash
if test -x sobin/gsc ; then
gs=sobin/gsc
else
gs=bin/gs
fi
tab="$(echo -en '\t')"
devices="$($gs -h 2>&1 | sed -n '/^Available devices:/,/Search path:/p' |\
grep -vE '(Available devices:|Search path:)' | tr ' ' '\n' | sort -u)"
descr="$(cat {src,contrib}/*.mak |\
sed -n "/Catalog/,/End of catalog/ {
:join
$!N
s/\n#\($tab\|[ ]\{7\}\)\($tab\|[ ]\{8,\}\)\{1,\}/ /
t join
/^#\( [\*\+]\($tab\|[ ]\{5\}\)\|\($tab\|[ ]\{7\}\)\)/ {
s/^#\( [\*\+]\($tab\|[ ]\{5\}\)\|\($tab\|[ ]\{7\}\)\)//
s/^None.*//
s@^uniprint/:.*@@
s/^(\([^[:space:]]\+\))/\1/
P
}
D
}" | grep -vE '^$' | sort -u -b -k 1,1 )"
for d in $devices; do
while read first rest; do
test -n "$first" && printf '%-15s %s\n' "$first" "$rest"
done < <(echo "$descr" | grep -E "^$d[ $tab]")
done
#for ppd in /usr/share/cups/model/manufacturer-PPDs/hplip/*.ppd.gz; do
# m=$(sed -n "/^\*Product: */{ s/^.*:[ ${tab}]*\"(\([^()]*\))\"/\1/p; }" < <(zcat $ppd))
# printf "%-15s %s\n" "'$m'" "ijs: HP printer printer driver for $m"
#done
bzcat hpijs.list.bz2
for m in 500 500C 510 520 540 550C 560C 850C 855C unspec ; do
printf '%-15s %s\n' $m "hpdj: H-P printer type $m"
done
while read first rest; do
test -n "$first" && printf '%-15s %s\n' "$first" "uniprint: $rest"
done < <(grep -e '-supModel="' lib/*.upp | sed 's@:-supModel="@ @g;s@"$@@g;s@lib/@@g')
n=0
while read first rest; do
if test "$first" = "_" ; then
test $n -gt 0 && break
test $n -eq 0 && n=1
continue
fi
test -n "$first" && printf '%-15s %s\n' "$first" "stp: $rest"
done < <(sed -n '/^_/,/^_/{s/\\//g;p;}' < man/gs-stp.1)
find Omni/ -maxdepth 2 -name 'Device List' -and -not -path '*XMLParser*' -and -not -path '*test*' -exec cat {} \; | \
while read m ; do
case "$m" in
\#*|"") continue ;;
esac
printf '%-25s %s\n' "`echo $m | sed 's/[ +-]/_/g'`" "omni: $m"
done