mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-06 23:40:29 +03:00
Handle ssh output buffering better
This commit is contained in:
parent
6e87f82522
commit
a404397014
1 changed files with 9 additions and 4 deletions
|
|
@ -216,8 +216,6 @@ def build_server(app, thisbuild, vcs, build_dir, output_dir, sdk_path, force):
|
||||||
# Execute the build script...
|
# Execute the build script...
|
||||||
print "Starting build..."
|
print "Starting build..."
|
||||||
chan = sshs.get_transport().open_session()
|
chan = sshs.get_transport().open_session()
|
||||||
stdoutf = chan.makefile('r')
|
|
||||||
stderrf = chan.makefile_stderr('r')
|
|
||||||
cmdline = 'python build.py --on-server'
|
cmdline = 'python build.py --on-server'
|
||||||
if force:
|
if force:
|
||||||
cmdline += ' --force --test'
|
cmdline += ' --force --test'
|
||||||
|
|
@ -226,9 +224,16 @@ def build_server(app, thisbuild, vcs, build_dir, output_dir, sdk_path, force):
|
||||||
output = ''
|
output = ''
|
||||||
error = ''
|
error = ''
|
||||||
while not chan.exit_status_ready():
|
while not chan.exit_status_ready():
|
||||||
output += stdoutf.read()
|
while chan.recv_ready():
|
||||||
error += stderrf.read()
|
output += chan.recv(1024)
|
||||||
|
while chan.recv_stderr_ready():
|
||||||
|
error += chan.recv_stderr(1024)
|
||||||
|
print "...getting exit status"
|
||||||
returncode = chan.recv_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:
|
if returncode != 0:
|
||||||
raise BuildException("Build.py failed on server for %s:%s" % (app['id'], thisbuild['version']), output.strip(), error.strip())
|
raise BuildException("Build.py failed on server for %s:%s" % (app['id'], thisbuild['version']), output.strip(), error.strip())
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue