From cf978090b4b97c0225ed5eafe88c4d8c6ca0a42b Mon Sep 17 00:00:00 2001 From: Romain Goffe Date: Thu, 13 Oct 2011 22:36:16 +0200 Subject: [PATCH] import shell scripts that are used for patacrep releases --- utils/release.sh | 78 ++++++++++++++++++++++++++++++++++++++++++++++++ utils/tarball.sh | 37 +++++++++++++++++++++++ 2 files changed, 115 insertions(+) create mode 100755 utils/release.sh create mode 100755 utils/tarball.sh diff --git a/utils/release.sh b/utils/release.sh new file mode 100755 index 00000000..c79bb787 --- /dev/null +++ b/utils/release.sh @@ -0,0 +1,78 @@ +#!/bin/sh + +#Author: Romain Goffe +#Date: 13/10/2011 +#Description: Build all the pdf on www.patacrep.com, increase their +#version and commit/tag the result + +export GREP_OPTIONS="" + +#volume-3.sb +./utils/volume-3.sh +#english.sb +./utils/langbooks.sh english +#french.sb +./utils/langbooks.sh french + +#increase version +RELEASE_TYPE=$1 +VERSION=`grep "\"version\"" ./templates/patacrep.tmpl | sed -e 's/.*\"\([0-9]\+\)\.\([0-9]\+\)\.\?\([0-9]\+\)\?.*/export MAIN=\1\nexport MAJOR=\2\nexport MINOR=\3\n/'` +$VERSION + +if [ $# -eq 1 ] +then + echo "current version : $MAIN.$MAJOR.$MINOR" + if [ $RELEASE_TYPE = "major" ]; + then + MAJOR=$(($MAJOR+1)) + MINOR=0 + elif [ $RELEASE_TYPE = "minor" ]; + then + MINOR=$(($MINOR+1)) + else + echo "error: unrecognised release type" + fi; + echo "new version : $MAIN.$MAJOR.$MINOR" + #update version field in sb files + sed -i "s/\"[0-9].[0-9].[0-9]\"/\"$MAIN.$MAJOR.$MINOR\"/" templates/patacrep.tmpl + sed -i "s/\"[0-9].[0-9].[0-9]\"/\"$MAIN.$MAJOR.$MINOR\"/" templates/ancient.tmpl + sed -i "s/\"[0-9].[0-9].[0-9]\"/\"$MAIN.$MAJOR.$MINOR\"/" templates/patacrep-en.tmpl +else + echo "keeping release version" +fi; + + +#apply verification tools +#echo "emacs batch indentation in progress ..." +#./utils/indent.sh 2> /dev/null +#echo "emacs batch indentation done !" +./utils/rules.py +./utils/typo.sh ./songs/*/*.sg +./utils/resize-cover.sh + +#build all songbooks +rm -f *.d +make cleanall +make naheulbeuk.pdf +make volume-1.pdf +make volume-2.pdf +make volume-3.pdf +make english.pdf +make french.pdf +make songbook.pdf + +#clean +make clean + +./utils/tarball.sh + +git status + +if [ $# -eq 1 ]; +then + #git add templates/patacrep-en.tmpl templates/patacrep.tmpl + git commit -a -m "patacrep release version $MAIN.$MAJOR.$MINOR" + git tag "patacrep_$MAIN.$MAJOR.$MINOR" +fi + +export GREP_OPTIONS="--exclude-dir=\*/.svn/\* --exclude=\*~ --binary-files=without-match --line-number" diff --git a/utils/tarball.sh b/utils/tarball.sh new file mode 100755 index 00000000..39a89078 --- /dev/null +++ b/utils/tarball.sh @@ -0,0 +1,37 @@ +#!/bin/sh + +#Author: Romain Goffe +#Date: 13/10/2011 +#Description: Build a tarball from the songbook git repo + +#Copy songbook directory +cd $HOME +cp -RH songbook songbook-$(date +%d)-$(date +%m)-$(date +%Y); + +#Remove unecessary directories +cd songbook-$(date +%d)-$(date +%m)-$(date +%Y); +rm -rf perso/ ; +rm -rf data/ ; +rm -rf .git/ ; +rm -f .gitignore ; +rm -f crep.sgl ; +rm -f chords.tex ; +rm -f lilypond/*.ps ; +rm -f lilypond/*.pdf ; +rm -f utils/send.sh ; +rm -f utils/release.sh ; +rm -f utils/tarball.sh ; +rm -f tmp* +rm -f default* +rm -f *.pdf + +#Clean tmp files +find . -name "*~" -type f -exec rm -f {} \; && find . -name "#*#" -type f -exec rm -f {} \; +make cleanall + +#Tarball +cd $HOME +tar czvf songbook.tar.gz songbook-$(date +%d)-$(date +%m)-$(date +%Y) + +#Remove copy +rm -rf songbook-$(date +%d)-$(date +%m)-$(date +%Y)/