home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume25 / finger / part01 / make-version < prev    next >
Encoding:
Text File  |  1992-04-03  |  1.2 KB  |  52 lines

  1. #! /bin/sh
  2. # make-version -- shell script to create version.c for finger
  3. #
  4. # Copyright (C) 1987, 1990  Philip L. Budne
  5. #
  6. # This file is part of "Phil's Finger Program".
  7. #
  8. # This program is free software; you can redistribute it and/or modify
  9. # it under the terms of the GNU General Public License as published by
  10. # the Free Software Foundation; either version 1, or (at your option)
  11. # any later version.
  12. #
  13.  
  14. # $Id: make-version,v 3.0 90/07/06 13:11:18 budd Rel $
  15.  
  16. if [ -r BUILD ]
  17. then
  18.     build=`cat BUILD`
  19.     if expr $build + 1 > /dev/null 2>&1
  20.     then
  21.     build=`expr $build + 1`
  22.     else
  23.     echo bad BUILD file '"'$build'"' -- resetting 1>&2
  24.     build=1
  25.     fi
  26. else
  27.     echo creating new BUILD file 1>&2
  28.     build=1
  29. fi
  30. echo $build > BUILD
  31. echo build $build 1>&2
  32.  
  33. echo '/* This file is created by the script make-version */'
  34. if test -f /bin/hostname ; then
  35.     HOST=`/bin/hostname`
  36. else
  37.     HOST=`/bin/uname -n`
  38. fi
  39.  
  40. cat <<EOF
  41. char version[]         = "`./pversion`";
  42. char build_who[]    = "`./mywhoami`";
  43. char build_host[]    = "$HOST";
  44. char build_dir[]    = "`pwd`";
  45. char build_date[]    = "`date`";
  46. int  build_number    = $build;
  47.  
  48. char longversion[]    = "This is finger version `./pversion` build #$build by `./mywhoami` at $HOST\non `date` in `pwd`";
  49. EOF
  50. exit 0
  51.