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: Martin Vidner <mvidner@xxxxxxx>
  • Date: Fri, 10 Jul 2009 11:25:03 +0200
  • Message-id: <20090710092503.GC4954@xxxxxxxxxxxxxxxx>
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 :)

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

Kuracke oddeleni v restauraci je jako fekalni oddeleni v bazenu
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-devel+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups