diff --git a/checkin_notes b/checkin_notes index 025b664d75..5802c576ba 100644 --- a/checkin_notes +++ b/checkin_notes @@ -144,3 +144,11 @@ Rom 13 Jan 2010 clientgui/ sg_DlgMessages.cpp sg_DlgPreferences.cpp + +Bernd 14 Jan 2011 + - unix build system: generate_svn_version + - generate version string from plain git repositories, too + - define SVN_REPOSITORY (URL) and SVN_REVISION (numerical) separately + so these could be used in proprocessor directives + + generate_svn_version.sh diff --git a/generate_svn_version.sh b/generate_svn_version.sh index 92af4e548a..2716c5e018 100644 --- a/generate_svn_version.sh +++ b/generate_svn_version.sh @@ -7,19 +7,26 @@ echo "#ifndef SVN_VERSION_H" > $TMPFILE echo "#define SVN_VERSION_H" >> $TMPFILE echo "" >> $TMPFILE -if [ -d .git ]; then +if [ -d .git/svn ]; then CMD="git svn info" +elif [ -d .git ]; then + GIT_LOG=`git log -n1 --pretty="format:%H"` + HOST=`hostname` elif [ -d .svn ]; then CMD="svn info" else CMD="" fi -if [ "x$CMD" != "x" ]; then +if [ "x$GIT_LOG" != "x" ]; then + echo "#define SVN_VERSION \"$GIT_LOG ($HOST:$PWD)\"" >> $TMPFILE +elif [ "x$CMD" != "x" ]; then LANG=C $CMD | awk '/^URL/ { url = $2; }; \ /^Rev/ { rev = $2; }; \ END { print "#define SVN_VERSION \"Repository: " url \ - " Revision: " rev "\""; };' \ + " Revision: " rev "\""; + print "#define SVN_REPOSITORY \"" url "\""; \ + print "#define SVN_REVISION " rev; };' \ >> $TMPFILE else echo "#include \"version.h\"" >> $TMPFILE