From 94403554237c4c40aa80ebfd3502654b29d2b46c Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Sun, 7 May 2017 14:18:18 +0000 Subject: [PATCH] build.py: Beautify output Signed-off-by: Jan Lindemann --- scripts/build.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/build.py b/scripts/build.py index 0f12a4fb..3d5d51c7 100644 --- a/scripts/build.py +++ b/scripts/build.py @@ -25,7 +25,7 @@ def find_proj_path(name): for sub in search_path: path=proj_base + "/" + sub + "/" + name if os.path.exists(path): - return path + return os.path.abspath(path) raise Exception("module " + name + " not found below " + proj_base) def read_deps(cur, prereq_type): @@ -86,14 +86,18 @@ def run_make(module, target): cur_project=cur_project+1 make_cmd = "make " + target + " 2>&1" path = find_proj_path(module) - print(',---------- %d/%d: running %s in %s -------------------------- >' % (cur_project, len(order), make_cmd, path)) + delim_len=120 + delim='---- %d/%d: running %s in %s -' % (cur_project, len(order), make_cmd, path) + delim = delim + '-' * (delim_len - len(delim)) + + print(',' + delim + ' >') os.chdir(path) p = subprocess.Popen(make_cmd, shell=True, stdout=subprocess.PIPE) for line in iter(p.stdout.readline, ''): sys.stdout.write('| ' + line) # avoid extra newlines from print() sys.stdout.flush() p.wait() - print('`---------- %d/%d: running %s in %s -------------------------- <' % (cur_project, len(order), make_cmd, path)) + print('`' + delim + ' <') if p.returncode: print(make_cmd + ' failed') raise Exception(time.strftime("%Y-%m-%d %H:%M") + ": failed to make target " + target + " in module " + module + " below base " + proj_base)