mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-21 05:47:38 +01:00
build.py: Beautify output
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
d2bf308719
commit
9440355423
1 changed files with 7 additions and 3 deletions
|
|
@ -25,7 +25,7 @@ def find_proj_path(name):
|
||||||
for sub in search_path:
|
for sub in search_path:
|
||||||
path=proj_base + "/" + sub + "/" + name
|
path=proj_base + "/" + sub + "/" + name
|
||||||
if os.path.exists(path):
|
if os.path.exists(path):
|
||||||
return path
|
return os.path.abspath(path)
|
||||||
raise Exception("module " + name + " not found below " + proj_base)
|
raise Exception("module " + name + " not found below " + proj_base)
|
||||||
|
|
||||||
def read_deps(cur, prereq_type):
|
def read_deps(cur, prereq_type):
|
||||||
|
|
@ -86,14 +86,18 @@ def run_make(module, target):
|
||||||
cur_project=cur_project+1
|
cur_project=cur_project+1
|
||||||
make_cmd = "make " + target + " 2>&1"
|
make_cmd = "make " + target + " 2>&1"
|
||||||
path = find_proj_path(module)
|
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)
|
os.chdir(path)
|
||||||
p = subprocess.Popen(make_cmd, shell=True, stdout=subprocess.PIPE)
|
p = subprocess.Popen(make_cmd, shell=True, stdout=subprocess.PIPE)
|
||||||
for line in iter(p.stdout.readline, ''):
|
for line in iter(p.stdout.readline, ''):
|
||||||
sys.stdout.write('| ' + line) # avoid extra newlines from print()
|
sys.stdout.write('| ' + line) # avoid extra newlines from print()
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
p.wait()
|
p.wait()
|
||||||
print('`---------- %d/%d: running %s in %s -------------------------- <' % (cur_project, len(order), make_cmd, path))
|
print('`' + delim + ' <')
|
||||||
if p.returncode:
|
if p.returncode:
|
||||||
print(make_cmd + ' failed')
|
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)
|
raise Exception(time.strftime("%Y-%m-%d %H:%M") + ": failed to make target " + target + " in module " + module + " below base " + proj_base)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue