mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 03:53:32 +01:00
projects.py: Ongoing code beautification
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
fbf75b1220
commit
430a2173b2
1 changed files with 13 additions and 15 deletions
|
|
@ -87,6 +87,18 @@ class Projects(object):
|
|||
def err(self, *objs):
|
||||
print("ERR: ", *objs, file = sys.stderr)
|
||||
|
||||
def find_proj_path_unused(name):
|
||||
name = name.replace("dspider-", "")
|
||||
search_path = [".", "dspc/src", "dspc/src/dspcd-plugins", "dspc/src/io" ]
|
||||
for sub in search_path:
|
||||
path = self.projs_root + "/" + sub + "/" + name
|
||||
if os.path.exists(path):
|
||||
return os.path.abspath(path)
|
||||
raise Exception("module " + name + " not found below " + self.projs_root)
|
||||
|
||||
def find_proj_path_cached_unused(name):
|
||||
return self.res_cache.run(find_proj_path_unused, [ name ])
|
||||
|
||||
def proj_dir(self, name):
|
||||
if name == self.top_name:
|
||||
return self.topdir
|
||||
|
|
@ -451,18 +463,6 @@ class Projects(object):
|
|||
|
||||
def cmd_build(self, args_):
|
||||
|
||||
def find_proj_path(name):
|
||||
name = name.replace("dspider-", "")
|
||||
search_path = [".", "dspc/src", "dspc/src/dspcd-plugins", "dspc/src/io" ]
|
||||
for sub in search_path:
|
||||
path = self.projs_root + "/" + sub + "/" + name
|
||||
if os.path.exists(path):
|
||||
return os.path.abspath(path)
|
||||
raise Exception("module " + name + " not found below " + self.projs_root)
|
||||
|
||||
def find_proj_path_cached(name):
|
||||
return self.res_cache.run(find_proj_path, [ name ])
|
||||
|
||||
def read_deps(cur, prereq_type):
|
||||
# dep cache doesn't make a difference at all
|
||||
if prereq_type in self.dep_cache:
|
||||
|
|
@ -474,7 +474,6 @@ class Projects(object):
|
|||
r = self.get_modules_from_project_txt([ cur ], ['pkg.requires.jw'],
|
||||
prereq_type, scope = 2, add_self=False, names_only=True)
|
||||
self.debug('prerequisites = ' + ' '.join(r))
|
||||
|
||||
if cur in r:
|
||||
r.remove(cur)
|
||||
self.debug('inserting', prereq_type, "prerequisites of", cur, ":", ' '.join(r))
|
||||
|
|
@ -489,7 +488,6 @@ class Projects(object):
|
|||
if cur in all_deps:
|
||||
self.debug('already handled module ' + cur)
|
||||
return 0
|
||||
|
||||
deps = set()
|
||||
all_deps.add(cur)
|
||||
for t in prereq_types:
|
||||
|
|
@ -523,7 +521,7 @@ class Projects(object):
|
|||
def run_make(module, target, cur_project, num_projects):
|
||||
#make_cmd = "make " + target + " 2>&1"
|
||||
make_cmd = [ "make", target ]
|
||||
path = find_proj_path_cached(module)
|
||||
path = self.proj_dir(module)
|
||||
delim_len = 120
|
||||
delim = '---- [%d/%d]: running %s in %s -' % (cur_project, num_projects, make_cmd, path)
|
||||
delim = delim + '-' * (delim_len - len(delim))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue