2008-05-02 22:19:38 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# if the first argument to this script is the word major then the
|
|
|
|
# major version number is updated and the minor is set back to 0
|
|
|
|
|
|
|
|
report_failure ()
|
|
|
|
{
|
|
|
|
echo " **** failed to complete **** "
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-01-24 08:42:06 +08:00
|
|
|
./testenv_rel || report_failure
|
2008-05-02 22:19:38 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
REVNUM_FILE=.logger_revnum
|
|
|
|
COUNTER_FILE=.current_release_number
|
|
|
|
MINOR_COUTNER_FILE=.current_minor_release_number
|
|
|
|
|
|
|
|
|
|
|
|
RELEASE=`cat $COUNTER_FILE | awk '{ print $1 + 1}'`
|
|
|
|
|
|
|
|
if [ "$1" = "major" ]
|
|
|
|
then
|
|
|
|
MAJOR_NUM=`cat $COUNTER_FILE | awk '{print $1 + 1}'`
|
|
|
|
MINOR_NUM=0
|
|
|
|
echo $MAJOR_NUM > $COUNTER_FILE
|
|
|
|
echo $MINOR_NUM > $MINOR_COUTNER_FILE
|
|
|
|
else
|
|
|
|
MAJOR_NUM=`cat $COUNTER_FILE`
|
|
|
|
MINOR_NUM=`cat $MINOR_COUTNER_FILE | awk '{print $1 + 1}'`
|
|
|
|
echo $MINOR_NUM > $MINOR_COUTNER_FILE
|
|
|
|
fi;
|
|
|
|
|
2011-09-21 06:27:47 +08:00
|
|
|
./makedocs makerel || exit 1
|
2011-05-22 23:05:12 +08:00
|
|
|
|
2011-05-16 06:20:51 +08:00
|
|
|
rm -rf release || report_failure
|
|
|
|
mkdir release || report_failure
|
2008-05-02 22:19:38 +08:00
|
|
|
|
|
|
|
RELEASE=${MAJOR_NUM}.${MINOR_NUM}
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-05-16 06:20:51 +08:00
|
|
|
CHANGESET_ID=`hg id -i | sed -e 's/\+//'`
|
|
|
|
echo $CHANGESET_ID > $REVNUM_FILE
|
2008-05-02 22:19:38 +08:00
|
|
|
|
|
|
|
cd release || report_failure
|
|
|
|
RELDIR=`echo dlib-$RELEASE`
|
|
|
|
mkdir $RELDIR
|
|
|
|
cd $RELDIR || report_failure
|
|
|
|
cp -r ../../docs/cache/dlib . || report_failure
|
|
|
|
cp -r ../../docs/cache/examples . || report_failure
|
2013-05-28 01:59:40 +08:00
|
|
|
cp -r ../../docs/cache/python_examples . || report_failure
|
2012-01-21 21:38:45 +08:00
|
|
|
cp -r ../../docs/cache/tools . || report_failure
|
2008-05-02 22:19:38 +08:00
|
|
|
|
|
|
|
echo Version: $RELEASE >> dlib/README.txt
|
2010-02-06 04:51:34 +08:00
|
|
|
echo "Date: `date`" >> dlib/README.txt
|
2011-05-16 06:20:51 +08:00
|
|
|
echo Mercurial Revision ID: $CHANGESET_ID >> dlib/README.txt
|
2008-05-02 22:19:38 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WEBPAGE=`echo dlib_webpage-$RELEASE.tar`
|
|
|
|
SOURCE_ZIP=`echo $RELDIR.zip`
|
|
|
|
SOURCE_TAR=`echo $RELDIR.tar`
|
2011-05-16 06:20:51 +08:00
|
|
|
tar -C ../../docs/chm -cf - docs/ documentation.html | tar -xf - || report_failure
|
2008-05-02 22:19:38 +08:00
|
|
|
cd .. || report_failure
|
|
|
|
|
|
|
|
tar -cf $SOURCE_TAR $RELDIR || report_failure
|
|
|
|
# flip everything to MS-DOS line endings
|
2013-01-24 08:42:06 +08:00
|
|
|
#find $RELDIR -name "*.cpp" -or -name "*.h" -or -name "*.txt" -or -name "*.html" | xargs flip -m
|
|
|
|
find $RELDIR -name "*.cpp" -or -name "*.h" -or -name "*.txt" -or -name "*.html" | xargs unix2dos &> /dev/null
|
2008-05-02 22:19:38 +08:00
|
|
|
|
2013-06-08 07:54:06 +08:00
|
|
|
scp davis@home.dlib.net:dlib_win_python/* $RELDIR/python_examples || report_failure
|
2008-05-02 22:19:38 +08:00
|
|
|
zip -r9 $SOURCE_ZIP $RELDIR > /dev/null || report_failure
|
2011-05-16 06:20:51 +08:00
|
|
|
tar -C ../docs -cf $WEBPAGE web || report_failure
|
2008-05-02 22:19:38 +08:00
|
|
|
bzip2 $SOURCE_TAR || report_failure
|
|
|
|
bzip2 $WEBPAGE || report_failure
|
|
|
|
|
|
|
|
rm -rf $RELDIR
|
|
|
|
|
|
|
|
wine ../docs/chm/htmlhelp/hhc.exe ../docs/chm/lib.hhp
|
|
|
|
mv ../docs/chm/help.chm dlib_documentation-$RELEASE.chm || report_failure
|
|
|
|
|
2010-07-29 08:49:33 +08:00
|
|
|
|
|
|
|
mkdir v$RELEASE
|
|
|
|
mv dlib_documentation-$RELEASE.chm v$RELEASE
|
|
|
|
mv $SOURCE_TAR.bz2 v$RELEASE
|
|
|
|
mv $SOURCE_ZIP v$RELEASE
|
|
|
|
|
|
|
|
|
2011-05-16 06:45:57 +08:00
|
|
|
echo Create Mercurial tags and commit release
|
|
|
|
cd ..
|
2011-05-16 08:38:03 +08:00
|
|
|
hg tag v$RELEASE || report_failure
|
2011-05-16 06:45:57 +08:00
|
|
|
hg commit -m "Created release v$RELEASE"
|
|
|
|
|
|
|
|
|