2009-02-02 20:21:58 +01:00
|
|
|
#!/bin/bash
|
2009-03-07 13:21:02 +01:00
|
|
|
# A script for creating source archives from a GIT tag
|
2009-03-03 16:27:18 +01:00
|
|
|
#
|
2009-03-07 13:21:02 +01:00
|
|
|
# Archive files are created in user's home directory.
|
2009-08-16 15:57:16 +02:00
|
|
|
#
|
|
|
|
# Remember to update version number in:
|
2010-03-07 20:41:04 +01:00
|
|
|
# - lib/cppcheck.cpp
|
|
|
|
# - cli/main.cpp
|
|
|
|
# - cli/cppcheck.rc
|
|
|
|
# - win_installer/productInfo.wxs
|
2009-03-03 16:27:18 +01:00
|
|
|
|
2009-03-07 13:21:02 +01:00
|
|
|
# Tag to use
|
2010-03-09 10:41:36 +01:00
|
|
|
tag=$1
|
2009-02-02 20:21:58 +01:00
|
|
|
|
2009-03-07 13:21:02 +01:00
|
|
|
# Name of release
|
|
|
|
releasename=cppcheck-$tag
|
2009-02-02 20:21:58 +01:00
|
|
|
|
2009-08-16 15:57:16 +02:00
|
|
|
# wget http://josefsson.org/git2cl/git2cl
|
2010-03-09 10:41:36 +01:00
|
|
|
echo Update Changelog..
|
2009-08-16 15:57:16 +02:00
|
|
|
./git2cl > ChangeLog
|
|
|
|
|
2010-03-09 10:41:36 +01:00
|
|
|
echo Update Makefile..
|
|
|
|
git tag -d $tag
|
|
|
|
g++ -o dmake tools/dmake.cpp lib/filelister.cpp
|
|
|
|
./dmake --release
|
|
|
|
git commit -a -m "Makefile: Set release mode"
|
|
|
|
git tag $tag
|
|
|
|
|
|
|
|
echo Create archives..
|
2009-03-07 13:21:02 +01:00
|
|
|
git archive --format=tar --prefix=$releasename/ $tag | gzip > ~/$releasename.tar.gz
|
|
|
|
git archive --format=tar --prefix=$releasename/ $tag | bzip2 > ~/$releasename.tar.bz2
|
|
|
|
git archive --format=zip -9 --prefix=$releasename/ $tag > ~/$releasename.zip
|
2010-03-09 10:41:36 +01:00
|
|
|
|
|
|
|
echo Restoring repository..
|
|
|
|
git tag -d $tag
|
|
|
|
git reset --hard HEAD^1
|
|
|
|
git pull
|
|
|
|
|