Mailinglist Archive: opensuse-buildservice (170 mails)

< Previous Next >
Re: [opensuse-buildservice] Checking md5sums in osc relies on English locales
  • From: Pavol Rusnak <prusnak@xxxxxxx>
  • Date: Tue, 04 Dec 2007 17:06:19 +0100
  • Message-id: <47557AFB.5010200@xxxxxxx>
Ladislav Michnovič wrote:
I have a little problem when using local build with osc. In file
/usr/lib64/python2.5/site-packages/osc/fetch.py

Peter: Problem is in call on line 144 and in the checks after it on
lines 150 and 156:

144: (i, o) = os.popen4(['/bin/rpm', '-K'] + pac_list)
150: if not 'OK' in line:
156: if 'NOT OK' in line:

English, German, French, Czech print "OK" or "NOT OK", but Slovak with
"V PORIADKU" or "NIE JE V PORIADKU" (as these strings are marked for
translation). Similar problem will arise with another languages that
have these strings translated. I see 2 possible solutions:

1) check packages one at a time and look for return value from RPM (do
not parse stdout)
2) set environment (LC_ALL) before rpm call

According to documentation os.popen4() do not pass first parameter to
shell if it is list (os.spawn() is used), it is only passed if it is
string (os.system() is used). I'm attaching a patch which does it, but
I'm not commiting to SVN, because there might be a better solution :)

--
Best Regards / S pozdravom,

Pavol RUSNAK SUSE LINUX, s.r.o
Package Maintainer Lihovarska 1060/12
PGP 0xA6917144 19000 Praha 9, CR
prusnak[at]suse.cz http://www.suse.cz
Index: fetch.py
===================================================================
--- fetch.py (revision 2727)
+++ fetch.py (working copy)
@@ -141,7 +141,7 @@

# we can use os.popen4 because we don't care about the return value.
# we check the output anyway, and rpm always writes to stdout.
- (i, o) = os.popen4(['/bin/rpm', '-K'] + pac_list)
+ (i, o) = os.popen4( " ".join( ['LC_ALL=en_EN', '/bin/rpm', '-K'] +
pac_list ) )

i.close()

< Previous Next >
Follow Ups
References