home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
- # GAPS version 4.0
- # get and put system - by Nadav Har'El
- # vls: list versions in history
-
- VERSION=- # the version to stop on (- if to show all versions)
- XVERSION=
-
- for i
- do
- case $i in
- -[0-9]|-[0-9][0-9]|-[0-9][0-9][0-9])
- XVERSION=; VERSION=$i; continue;; # 1-999 versions
- -a) XVERSION=; VERSION=-; continue;;
- -v*) XVERSION=$i; continue;;
- *.H) ;;
- *) i=$i.H;;
- esac
- if test -r $i
- then
- # for each file we recalculate the numeric version from the
- # named version
- case $XVERSION in
- -v*) VERSION=`ver "\`expr \"$XVERSION\" : '^-v\(.*\)'\`" $i` || continue;;
- esac
-
- echo
- echo " $i:"
- echo
- if test x$VERSION = x-
- then
- grep "^@@\^" $i
- else
- grep "^@@\^" $i | awk "{ print; if(NR>(-($VERSION))) exit }"
- fi |
- awk -F\^ '
- { printf "(-%d) Version: %s, Owner: %s, ",NR-1,$2,$3
- printf "Date: %s",$4
- printf "\nSummary: %s", $5
- for(i=6;i<=NF;i++)
- printf "\n %s",$i
- print "\n"
- }'
- else
- echo "can't open $i" 1>&2
- fi
- done
-