#!/bin/sh
###############################################
#
# makever 2.22
#
# Copies the current directory to a new
# one assuming the last directory is a
# version number
#
# $1 - TAR variable in Makefile.def
#
###############################################

echo "MakeVer 2.22"
echo 

##### set tar variable

TAR=$1

##### read the new version

echo "Give version number to be made."
read VERSION

##### make the new version

echo "Making ../$VERSION..."

  rm -rf ../$VERSION
  mkdir ../$VERSION >/dev/null 2>/dev/null
  tar cf - . | (cd ../$VERSION; tar xf - )

  if [ "$TAR" != "" ]; then
    CURVER=`pwd | sed -e s%.*/%%`
    if [ "$CURVER" != "" ]; then
      rm -f ../$VERSION/$TAR-$CURVER.tar.gz ../$VERSION/$TAR-$CURVER.lsm
    fi
  fi

echo "Files copied."

