Return value acquisition from rmbuild fixed

Signed-off-by: Jojojoppe <joppe@blondel.nl>
This commit is contained in:
2022-09-14 21:55:54 +02:00
parent 78205b90f2
commit 646440493f

View File

@ -69,9 +69,10 @@ def recv_dir(channel, dr):
print("<<<", dr) print("<<<", dr)
cmd(b'ls'+sstr(dr), channel) cmd(b'ls'+sstr(dr), channel)
while True: while True:
status = channel.recv(2) status = channel.recv(1)
if status != b'\x00\x00': if status != b'\x00':
break break
status += channel.recv(1)
if status!=b'OK': if status!=b'OK':
msg = channel.recv(1024) msg = channel.recv(1024)
print("Error:", bytes.decode(msg, 'ascii')) print("Error:", bytes.decode(msg, 'ascii'))
@ -170,7 +171,7 @@ if __name__=="__main__":
# Send config # Send config
cmd(b'cf' + sstr(json.dumps({s:dict(config.items(s)) for s in config.sections()})), channel) cmd(b'cf' + sstr(json.dumps({s:dict(config.items(s)) for s in config.sections()})), channel)
print("Target", target) print("LOCAL: Target", target)
toolchain = config.get(f'target.{target}', 'toolchain', fallback='NONE') toolchain = config.get(f'target.{target}', 'toolchain', fallback='NONE')
if toolchain=='NONE': if toolchain=='NONE':
@ -190,7 +191,11 @@ if __name__=="__main__":
send_file(channel, f) send_file(channel, f)
cmd(b'do'+sstr(target), channel) cmd(b'do'+sstr(target), channel)
status = channel.recv(2) while True:
status = channel.recv(1)
if status!='b\x00':
break
status += channel.recv(1)
end = -1 end = -1
while end<0: while end<0:
data = channel.recv(8) data = channel.recv(8)
@ -200,7 +205,7 @@ if __name__=="__main__":
print(str(data, 'utf-8'), end='', flush=True) print(str(data, 'utf-8'), end='', flush=True)
sys.stdout.flush() sys.stdout.flush()
ret = 0 ret = int.from_bytes(channel.recv(4), 'big')
# Receive output dir # Receive output dir
recv_dir(channel, config.get('project', 'out_dir', fallback='out')) recv_dir(channel, config.get('project', 'out_dir', fallback='out'))