blob: ca7e6f390ef0b403e6e84da80763192024ac9af7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
#!@SH@
#
# $NetBSD: getpapersize,v 1.9 2003/09/15 10:51:40 agc Exp $
#
# Small shell script to show the default papersize for packages
#
if [ $# -eq 0 ]; then
pkgs="a2ps ddd enscript ghostscript gv lout magicfilter psutils";
else
pkgs=$@
fi
set $pkgs
while [ $# -gt 0 ]; do
case $1 in
a2ps)
f=@PKG_SYSCONFDIR@/a2ps-site.cfg
if [ -s "$f" ]; then
@ECHO@ -n "$1 has default papersize: "
@AWK@ '/^Options: --medium=/ { gsub(".*=", "", $0); print $0; }' $f
fi
;;
ddd)
f=@X11BASE@/lib/X11/app-defaults/Ddd
if [ -s "$f" ]; then
@ECHO@ -n "$1 has default papersize: "
@AWK@ '/^@Ddd\*paperSize: / { gsub(".*:", "", $0); print $0; }' $f
fi
;;
enscript)
f=@PKG_SYSCONFDIR@/enscript.cfg
if [ -s "$f" ]; then
@ECHO@ -n "$1 has default papersize: "
@AWK@ '/^DefaultMedia:.*/ { gsub(".*:", "", $0); print $0; }' $f
fi
;;
ghostscript)
f=`ls @LOCALBASE@/share/ghostscript/*/lib/gs_init.ps 2>/dev/null | tail -1`
if [ -s "$f" ]; then
@ECHO@ -n "$1 has default papersize: "
gssize=`@SED@ -n -e '/^% Optionally choose a default paper size other than U.S. letter.$/N' -e 's/^% Optionally.*\n[[:space:]]*(\(.*\)) \/PAPERSIZE where.*$/\1/p' $f`
if [ -z "$gssize" ] ; then
@ECHO@ "(unknown)"
else
@ECHO@ $gssize
fi
fi
;;
gv)
f=@X11BASE@/lib/X11/app-defaults/GV
if [ -s "$f" ]; then
@ECHO@ -n "$1 has default papersize: "
@AWK@ '/^GV.fallbackPageMedia:/ { print $2; }' $f
fi
;;
lout)
f=@LOCALBASE@/share/lout/include/dsf
if [ -s "$f" ]; then
@ECHO@ -n "$1 has default papersize: "
@AWK@ '$1 == "named" && $2 == "@PageType" { print $4; }' $f
fi
;;
magicfilter)
magicdir=@LOCALBASE@/libexec/magicfilter
if [ -s $magicdir ]; then
done=0
for f in $magicdir/*-filter; do
if [ $done -eq 0 ]; then
@ECHO@ -n "$1 has default papersize: "
@GREP@ 'PAPERSIZE' $f | @SED@ -e 's|\(.*\)-sPAPERSIZE=\([a-zA-Z0-9_]*\)\(.*\)|\2|' | tail -n 1
done=1
fi
done
fi
;;
psutils)
f=@PKG_SYSCONFDIR@/psutils.cfg
if [ -s "$f" ]; then
@ECHO@ -n "$1 has default papersize: "
@AWK@ '/^PAPERSIZE=/ { gsub(".*=", "", $0); print $0; }' $f
fi
;;
*)
@ECHO@ "Warning: Package $1 not recognised"
;;
esac
shift 1
done
exit 0
|