Skip to contentSkip to conversation

Unset LANG in setlocalversion script

PATCH In review Christophe Leroy 2 participants 3 messages Feb 21, 2013 – Feb 22, 2013 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Unset LANG in setlocalversion script

This patch allows the use of setlocalversion script regardless of the LANG parameter. Otherwise, the svn info 2>/dev/null | grep '^Last Changed Rev' returns nothing because for instance, in French the text 'Last Changed Rev' is replaced by 'R�vision de la derni�re modification'

scripts/setlocalversion +2 -0
diff -ur linux-3.7.9/scripts/setlocalversion linux/scripts/setlocalversion
@@ -9,6 +9,8 @@
 #
 #
 
+unset LANG
+
 usage() {
 	echo "Usage: $0 [--save-scmversion] [srctree]" >&2
 	exit 1
#1 lore raw

Dne 21.2.2013 13:49, Christophe Leroy napsal(a):

Quoted 4 lines

This patch allows the use of setlocalversion script regardless of the LANG parameter. Otherwise, the svn info 2>/dev/null | grep '^Last Changed Rev' returns nothing because for instance, in French the text 'Last Changed Rev' is replaced by 'Révision de la derničre modification'

Unsetting LANG might not be enough. You should unset LC_ALL and set LC_MESSAGES=C. But - is this a problem for other commands in the script? From a quick look, we only parse English output of svn, so I suggest to only set the env var for the svn command.

Michal

#2 lore raw
Quoted 5 lines · Michal Marek

Dne 21.2.2013 13:49, Christophe Leroy napsal(a):

Quoted 4 lines

This patch allows the use of setlocalversion script regardless of the LANG parameter. Otherwise, the svn info 2>/dev/null | grep '^Last Changed Rev' returns nothing because for instance, in French the text 'Last Changed Rev' is replaced by 'Révision de la derničre modification'

Quoted 7 lines

Unsetting LANG might not be enough. You should unset LC_ALL and set LC_MESSAGES=C. But - is this a problem for other commands in the script?
From a quick look, we only parse English output of svn, so I suggest to
only set the env var for the svn command.

Michal

Ok, I will propose a new patch.
I confirm my only issue at the time being is with the svn command.

Christophe