1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-08-02 05:33:39 +02:00

- fix deprecation warnings on factory (python26)

This commit is contained in:
Marcus Hüwe
2008-10-11 20:26:45 +00:00
parent df8ecce631
commit 1e1ec418cc
3 changed files with 24 additions and 20 deletions

View File

@@ -134,26 +134,25 @@ def verify_pacs(pac_list):
Check all packages in one go, since this takes only 6 seconds on my Athlon 700
instead of 20 when calling 'rpm -K' for each of them.
"""
import subprocess
if not pac_list:
return
# 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.
# don't care about the return value because we check the
# output anyway, and rpm always writes to stdout.
# save locale first (we rely on English rpm output here)
saved_LC_ALL = os.environ.get('LC_ALL')
os.environ['LC_ALL'] = 'en_EN'
(i, o) = os.popen4(['/bin/rpm', '-K'] + pac_list)
o = subprocess.Popen(['/bin/rpm', '-K'] + pac_list, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT, close_fds=True).stdout
# restore locale
if saved_LC_ALL: os.environ['LC_ALL'] = saved_LC_ALL;
else: os.environ.pop('LC_ALL')
i.close()
for line in o.readlines():
if not 'OK' in line: