Merge topic 'fix-ctest-update-locale'
6a661f06
CTest: To enforce the C locale use LC_ALL instead of LC_MESSAGES.
This commit is contained in:
commit
e2055b172e
|
@ -72,37 +72,37 @@ public:
|
||||||
cmCTestUpdateHandlerLocale();
|
cmCTestUpdateHandlerLocale();
|
||||||
~cmCTestUpdateHandlerLocale();
|
~cmCTestUpdateHandlerLocale();
|
||||||
private:
|
private:
|
||||||
std::string saveLCMessages;
|
std::string saveLCAll;
|
||||||
};
|
};
|
||||||
|
|
||||||
cmCTestUpdateHandlerLocale::cmCTestUpdateHandlerLocale()
|
cmCTestUpdateHandlerLocale::cmCTestUpdateHandlerLocale()
|
||||||
{
|
{
|
||||||
const char* lcmess = cmSystemTools::GetEnv("LC_MESSAGES");
|
const char* lcall = cmSystemTools::GetEnv("LC_ALL");
|
||||||
if(lcmess)
|
if(lcall)
|
||||||
{
|
{
|
||||||
saveLCMessages = lcmess;
|
saveLCAll = lcall;
|
||||||
}
|
}
|
||||||
// if LC_MESSAGES is not set to C, then
|
// if LC_ALL is not set to C, then
|
||||||
// set it, so that svn/cvs info will be in english ascii
|
// set it, so that svn/cvs info will be in english ascii
|
||||||
if(! (lcmess && strcmp(lcmess, "C") == 0))
|
if(! (lcall && strcmp(lcall, "C") == 0))
|
||||||
{
|
{
|
||||||
cmSystemTools::PutEnv("LC_MESSAGES=C");
|
cmSystemTools::PutEnv("LC_ALL=C");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cmCTestUpdateHandlerLocale::~cmCTestUpdateHandlerLocale()
|
cmCTestUpdateHandlerLocale::~cmCTestUpdateHandlerLocale()
|
||||||
{
|
{
|
||||||
// restore the value of LC_MESSAGES after running the version control
|
// restore the value of LC_ALL after running the version control
|
||||||
// commands
|
// commands
|
||||||
if(!saveLCMessages.empty())
|
if(!saveLCAll.empty())
|
||||||
{
|
{
|
||||||
std::string put = "LC_MESSAGES=";
|
std::string put = "LC_ALL=";
|
||||||
put += saveLCMessages;
|
put += saveLCAll;
|
||||||
cmSystemTools::PutEnv(put);
|
cmSystemTools::PutEnv(put);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cmSystemTools::UnsetEnv("LC_MESSAGES");
|
cmSystemTools::UnsetEnv("LC_ALL");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue