[yast-devel] Re: [yast-commit] <rest-service> master : made check for packages work in non-english locale
JiXXXX XXrain napsal(a):
ref: refs/heads/master commit 1666acacf0784ddec98cdb7fc0b35e9882ee5d33 Author: Ji�à Šrain <jsrain@suse.cz> Date: Fri Jul 10 11:03:28 2009 +0200
made check for packages work in non-english locale --- webservice/lib/tasks/checks.rake | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/webservice/lib/tasks/checks.rake b/webservice/lib/tasks/checks.rake index 6f3ac9d..06fb74c 100644 --- a/webservice/lib/tasks/checks.rake +++ b/webservice/lib/tasks/checks.rake @@ -24,7 +24,10 @@ def test_module name, package end
def test_version package, version + old_lang = ENV['LANG'] + ENV['LANG'] = 'C' v = `rpm -q #{package}` + ENV['LANG'] = old_lang escape v, "install #{package} >= #{version}" if v =~ /is not installed/ nvr = v.split "-" rel = nvr.pop
Isn't easier just use v = `LANG=C rpm -q #{package}` instead of this patch? less code is better code :) JR -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
On Fri, Jul 10, 2009 at 11:08:14AM +0200, josef reidinger wrote:
JiXXXX XXrain napsal(a):
def test_version package, version + old_lang = ENV['LANG'] + ENV['LANG'] = 'C' v = `rpm -q #{package}` + ENV['LANG'] = old_lang escape v, "install #{package} >= #{version}" if v =~ /is not installed/ nvr = v.split "-" rel = nvr.pop
Isn't easier just use v = `LANG=C rpm -q #{package}` instead of this patch? less code is better code :) JR
That's exactly what I suggested too, but it does not work, assuming LANG=C to be the command. Any other way, besides `sh -c "LANG=C foo"` ? The pickaxe book shows an example with "fork do... ENV[]=.." -- Martin Vidner, YaST developer http://en.opensuse.org/User:Mvidner Kuracke oddeleni v restauraci je jako fekalni oddeleni v bazenu -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
Dne pátek 10 Červenec 2009 11:25:03 Martin Vidner napsal(a):
On Fri, Jul 10, 2009 at 11:08:14AM +0200, josef reidinger wrote:
JiXXXX XXrain napsal(a):
def test_version package, version + old_lang = ENV['LANG'] + ENV['LANG'] = 'C' v = `rpm -q #{package}` + ENV['LANG'] = old_lang escape v, "install #{package} >= #{version}" if v =~ /is not installed/ nvr = v.split "-" rel = nvr.pop
Isn't easier just use v = `LANG=C rpm -q #{package}` instead of this patch? less code is better code :) JR
That's exactly what I suggested too, but it does not work, assuming LANG=C to be the command.
And in fact it was the first of my tries to do that. Setting the language once to 'C' and leaving it this way forever could be an option, but I wanted to be as non-intrusive as possible. Jiri
Any other way, besides `sh -c "LANG=C foo"` ? The pickaxe book shows an example with "fork do... ENV[]=.."
-- Regards, Jiri Srain YaST Team Leader --------------------------------------------------------------------- SUSE LINUX, s.r.o. e-mail: jsrain@suse.cz Lihovarska 1060/12 tel: +420 284 028 959 190 00 Praha 9 fax: +420 284 028 951 Czech Republic http://www.suse.cz -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
participants (3)
-
Jiri Srain
-
josef reidinger
-
Martin Vidner