]> err.no Git - dak/commitdiff
Monkeypatch commands.getstatusoutput to work around Python Popen issue.
authorChris Lamb <lamby@debian.org>
Tue, 27 Oct 2009 16:26:26 +0000 (16:26 +0000)
committerChris Lamb <lamby@debian.org>
Tue, 27 Oct 2009 16:26:26 +0000 (16:26 +0000)
Signed-off-by: Chris Lamb <lamby@debian.org>
daklib/utils.py

index 6e3632662f56a6b067383729bce07c836b768fe5..40410fbb0c8583dca03ce139c3006dddcfcce836 100755 (executable)
@@ -39,6 +39,7 @@ import time
 import re
 import string
 import email as modemail
+import subprocess
 
 from dbconn import DBConn, get_architecture, get_component, get_suite
 from dak_exceptions import *
@@ -63,6 +64,20 @@ key_uid_email_cache = {}  #: Cache for email addresses from gpg key uids
 known_hashes = [("sha1", apt_pkg.sha1sum, (1, 8)),
                 ("sha256", apt_pkg.sha256sum, (1, 8))] #: hashes we accept for entries in .changes/.dsc
 
+import commands
+def dak_getstatusoutput(cmd):
+    pipe = subprocess.Popen(cmd, shell=True, universal_newlines=True,
+        stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+
+    output = str.join("", pipe.stdout.readlines())
+
+    ret = pipe.wait()
+    if ret is None:
+        ret = 0
+
+    return ret, output
+commands.getstatusoutput = dak_getstatusoutput
+
 ################################################################################
 
 def html_escape(s):