mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 20:13:32 +01:00
projects.py: Disable superfluous invocations of projects.py
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
cd2efda598
commit
fd2ca4f6ff
1 changed files with 20 additions and 15 deletions
|
|
@ -69,26 +69,31 @@ class Build(object):
|
|||
|
||||
def read_deps(self, cur, prereq_type):
|
||||
# dep cache doesn't make a difference at all
|
||||
projects_py="/usr/bin/python2 " + my_dir + "/projects.py --prefix " + projs_root + " " + os.getenv('PROJECTS_PY_EXTRA_ARGS', "")
|
||||
if prereq_type in dep_cache:
|
||||
if cur in dep_cache[prereq_type]:
|
||||
return dep_cache[prereq_type][cur]
|
||||
else:
|
||||
dep_cache[prereq_type] = {}
|
||||
cmd = projects_py + " prereq " + prereq_type + " " + cur
|
||||
debug('running', cmd)
|
||||
p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
|
||||
p.wait()
|
||||
if p.returncode:
|
||||
raise Exception("failed to get " + prereq_type + " prerequisites for " + cur + ": " + cmd)
|
||||
r = Set()
|
||||
pattern = re.compile(r'.*') # might be useful at a later point, currently pointless
|
||||
for line in iter(p.stdout.readline,''):
|
||||
debug(cmd + ' returned: ', line)
|
||||
if not pattern.match(line):
|
||||
continue
|
||||
for d in line.split():
|
||||
r.add(d)
|
||||
|
||||
if True:
|
||||
r = get_modules_from_project_txt(cur, 'pkg.requires.jw',
|
||||
prereq_type, scope = 2, add_self=False, names_only=True)
|
||||
else: # legacy
|
||||
projects_py="/usr/bin/python2 " + my_dir + "/projects.py --prefix " + projs_root + " " + os.getenv('PROJECTS_PY_EXTRA_ARGS', "")
|
||||
cmd = projects_py + " prereq " + prereq_type + " " + cur
|
||||
debug('running', cmd)
|
||||
p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
|
||||
p.wait()
|
||||
if p.returncode:
|
||||
raise Exception("failed to get " + prereq_type + " prerequisites for " + cur + ": " + cmd)
|
||||
r = Set()
|
||||
pattern = re.compile(r'.*') # might be useful at a later point, currently pointless
|
||||
for line in iter(p.stdout.readline,''):
|
||||
debug(cmd + ' returned: ', line)
|
||||
if not pattern.match(line):
|
||||
continue
|
||||
for d in line.split():
|
||||
r.add(d)
|
||||
if cur in r:
|
||||
r.remove(cur)
|
||||
debug('inserting', prereq_type, "prerequisites of", cur, ":", ' '.join(r))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue