Hi althekiller,
I would like to submit a little patch to your script for the svn revision detection in other languages than english.
I'm french and my locale is set in french. So when I try to check the svn revision of xbmc, here is what I get:
$ svn info "XBMC" -r HEAD
Chemin : XBMC
URL :
https://xbmc.svn.sourceforge.net/svnroot...xport/XBMC
Racine du dépôt :
https://xbmc.svn.sourceforge.net/svnroot/xbmc
UUID du dépôt : 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Révision : 13531
Type de noeud : répertoire
Auteur de la dernière modification : malloc64
Révision de la dernière modification : 13528
Date de la dernière modification: 2008-06-11 11:40:55 +0200 (mer, 11 jun 2008)
As you can see, in french Revision is spelled "Révision" (with an accent).
So your script can detect the revision because you do a grep on "Revision".
The change I suggest is simply to add in your script the use of the environmental setting "LANG" like this:
$ echo "Init lang is $LANG" ; LANG_old=${LANG} ; LANG="" ; echo "New lang is $LANG" ; svn info "XBMC" -r HEAD ; LANG=${LANG_old} ; echo "Lang is again $LANG"
Init lang is fr_FR.UTF-8
New lang is
Path: XBMC
URL:
https://xbmc.svn.sourceforge.net/svnroot...xport/XBMC
Repository Root:
https://xbmc.svn.sourceforge.net/svnroot/xbmc
Repository UUID: 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Revision: 13532
Node Kind: directory
Last Changed Author: malloc64
Last Changed Rev: 13528
Last Changed Date: 2008-06-11 11:40:55 +0200 (Wed, 11 Jun 2008)
Lang is again fr_FR.UTF-8
Using this method, the ouput of the svn command is defaulted to english and we have no problem to grep.
So the result:
$ diff build_new.sh build.sh
497,500d496
< # Read the actual value of the environmental setting LANG
< LANG_SYSTEM=$LANG
< # Default its value
< LANG=""
679,681d674
< # Restore LANG value (done there because I often do ctrl+c to bypass the log view :p )
< LANG=$LANG_SYSTEM
<
Thank you for your work,
hope this will help others,
regards,
Typhoe