summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorschweikh <schweikh@FreeBSD.org>2003-05-31 21:02:50 +0000
committerschweikh <schweikh@FreeBSD.org>2003-05-31 21:02:50 +0000
commitb8e383ac78d433ff7d1ebfed1199723e6b20ba80 (patch)
treefad5159f7cf12261552c6be3e9ea71d33350821f /usr.bin
parentdc5393a5ef554e028789af02aca0face542fc3ef (diff)
downloadFreeBSD-src-b8e383ac78d433ff7d1ebfed1199723e6b20ba80.zip
FreeBSD-src-b8e383ac78d433ff7d1ebfed1199723e6b20ba80.tar.gz
Rewrite this csh program as a /bin/sh program. This appears to be
the last csh script needed for a buildworld. You should now be able to buildworld on a system that was compiled with NO_TCSH=true. Verified to produce the same result for the one file being generated during buildworld, share/doc/papers/kernmalloc/appendix.ms. Reviewed by: hackers@ MFC after: 2 weeks
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/vgrind/vgrind.sh206
1 files changed, 92 insertions, 114 deletions
diff --git a/usr.bin/vgrind/vgrind.sh b/usr.bin/vgrind/vgrind.sh
index 7b8c856..bfc2f1b 100644
--- a/usr.bin/vgrind/vgrind.sh
+++ b/usr.bin/vgrind/vgrind.sh
@@ -1,4 +1,4 @@
-#!/bin/csh -f
+#!/bin/sh
#
# Copyright (c) 1980, 1993
# The Regents of the University of California. All rights reserved.
@@ -36,122 +36,100 @@
# $FreeBSD$
#
-set voptions=
-set options=
-set files=
-set f=''
-set head=""
-set vf=/usr/libexec/vfontedpr
-set tm=/usr/share/tmac
-set postproc=psroff
-top:
-if ($#argv > 0) then
- switch ($1:q)
+voptions=""
+options=""
+files=""
+f=""
+head=""
+vf="/usr/libexec/vfontedpr"
+tm="/usr/share/tmac"
+postproc="psroff"
- case -f:
- set f='filter'
- set options = "$options $1:q"
+# Parse args
+while test $# -gt 0; do
+ case $1 in
+ -f)
+ f="filter"
+ options="$options -f"
+ ;;
+ -t)
+ voptions="$voptions -t"
+ ;;
+ -o*)
+ voptions="$voptions $1"
+ ;;
+ -W)
+ voptions="$voptions -W"
+ ;;
+ -d)
+ if test $# -lt 2; then
+ echo "$0: option $1 must have argument" >&2
+ exit 1
+ fi
+ options="$options $1 $2"
+ shift
+ ;;
+ -h)
+ if test $# -lt 2; then
+ echo "$0: option $1 must have argument" >&2
+ exit 1
+ fi
+ head="$2"
+ shift
+ ;;
+ -p)
+ if test $# -lt 2; then
+ echo "$0: option $1 must have argument" >&2
+ exit 1
+ fi
+ postproc="$2"
+ shift
+ ;;
+ -*)
+ options="$options $1"
+ ;;
+ *)
+ files="$files $1"
+ ;;
+ esac
shift
- goto top
+done
- case -t:
- set voptions = "$voptions -t"
- shift
- goto top
-
- case -o*:
- set voptions="$voptions $1:q"
- shift
- goto top
-
- case -W:
- set voptions = "$voptions -W"
- shift
- goto top
-
- case -d:
- if ($#argv < 2) then
- echo "vgrind: $1:q option must have argument"
- goto done
- else
- set options = ($options $1:q $2)
- shift
- shift
- goto top
- endif
-
- case -h:
- if ($#argv < 2) then
- echo "vgrind: $1:q option must have argument"
- goto done
- else
- set head="$2"
- shift
- shift
- goto top
- endif
-
- case -p:
- if ($#argv < 2) then
- echo "vgrind: $1:q option must have argument"
- goto done
+if test -r index; then
+ echo > nindex
+ for i in $files; do
+ # make up a sed delete command for filenames
+ # being careful about slashes.
+ echo "? $i ?d" | sed -e "s:/:\\/:g" -e "s:?:/:g" >> nindex
+ done
+ sed -f nindex index > xindex
+ if test "x$f" = xfilter; then
+ if test "x$head" != x; then
+ $vf $options -h "$head" $files
+ else
+ $vf $options $files
+ fi | cat $tm/tmac.vgrind -
else
- set postproc="$2"
- shift
- shift
- goto top
- endif
-
- case -*:
- set options = "$options $1:q"
- shift
- goto top
-
- default:
- set files = "$files $1:q"
- shift
- goto top
- endsw
-endif
-if (-r index) then
- echo > nindex
- foreach i ($files)
- # make up a sed delete command for filenames
- # being careful about slashes.
- echo "? $i ?d" | sed -e "s:/:\\/:g" -e "s:?:/:g" >> nindex
- end
- sed -f nindex index >xindex
- if ($f == 'filter') then
- if ("$head" != "") then
- $vf $options -h "$head" $files | cat $tm/tmac.vgrind -
- else
- $vf $options $files | cat $tm/tmac.vgrind -
- endif
- else
- if ("$head" != "") then
- $vf $options -h "$head" $files | \
- sh -c "$postproc -rx1 $voptions -i -mvgrind 2>> xindex"
- else
- $vf $options $files | \
- sh -c "$postproc -rx1 $voptions -i -mvgrind 2>> xindex"
- endif
- endif
- sort -df -k 1,2 xindex >index
- rm nindex xindex
+ if test "x$head" != x; then
+ $vf $options -h "$head" $files
+ else
+ $vf $options $files
+ fi | sh -c "$postproc -rx1 $voptions -i -mvgrind 2>> xindex"
+ fi
+ sort -df -k 1,2 xindex > index
+ rm nindex xindex
else
- if ($f == 'filter') then
- if ("$head" != "") then
- $vf $options -h "$head" $files | cat $tm/tmac.vgrind -
- else
- $vf $options $files | cat $tm/tmac.vgrind -
- endif
- else
- if ("$head" != "") then
- $vf $options -h "$head" $files | $postproc -i $voptions -mvgrind
+ if test "x$f" = xfilter; then
+ if test "x$head" != x; then
+ $vf $options -h "$head" $files
+ else
+ $vf $options $files
+ fi | cat $tm/tmac.vgrind -
else
- $vf $options $files | $postproc -i $voptions -mvgrind
- endif
- endif
-endif
-
-done:
+ if test "x$head" != x; then
+ $vf $options -h "$head" $files
+ else
+ $vf $options $files
+ fi | $postproc -i $voptions -mvgrind
+ fi
+fi
OpenPOWER on IntegriCloud