#!/bin/sh
old=$1
new=$2
nm=$3-

newarc=../releases/$nm$new.tar.gz
oldarc=../releases/$nm$old.tar.gz


if [ ! -x  $nm$new ]
then
   echo untarring ..
  if [ ! -f $newarc ]
  then
	echo cant find $newarc
	exit
  fi
  tar zfxv $newarc
fi
if [ ! -x  $nm$old ]
then
   echo untarring

  if [ ! -f $oldarc ]
  then
	echo cant find oldarc
	exit
  fi
   tar zfxv $oldarc
fi

#(cd $nm$old; touch depend; make clean)
#(cd $nm$new; touch depend; make clean)
(cd $nm$new; diff -P -c  ../$nm$old . > ../patch-$new)
rm -rf $nm$old $nm$new
