chiark / gitweb /
Better output when prebuild command fails
authorCiaran Gultnieks <ciaran@ciarang.com>
Mon, 24 Sep 2012 13:06:15 +0000 (14:06 +0100)
committerCiaran Gultnieks <ciaran@ciarang.com>
Mon, 24 Sep 2012 13:06:15 +0000 (14:06 +0100)
fdroidserver/common.py

index 3c6695ff56ce0b0210d8adb620f91d0d37019457..698b3206f21cc1b9bde20dc36c68aa7e3b928a7f 100644 (file)
@@ -1275,8 +1275,11 @@ def prepare_source(vcs, app, build, build_dir, extlib_dir, sdk_path, ndk_path, j
             prebuild = prebuild.replace('$$' + name + '$$', libpath)
         prebuild = prebuild.replace('$$SDK$$', sdk_path)
         prebuild = prebuild.replace('$$NDK$$', ndk_path)
-        if subprocess.call(prebuild, cwd=root_dir, shell=True) != 0:
-            raise BuildException("Error running pre-build command")
+        p = subprocess.Popen(prebuild, cwd=root_dir, shell=True,
+                stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+        out, err = p.communicate()
+        if p.returncode != 0:
+            raise BuildException("Error running pre-build command", out, err)
 
     # Special case init functions for funambol...
     if build.get('initfun', 'no')  == "yes":