mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-11-13 02:30:11 +01:00
Handle ssh output buffering better
This commit is contained in:
parent
6e87f82522
commit
a404397014
@ -216,8 +216,6 @@ def build_server(app, thisbuild, vcs, build_dir, output_dir, sdk_path, force):
|
||||
# Execute the build script...
|
||||
print "Starting build..."
|
||||
chan = sshs.get_transport().open_session()
|
||||
stdoutf = chan.makefile('r')
|
||||
stderrf = chan.makefile_stderr('r')
|
||||
cmdline = 'python build.py --on-server'
|
||||
if force:
|
||||
cmdline += ' --force --test'
|
||||
@ -226,9 +224,16 @@ def build_server(app, thisbuild, vcs, build_dir, output_dir, sdk_path, force):
|
||||
output = ''
|
||||
error = ''
|
||||
while not chan.exit_status_ready():
|
||||
output += stdoutf.read()
|
||||
error += stderrf.read()
|
||||
while chan.recv_ready():
|
||||
output += chan.recv(1024)
|
||||
while chan.recv_stderr_ready():
|
||||
error += chan.recv_stderr(1024)
|
||||
print "...getting exit status"
|
||||
returncode = chan.recv_exit_status()
|
||||
while chan.recv_ready():
|
||||
output += chan.recv(1024)
|
||||
while chan.recv_stderr_ready():
|
||||
error += chan.recv_stderr(1024)
|
||||
if returncode != 0:
|
||||
raise BuildException("Build.py failed on server for %s:%s" % (app['id'], thisbuild['version']), output.strip(), error.strip())
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user