#/bin/sh
#----------------------------------------------------------------------------
# \file         build/patch/buildpatch.sh
# \brief        Create patch files
# \version      $Revision: 1.4 $
# \author       (c)2011 Daniel Tartavel  <contact@librepc.com>
#               original script of Laurent Destailleur  <eldy@users.sourceforge.net>
#----------------------------------------------------------------------------
# This script can be used to build a patch after a developer has made
# changes on files in its Dolibarr tree.
# The output patch file can then be submited on Dolibarr dev mailing-list,
# with explanation on its goal, for inclusion in main branch.
#----------------------------------------------------------------------------


if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ];
then echo Syntax of Buildpatch.sh\nbuildpatch.sh original_dir_path modified_dir_path patch_filename
else echo ----- Building patch file $3 -----
     echo Build patch between \"$1\" and \"$2\"
diff -BNaur --exclude=CVS --exclude="*.patch" --exclude=".#*" --exclude="*~" --exclude="*.rej" --exclude="*.orig" --exclude="*.bak" --exclude=conf.php --exclude=documents  $1  $2  > $3
fi
