From 50f50e563d5afad04cb99965429c093dd4e1c4dc Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Fri, 21 Apr 2017 10:44:36 +0000 Subject: [PATCH] build.py: Fix missing global declaration Signed-off-by: Jan Lindemann --- scripts/build.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/build.py b/scripts/build.py index 7b7df75b..922aceed 100644 --- a/scripts/build.py +++ b/scripts/build.py @@ -95,17 +95,18 @@ def calculate_order(order, modules, prereq_type): return 1 def run_make(module, target): + global cur_project 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)) + print(',---------- %d/%d: running %s in %s -------------------------- >' % (cur_project, len(order), make_cmd, path)) 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('`---------- %d/%d: running %s in %s -------------------------- <' % (cur_project, len(order), make_cmd, path)) 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)