weboob-devel/release.sh
Laurent Bachelier fe58ca26ad Ensure proper building of man pages
Use the .sh which sets the right paths automatically.

Clean and rebuild the Qt UIs so the imports will work.
(This is also a good check to do before release.)
2013-03-09 14:57:08 +01:00

60 lines
1.3 KiB
Bash
Executable file

#!/bin/bash
# This script is used to release a version.
function set_version {
echo -n "Replacing version in source files to $1"
for fl in $(find . -iname "*.py"); do
sed "s/\(VERSION\|version\|release\) *= *[\"'][0-9]\+\..\+[\"']\(,\?\)$/\1 = '$1'\2/g" $fl > $fl.new
diff $fl.new $fl >/dev/null && echo -n "." || echo -n "+"
cp -f $fl.new $fl
rm -f $fl.new
done
echo -e " done.\n"
}
if [ "$1" = "" ]; then
echo "Syntax: $0 VERSION"
exit 1
fi
VERSION=$1
mv ChangeLog ChangeLog.old
echo -e "Weboob $VERSION (`date +%Y-%m-%d`)\n\t \n\n" > ChangeLog
cat ChangeLog.old >> ChangeLog
rm -f ChangeLog.old
vi +2 ChangeLog
set_version $VERSION
echo "Building Qt applications..."
make clean && make all
echo "Generating manpages..."
tools/make_man.sh
echo -e "done!\n"
echo "Release commit:"
git commit -a -m "Weboob $VERSION released"
echo -ne "\n"
echo "Release tag:"
git tag $VERSION -s -m "Weboob $VERSION"
echo -ne "\n"
echo -n "Generating archive.. "
git archive HEAD --prefix=weboob-$VERSION/ -o weboob-$VERSION.tar
gzip -f weboob-$VERSION.tar
md5sum weboob-$VERSION.tar.gz
echo -ne "\nDo you want to change the version number (y/n) "
read change_version
if [ "$change_version" = "y" ]; then
echo -n "Enter the new version number: "
read NEW_VERSION
set_version $NEW_VERSION
git commit -a -m "bump to $NEW_VERSION"
fi