mtt_versions 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #! /bin/sh
  2. ######################################
  3. ##### Model Transformation Tools #####
  4. ######################################
  5. # Bourne shell script: mtt_versions
  6. # P.J.Gawthrop May 1998
  7. # Copyright (c) P.J.Gawthrop 1998
  8. ###############################################################
  9. ## Version control history
  10. ###############################################################
  11. ## $Id$
  12. ## $Log$
  13. ## Revision 1.6 2005/02/17 22:15:35 geraint
  14. ## Added missing quotes to conditional expression.
  15. ##
  16. ## Revision 1.5 2005/02/17 18:36:38 geraint
  17. ## Removed a bash-ism: replaced [[ conditional ]] with [ conditional ]
  18. ##
  19. ## Revision 1.4 2003/08/06 22:39:40 geraint
  20. ## Fixed reporting of non-existent software, no longer says "is OK and has version .".
  21. ##
  22. ## Revision 1.3 2002/04/28 18:41:26 geraint
  23. ## Fixed [ 549658 ] awk should be gawk.
  24. ## Replaced calls to awk with call to gawk.
  25. ##
  26. ## Revision 1.2 2000/11/13 21:40:26 peterg
  27. ## Sorted out the non-gnu
  28. ##
  29. ## Revision 1.1 1998/05/28 09:24:41 peterg
  30. ## Initial revision
  31. ##
  32. ###############################################################
  33. echo Versions of mtt and its components on `date`
  34. ## gnu standard --version
  35. mtt_version mtt
  36. echo Doing the GNU components
  37. mtt_version gawk
  38. mtt_version basename
  39. mtt_version cat
  40. mtt_version cp
  41. mtt_version dirname
  42. mtt_version gcc
  43. mtt_version grep
  44. mtt_version head
  45. mtt_version make
  46. mtt_version octave
  47. mtt_version sed
  48. mtt_version tail
  49. mtt_version tr
  50. ## Non standards
  51. echo Doing the non-GNU components
  52. print_version ()
  53. {
  54. program=${1:-"Error: unknown program"}
  55. shift;
  56. version=$*
  57. if [ "${version:-""}" ]; then
  58. echo is OK and has version $version.
  59. else
  60. echo $program does not exist.
  61. fi
  62. }
  63. echo Trying xfig ...
  64. xfig -help 2> mtt_junk; version=`grep Xfig mtt_junk`
  65. print_version xfig $version
  66. echo Trying fig2dev ...
  67. fig2dev -h > mtt_junk; version=`grep -i patchlevel mtt_junk`
  68. print_version fig2dev $version
  69. echo Trying reduce ...
  70. reduce -w >mtt_junk 2>1 <<EOF
  71. bye;
  72. EOF
  73. version=`grep -i REDUCE mtt_junk`
  74. print_version reduce $version