mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-24 17:23:36 +02:00
jw.pkg.cmds.projects.CmdBuild: Make run_make() async
Make the call chain to Popen(make ...) async, in preparation for the next commit. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
75faf02232
commit
0cb6a7972c
1 changed files with 7 additions and 7 deletions
|
|
@ -83,7 +83,7 @@ class CmdBuild(Cmd): # export
|
||||||
dep_tree[k].remove(d)
|
dep_tree[k].remove(d)
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
def run_make(module, target, cur_project, num_projects):
|
async def run_make(module, target, cur_project, num_projects):
|
||||||
#make_cmd = "make " + target + " 2>&1"
|
#make_cmd = "make " + target + " 2>&1"
|
||||||
make_cmd = [ "make", target ]
|
make_cmd = [ "make", target ]
|
||||||
path = self.app.find_dir(module, pretty=False)
|
path = self.app.find_dir(module, pretty=False)
|
||||||
|
|
@ -111,13 +111,13 @@ class CmdBuild(Cmd): # export
|
||||||
print(' '.join(make_cmd) + ' failed')
|
print(' '.join(make_cmd) + ' failed')
|
||||||
raise Exception(time.strftime("%Y-%m-%d %H:%M") + ": failed to make target " + target + " in module " + module + " below base " + self.app.projs_root)
|
raise Exception(time.strftime("%Y-%m-%d %H:%M") + ": failed to make target " + target + " in module " + module + " below base " + self.app.projs_root)
|
||||||
|
|
||||||
def run_make_on_modules(modules, order, target):
|
async def run_make_on_modules(modules, order, target):
|
||||||
cur_project = 0
|
cur_project = 0
|
||||||
num_projects = len(order)
|
num_projects = len(order)
|
||||||
if target in ["clean", "distclean"]:
|
if target in ["clean", "distclean"]:
|
||||||
for m in reversed(order):
|
for m in reversed(order):
|
||||||
cur_project += 1
|
cur_project += 1
|
||||||
run_make(m, target, cur_project, num_projects)
|
await run_make(m, target, cur_project, num_projects)
|
||||||
if m in modules:
|
if m in modules:
|
||||||
modules.remove(m)
|
modules.remove(m)
|
||||||
if not len(modules):
|
if not len(modules):
|
||||||
|
|
@ -126,9 +126,9 @@ class CmdBuild(Cmd): # export
|
||||||
else:
|
else:
|
||||||
for m in order:
|
for m in order:
|
||||||
cur_project += 1
|
cur_project += 1
|
||||||
run_make(m, target, cur_project, num_projects)
|
await run_make(m, target, cur_project, num_projects)
|
||||||
|
|
||||||
def run(args):
|
async def run(args):
|
||||||
|
|
||||||
log(DEBUG, "----------------------------------------- running ", ' '.join(sys.argv))
|
log(DEBUG, "----------------------------------------- running ", ' '.join(sys.argv))
|
||||||
|
|
||||||
|
|
@ -169,10 +169,10 @@ class CmdBuild(Cmd): # export
|
||||||
if args.dry_run:
|
if args.dry_run:
|
||||||
exit(0)
|
exit(0)
|
||||||
|
|
||||||
run_make_on_modules(modules, order, target)
|
await run_make_on_modules(modules, order, target)
|
||||||
|
|
||||||
print(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
|
print(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
|
||||||
|
|
||||||
dep_cache: dict[dict[str, str]] = {}
|
dep_cache: dict[dict[str, str]] = {}
|
||||||
|
|
||||||
run(args)
|
await run(args)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue