2008-05-02 22:19:38 +08:00
|
|
|
#!/bin/bash
|
2015-09-27 10:24:51 +08:00
|
|
|
. bash_helper_functions
|
2008-05-02 22:19:38 +08:00
|
|
|
|
2015-09-27 10:24:51 +08:00
|
|
|
# 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.
|
2008-05-02 22:19:38 +08:00
|
|
|
|
|
|
|
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
|
2015-09-27 10:24:51 +08:00
|
|
|
CHANGESET_ID=`hg id -i | sed -e 's/\+//'`
|
2008-05-02 22:19:38 +08:00
|
|
|
|
2015-09-27 10:24:51 +08:00
|
|
|
rm -rf release || report_failure
|
|
|
|
mkdir release || report_failure
|
2008-05-02 22:19:38 +08:00
|
|
|
|
|
|
|
|
|
|
|
if [ "$1" = "major" ]
|
|
|
|
then
|
2015-09-27 10:24:51 +08:00
|
|
|
MAJOR_NUM=`echo $MAJOR_NUM+1|bc`
|
2008-05-02 22:19:38 +08:00
|
|
|
MINOR_NUM=0
|
|
|
|
else
|
2015-09-27 10:24:51 +08:00
|
|
|
MINOR_NUM=`echo $MINOR_NUM+1|bc`
|
2008-05-02 22:19:38 +08:00
|
|
|
fi;
|
2015-09-27 10:24:51 +08:00
|
|
|
set_dlib_version MAJOR $MAJOR_NUM
|
|
|
|
set_dlib_version MINOR $MINOR_NUM
|
|
|
|
set_dlib_version PATCH 0
|
2008-05-02 22:19:38 +08:00
|
|
|
|
|
|
|
RELEASE=${MAJOR_NUM}.${MINOR_NUM}
|
2015-09-27 10:24:51 +08:00
|
|
|
# Commit changes to the version numbers so that the makedocs script will use them.
|
|
|
|
echo Create Mercurial tags and commit release
|
|
|
|
hg commit -m "Created release v$RELEASE" || report_failure
|
2015-09-30 10:36:46 +08:00
|
|
|
hg tag v$RELEASE || report_failure
|
2008-05-02 22:19:38 +08:00
|
|
|
|
2015-09-27 10:24:51 +08:00
|
|
|
./makedocs makerel || exit 1
|
2008-05-02 22:19:38 +08:00
|
|
|
|
2011-05-16 06:20:51 +08:00
|
|
|
echo $CHANGESET_ID > $REVNUM_FILE
|
2015-09-27 10:24:51 +08:00
|
|
|
set_dlib_version PATCH 99
|
|
|
|
hg commit -m "Record last changeset and set PATCH version to 99"
|
|
|
|
|
2008-05-02 22:19:38 +08:00
|
|
|
|
|
|
|
cd release || report_failure
|
|
|
|
RELDIR=`echo dlib-$RELEASE`
|
|
|
|
mkdir $RELDIR
|
|
|
|
cd $RELDIR || report_failure
|
2015-09-27 10:24:51 +08:00
|
|
|
cp -r ../../docs/cache/* . || report_failure
|
2008-05-02 22:19:38 +08:00
|
|
|
|
2016-10-09 03:38:06 +08:00
|
|
|
echo Version: $RELEASE >> README.md
|
|
|
|
echo "Date: `date`" >> README.md
|
|
|
|
echo Mercurial Revision ID: $CHANGESET_ID >> README.md
|
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-06-12 08:59:12 +08:00
|
|
|
#find $RELDIR -name "*.cpp" -or -name "*.h" -or -name "*.txt" -or -name "*.html" -or -name "*.py" | xargs flip -m
|
|
|
|
find $RELDIR -name "*.cpp" -or -name "*.h" -or -name "*.txt" -or -name "*.html" -or -name "*.py" | xargs unix2dos &> /dev/null
|
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
|
|
|
|
|
2016-06-26 01:55:41 +08:00
|
|
|
# Don't make the chm doc file since hhc.exe doesn't run in any copy of wine anymore :(
|
|
|
|
#wine ../docs/chm/htmlhelp/hhc.exe ../docs/chm/lib.hhp
|
|
|
|
#mv ../docs/chm/help.chm dlib_documentation-$RELEASE.chm || report_failure
|
2008-05-02 22:19:38 +08:00
|
|
|
|
2010-07-29 08:49:33 +08:00
|
|
|
|
|
|
|
mkdir v$RELEASE
|
2016-06-26 01:55:41 +08:00
|
|
|
#mv dlib_documentation-$RELEASE.chm v$RELEASE
|
2010-07-29 08:49:33 +08:00
|
|
|
mv $SOURCE_TAR.bz2 v$RELEASE
|
|
|
|
mv $SOURCE_ZIP v$RELEASE
|
|
|
|
|
|
|
|
|
2011-05-16 06:45:57 +08:00
|
|
|
|
|
|
|
|