home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume8 / libhoward / part08 / mkFreeze.b < prev    next >
Text File  |  1989-10-01  |  1KB  |  45 lines

  1.   
  2. # mkFreeze - make FREEZE.{date,i,major,minor,version}
  3. #
  4. # $Header: mkFreeze.b,v 1.3 89/09/20 13:40:05 howard Exp $
  5. #
  6. # Copyright 1989 Howard Lee Gayle
  7. # This file is written in the ISO 8859/1 character set.
  8. #
  9. # This program is free software; you can redistribute it and/or modify
  10. # it under the terms of the GNU General Public License version 1,
  11. # as published by the Free Software Foundation.
  12. #
  13. # This program is distributed in the hope that it will be useful,
  14. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16. # GNU General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU General Public License
  19. # along with this program; if not, write to the Free Software
  20. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21. #
  22. # Shell variables:
  23. # u - usage string
  24.  
  25. CMDNAME=mkFreeze
  26. export CMDNAME
  27. u="Usage: $CMDNAME"
  28. if [ $# -ne 0 ]
  29. then
  30.    echo "$u" 1>&2
  31.    exit 1
  32. fi
  33. awk '/^.Header: FREEZE,v /{
  34.    print $3 > "FREEZE.version";
  35.    split ($3, t, ".");
  36.    print t[1] > "FREEZE.major";
  37.    print t[2] > "FREEZE.minor";
  38.    y=substr($4,1,2);
  39.    if (y < 70) y += 2000; else y += 1900;
  40.    dat=sprintf "%d-%s-%s %s",y,substr($4,4,2),substr($4,7,2),$5;
  41.    print dat > "FREEZE.date";
  42.    d = "#define FRZ_";
  43.    printf "%sMAJ %s\n%sMIN %s\n%sDAT \"%s\"\n%sID  \"@(#)%s\"\n",d,t[1],d,t[2],d,dat,d,$0 > "FREEZE.i";
  44. }' < FREEZE
  45.