pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/print/papersize Add support for gv to getpapersize and...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/7f96c15ba1a0
branches:  trunk
changeset: 460000:7f96c15ba1a0
user:      reed <reed%pkgsrc.org@localhost>
date:      Fri Aug 15 12:51:38 2003 +0000

description:
Add support for gv to getpapersize and setpapersize.
And only gets or sets if config file size is greater than zero.
(This is my PR #21641.)

diffstat:

 print/papersize/Makefile             |   4 ++--
 print/papersize/files/getpapersize   |  23 +++++++++++++++--------
 print/papersize/files/getpapersize.1 |   4 ++--
 print/papersize/files/setpapersize   |  24 ++++++++++++++++--------
 print/papersize/files/setpapersize.1 |   4 ++--
 5 files changed, 37 insertions(+), 22 deletions(-)

diffs (209 lines):

diff -r 551e8158c37e -r 7f96c15ba1a0 print/papersize/Makefile
--- a/print/papersize/Makefile  Fri Aug 15 11:21:52 2003 +0000
+++ b/print/papersize/Makefile  Fri Aug 15 12:51:38 2003 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.13 2003/07/17 22:52:36 grant Exp $
+# $NetBSD: Makefile,v 1.14 2003/08/15 12:51:38 reed Exp $
 #
 
-DISTNAME=      papersize-1.0.5
+DISTNAME=      papersize-1.0.6
 WRKSRC=                ${WRKDIR}
 CATEGORIES=    print
 MASTER_SITES=  # empty
diff -r 551e8158c37e -r 7f96c15ba1a0 print/papersize/files/getpapersize
--- a/print/papersize/files/getpapersize        Fri Aug 15 11:21:52 2003 +0000
+++ b/print/papersize/files/getpapersize        Fri Aug 15 12:51:38 2003 +0000
@@ -1,12 +1,12 @@
 #!@SH@
 #
-# $NetBSD: getpapersize,v 1.6 2003/04/22 02:30:48 sommerfeld Exp $
+# $NetBSD: getpapersize,v 1.7 2003/08/15 12:51:39 reed Exp $
 #
 # Small shell script to show the default papersize for packages
 #
 
 if [ $# -eq 0 ]; then
-       pkgs="a2ps ddd enscript ghostscript magicfilter psutils";
+       pkgs="a2ps ddd enscript ghostscript gv magicfilter psutils";
 else 
        pkgs=$@
 fi
@@ -16,28 +16,28 @@
        case $1 in
        a2ps)
                f=@LOCALBASE@/etc/a2ps-site.cfg
-               if [ -e "$f" ]; then
+               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 [ -e "$f" ]; then
+               if [ -s "$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 [ -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 [ -e "$f" ]; then
+               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
@@ -47,9 +47,16 @@
                        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
+               ;;
        magicfilter)
                magicdir=@LOCALBASE@/libexec/magicfilter
-               if [ -e $magicdir ]; then
+               if [ -s $magicdir ]; then
                        done=0
                        for f in $magicdir/*-filter; do
                                if [ $done -eq 0 ]; then
@@ -62,7 +69,7 @@
                ;;
        psutils)
                f=@LOCALBASE@/etc/psutils.cfg
-               if [ -e "$f" ]; then
+               if [ -s "$f" ]; then
                        @ECHO@ -n "$1 has default papersize: "
                        @AWK@ '/^PAPERSIZE=/ { gsub(".*=", "", $0); print $0; }' $f
                fi
diff -r 551e8158c37e -r 7f96c15ba1a0 print/papersize/files/getpapersize.1
--- a/print/papersize/files/getpapersize.1      Fri Aug 15 11:21:52 2003 +0000
+++ b/print/papersize/files/getpapersize.1      Fri Aug 15 12:51:38 2003 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: getpapersize.1,v 1.3 2002/07/05 23:24:20 wiz Exp $
+.\" $NetBSD: getpapersize.1,v 1.4 2003/08/15 12:51:39 reed Exp $
 .Dd November 9, 1998
 .Dt GETPAPERSIZE 1
 .Os
@@ -13,7 +13,7 @@
 .Nm
 utility shows the default paper size for a number of packages.
 At the present time, these are the a2ps, ddd, enscript, ghostscript,
-magicfilter, and psutils packages.
+gv, magicfilter, and psutils packages.
 If no package argument is given, all packages are assumed.
 The
 .Xr setpapersize 1
diff -r 551e8158c37e -r 7f96c15ba1a0 print/papersize/files/setpapersize
--- a/print/papersize/files/setpapersize        Fri Aug 15 11:21:52 2003 +0000
+++ b/print/papersize/files/setpapersize        Fri Aug 15 12:51:38 2003 +0000
@@ -1,6 +1,6 @@
 #!@SH@
 #
-# $NetBSD: setpapersize,v 1.7 2003/04/22 02:30:49 sommerfeld Exp $
+# $NetBSD: setpapersize,v 1.8 2003/08/15 12:51:39 reed Exp $
 #
 # Small shell script to set the default papersize for packages
 #
@@ -37,7 +37,7 @@
 lowpaper=`@ECHO@ $papersize | @TR@ '[A-Z]' '[a-z]'`
 
 if [ $# -eq 0 ]; then
-       pkgs="a2ps ddd enscript ghostscript magicfilter psutils";
+       pkgs="a2ps ddd enscript ghostscript gv magicfilter psutils";
 else 
        pkgs=$@
 fi
@@ -47,7 +47,7 @@
        case $1 in
        a2ps)
                a2psfile=@LOCALBASE@/etc/a2ps-site.cfg
-               if [ -e "$a2psfile" ]; then
+               if [ -s "$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 @@
                ;;
        ddd)
                dddfile=@X11BASE@/lib/X11/app-defaults/Ddd
-               if [ -e "$dddfile" ]; then
+               if [ -s "$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 @@
                ;;
        enscript)
                enscriptfile=@LOCALBASE@/etc/enscript.cfg
-               if [ -e "$enscriptfile" ]; then
+               if [ -s "$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,15 +71,23 @@
                ;;
        ghostscript)
                ghostscriptfile=`ls @LOCALBASE@/share/ghostscript/*/lib/gs_init.ps 2>/dev/null | tail -1`
-               if [ -e "$ghostscriptfile" ]; then
+               if [ -s "$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"
                fi
                ;;
+       gv)
+               gvfile=@X11BASE@/lib/X11/app-defaults/GV
+               if [ -s "$gvfile" ]; then
+                       @MV@ $gvfile $gvfile.old
+                       @SED@ -e 's|^GV.fallbackPageMedia:.*|GV.fallbackPageMedia:      '$papersize'|' $gvfile.old > $gvfile && @RM@ $gvfile.old
+                       @ECHO@ "Set $1 package default paper size to $papersize in $gvfile"
+               fi
+               ;;
        magicfilter)
                magicdir=@LOCALBASE@/libexec/magicfilter
-               if [ -e "$magicdir" ]; then
+               if [ -s "$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 +98,7 @@
                ;;
        psutils)
                psutilsfile=@LOCALBASE@/etc/psutils.cfg
-               if [ -e "$psutilsfile" ]; then
+               if [ -s "$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"
diff -r 551e8158c37e -r 7f96c15ba1a0 print/papersize/files/setpapersize.1
--- a/print/papersize/files/setpapersize.1      Fri Aug 15 11:21:52 2003 +0000
+++ b/print/papersize/files/setpapersize.1      Fri Aug 15 12:51:38 2003 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: setpapersize.1,v 1.3 2002/07/05 23:24:20 wiz Exp $
+.\" $NetBSD: setpapersize.1,v 1.4 2003/08/15 12:51:39 reed Exp $
 .Dd November 9, 1998
 .Dt SETPAPERSIZE 1
 .Os
@@ -14,7 +14,7 @@
 .Nm
 utility sets the default paper size for a number of packages.
 At the present time, these are the a2ps, ddd, enscript, ghostscript,
-magicfilter and psutils packages.
+gv, magicfilter and psutils packages.
 If no package argument is given, all packages are assumed.
 The
 .Ar PAPERSIZE



Home | Main Index | Thread Index | Old Index