home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume32 / gaps / part01 / vls < prev   
Encoding:
Text File  |  1992-09-20  |  986 b   |  48 lines

  1. #!/bin/sh
  2. # GAPS version 4.0
  3. # get and put system - by Nadav Har'El
  4. # vls: list versions in history
  5.  
  6. VERSION=-    # the version to stop on (- if to show all versions)
  7. XVERSION=
  8.  
  9. for i
  10. do
  11.     case $i in
  12.     -[0-9]|-[0-9][0-9]|-[0-9][0-9][0-9])
  13.         XVERSION=; VERSION=$i; continue;;     # 1-999 versions
  14.     -a)    XVERSION=; VERSION=-; continue;;
  15.     -v*)    XVERSION=$i; continue;;
  16.     *.H)    ;;
  17.     *)    i=$i.H;;
  18.     esac
  19.     if test -r $i
  20.     then
  21.         # for each file we recalculate the numeric version from the
  22.         # named version
  23.         case $XVERSION in
  24.         -v*)    VERSION=`ver "\`expr \"$XVERSION\" : '^-v\(.*\)'\`" $i` || continue;;
  25.         esac
  26.  
  27.         echo
  28.         echo "    $i:"
  29.         echo
  30.         if test x$VERSION = x-
  31.         then
  32.             grep "^@@\^" $i
  33.         else
  34.             grep "^@@\^" $i | awk "{ print; if(NR>(-($VERSION))) exit }"
  35.         fi |
  36.         awk -F\^ '
  37.         { printf "(-%d) Version: %s, Owner: %s, ",NR-1,$2,$3
  38.           printf "Date: %s",$4
  39.           printf "\nSummary: %s", $5
  40.           for(i=6;i<=NF;i++)
  41.             printf "\n         %s",$i
  42.           print "\n"
  43.         }'
  44.     else
  45.         echo "can't open $i" 1>&2
  46.     fi
  47. done
  48.