diff options
author | Marco Pesenti Gritti <mpgritti@gmail.com> | 2008-09-29 12:46:13 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <mpgritti@gmail.com> | 2008-09-29 12:46:13 (GMT) |
commit | ca01d29bf818bff7019a7374965a146be9d2cae3 (patch) | |
tree | 8985905ede59be10d6d94c72797bc614dabfdf1f /scripts | |
parent | 68de6d96fd7b8e217fbf22e1e256e7710c20690d (diff) |
Some fixes to lsb_release use, patch by guysoft42.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/sysdeps.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/scripts/sysdeps.py b/scripts/sysdeps.py index b63a0ca..9e25ed1 100644 --- a/scripts/sysdeps.py +++ b/scripts/sysdeps.py @@ -1,5 +1,6 @@ import os import subprocess +from subprocess import Popen,PIPE from xml.dom import minidom @@ -24,9 +25,12 @@ def get_distribution(): # Debian and Ubuntu try: - out, err = subprocess.call(['lsb_release', '-is']).communicate() + out, err = subprocess.Popen(['lsb_release', '-is'], + stdout=subprocess.PIPE).communicate() name = out.strip().lower() - out, err = subprocess.call(['lsb_release', '-rs']).communicate() + + out, err = subprocess.Popen(['lsb_release', '-rs'], + stdout=subprocess.PIPE).communicate() version = out.strip() if name == 'debian' and version == 'testing': @@ -44,9 +48,9 @@ def check_package(package): ret = subprocess.call(['rpm', '--quiet', '-q', package]) return ret == 0 elif name in ['ubuntu', 'debian']: - cmd = ["dpkg-query", "-f='${status}'", "-W %s"] - stdout, stderr = subprocess.call(cmd).communicate() - return stdout.find('install ok installed') != -1 + cmd = ["dpkg-query", "-f='${status}'", "-W", package] + out, err = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate() + return out.find('install ok installed') != -1 return None |