summaryrefslogtreecommitdiff
path: root/print/papersize/files
diff options
context:
space:
mode:
authorross <ross@pkgsrc.org>2002-07-30 00:57:23 +0000
committerross <ross@pkgsrc.org>2002-07-30 00:57:23 +0000
commit1dbf878580b99622864e8d97a71aa8935a1d1a84 (patch)
treeaa9408034464586e5caaaf340bcc07c227c6e8df /print/papersize/files
parent93c8ef6a619f1615cc1237d50b315207a5873df3 (diff)
downloadpkgsrc-1dbf878580b99622864e8d97a71aa8935a1d1a84.tar.gz
make the tests for file existence actually work
now at 1.0.4
Diffstat (limited to 'print/papersize/files')
-rw-r--r--print/papersize/files/getpapersize12
-rw-r--r--print/papersize/files/setpapersize14
2 files changed, 13 insertions, 13 deletions
diff --git a/print/papersize/files/getpapersize b/print/papersize/files/getpapersize
index 67cf19cf246..c07456f6bb5 100644
--- a/print/papersize/files/getpapersize
+++ b/print/papersize/files/getpapersize
@@ -1,6 +1,6 @@
#! /bin/sh
#
-# $NetBSD: getpapersize,v 1.4 2002/07/05 23:24:20 wiz Exp $
+# $NetBSD: getpapersize,v 1.5 2002/07/30 00:57:24 ross Exp $
#
# Small shell script to show the default papersize for packages
#
@@ -16,28 +16,28 @@ while [ $# -gt 0 ]; do
case $1 in
a2ps)
f=@localbase@/etc/a2ps-site.cfg
- if [ -e $f ]; then
+ if [ -e "$f" ]; then
echo -n "$1 has default papersize: "
awk '/^Options: --medium=/ { gsub(".*=", "", $0); print $0; }' $f
fi
;;
ddd)
f=@x11prefix@/lib/X11/app-defaults/Ddd
- if [ -e $f ]; then
+ if [ -e "$f" ]; then
echo -n "$1 has default papersize: "
awk '/^@Ddd\*paperSize: / { gsub(".*:", "", $0); print $0; }' $f
fi
;;
enscript)
f=@localbase@/etc/enscript.cfg
- if [ -e $f ]; then
+ if [ -e "$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 [ -e $f ]; then
+ if [ -e "$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
@@ -62,7 +62,7 @@ while [ $# -gt 0 ]; do
;;
psutils)
f=@localbase@/etc/psutils.cfg
- if [ -e $f ]; then
+ if [ -e "$f" ]; then
echo -n "$1 has default papersize: "
awk '/^PAPERSIZE=/ { gsub(".*=", "", $0); print $0; }' $f
fi
diff --git a/print/papersize/files/setpapersize b/print/papersize/files/setpapersize
index 010484c27e1..053d3ed7b18 100644
--- a/print/papersize/files/setpapersize
+++ b/print/papersize/files/setpapersize
@@ -1,6 +1,6 @@
#! /bin/sh
#
-# $NetBSD: setpapersize,v 1.5 2002/07/05 23:24:20 wiz Exp $
+# $NetBSD: setpapersize,v 1.6 2002/07/30 00:57:24 ross Exp $
#
# Small shell script to set the default papersize for packages
#
@@ -47,7 +47,7 @@ while [ $# -gt 0 ]; do
case $1 in
a2ps)
a2psfile=@localbase@/etc/a2ps-site.cfg
- if [ -e $a2psfile ]; then
+ if [ -e "$a2psfile" ]; then
mv $a2psfile $a2psfile.old
sed -e 's|^Options: --medium=.*|Options: --medium='$papersize'|' $a2psfile.old > $a2psfile && rm $a2psfile.old
echo "Set $1 package default paper size to $papersize in $a2psfile"
@@ -55,7 +55,7 @@ while [ $# -gt 0 ]; do
;;
ddd)
dddfile=@x11prefix@/lib/X11/app-defaults/Ddd
- if [ -e $dddfile ]; then
+ if [ -e "$dddfile" ]; then
mv $dddfile $dddfile.old
sed -e 's|@Ddd@\*paperSize:.*|@Ddd@*paperSize: '$dimensions'|' $dddfile.old > $dddfile && rm $dddfile.old
echo "Set $1 package default paper size to $papersize in $dddfile"
@@ -63,7 +63,7 @@ while [ $# -gt 0 ]; do
;;
enscript)
enscriptfile=@localbase@/etc/enscript.cfg
- if [ -e $enscriptfile ]; then
+ if [ -e "$enscriptfile" ]; then
mv $enscriptfile $enscriptfile.old
sed -e 's|^DefaultMedia:.*|DefaultMedia: '$papersize'|' $enscriptfile.old > $enscriptfile && rm $enscriptfile.old
echo "Set $1 package default paper size to $papersize in $enscriptfile"
@@ -71,7 +71,7 @@ while [ $# -gt 0 ]; do
;;
ghostscript)
ghostscriptfile=`ls @localbase@/share/ghostscript/*/lib/gs_init.ps 2>/dev/null | tail -1`
- if [ -e $ghostscriptfile ]; then
+ if [ -e "$ghostscriptfile" ]; then
mv $ghostscriptfile $ghostscriptfile.old
sed -e '/^% Optionally choose a default paper size other than U.S. letter.$/N' -e 's/^\(% Optionally.*\n\)[%[:space:]]*(.*\() \/PAPERSIZE where.*\)$/\1('$lowpaper'\2/' $ghostscriptfile.old > $ghostscriptfile && rm $ghostscriptfile.old
echo "Set $1 package default paper size to $papersize in $ghostscriptfile"
@@ -79,7 +79,7 @@ while [ $# -gt 0 ]; do
;;
magicfilter)
magicdir=@localbase@/libexec/magicfilter
- if [ -e $magicdir ]; then
+ if [ -e "$magicdir" ]; then
for f in $magicdir/*-filter; do
mv $f $f.old
sed -e 's|-sPAPERSIZE=[a-zA-Z0-9_]*|-sPAPERSIZE='$lowpaper'|' $f.old > $f && rm $f.old
@@ -90,7 +90,7 @@ while [ $# -gt 0 ]; do
;;
psutils)
psutilsfile=@localbase@/etc/psutils.cfg
- if [ -e $psutilsfile ]; then
+ if [ -e "$psutilsfile" ]; then
mv $psutilsfile $psutilsfile.old
sed -e 's|^PAPERSIZE.*|PAPERSIZE='$lowpaper'|' $psutilsfile.old > $psutilsfile && rm $psutilsfile.old
echo "Set $1 package default paper size to $papersize in $psutilsfile"