lazarus/tools/install/create_lazarus_export_tgz.sh
mattias eb25220d96 replaced hack with call of svnversion
git-svn-id: trunk@10778 -
2007-03-21 21:55:19 +00:00

46 lines
822 B
Bash
Executable File

#!/bin/bash
#set -x
set -e
OutputFile=$1
Usage="$0 [download] outputfilename"
Download=no
if [ "x$1" = "xdownload" ]; then
Download=yes
shift
fi
if [ "x$OutputFile" = "x" ]; then
echo $Usage
exit
fi
if [ "x$Download" = "xyes" ]; then
echo "downloading lazarus svn ..."
cd /tmp
rm -rf /tmp/lazarus
svn export http://svn.freepascal.org/svn/lazarus/trunk lazarus
cd -
else
echo "extracting lazarus from local svn ..."
SourceDir=$(pwd | sed -e 's#lazarus[_0-9]*/tools.*$#lazarus#')
rm -rf /tmp/lazarus
svn export $SourceDir /tmp/lazarus
fi
# add ide/revision.inc
Revision=$(svnversion /tmp/lazarus)
echo "const RevisionStr = '$Revision';" > /tmp/lazarus/ide/revision.inc
cd /tmp
echo "packing ..."
tar cvzf lazarus.tgz lazarus
cd -
mv /tmp/lazarus.tgz $OutputFile
rm -rf /tmp/lazarus
# end.