Mailinglist Archive: yast-devel (152 mails)

< Previous Next >
Re: [yast-devel] Re: [yast-commit] <rest-service> master : made check for packages work in non-english locale
  • From: Jiri Srain <jsrain@xxxxxxx>
  • Date: Fri, 10 Jul 2009 11:34:54 +0200
  • Message-id: <200907101134.55300.jsrain@xxxxxxx>
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@xxxxxxx
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@xxxxxxxxxxxx
For additional commands, e-mail: yast-devel+help@xxxxxxxxxxxx

< Previous Next >