#!/bin/sh
#
# VERSION.INFO,v 1.11 1996/05/24 14:05:48 tardieu Exp
#
# This file will perform version substitution when building a release. It
# has to be tagged "to_be_released" and to be kept in synch as new releases
# appear.
#
# DO NOT CALL THIS FILE EXPLICITLY. IT WILL BE CALLED BY THE make_distrib
# program.

#
# If there is an argument on the command line, use it for the version number
#

if test "x$1" != x; then
  glade_version=`echo $1 | sed -e 's/^[^-]*-//' | sed -e 's/-[^-]*$//'`
  gnat_version=${glade_version}
else
  gnat_version=`sed -n -e '/Gnat_Version_String/s/[^"]*"\([^" ]*\).*/\1/p' ada/gnatvsn.ads`
  glade_version=${gnat_version}
fi

#
# files hold the list of files in which substitutions will occur
#
files="README INSTALL Dist/xe_usage.adb Doc/install_guide.txt Doc/glade_ug.texi"

#
# Do the job
#
for i in ${files}; do
  cp $i $i.orig.$$
  cat $i.orig.$$ | \
   sed -e "s/__glade_version__/${glade_version}/g" | \
   sed -e "s/__gnat_version__/${gnat_version}/g" | \
   cat > $i
  rm $i.orig.$$
done
