mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-23 14:30:39 +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):
|
def read_deps(self, cur, prereq_type):
|
||||||
# dep cache doesn't make a difference at all
|
# 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 prereq_type in dep_cache:
|
||||||
if cur in dep_cache[prereq_type]:
|
if cur in dep_cache[prereq_type]:
|
||||||
return dep_cache[prereq_type][cur]
|
return dep_cache[prereq_type][cur]
|
||||||
else:
|
else:
|
||||||
dep_cache[prereq_type] = {}
|
dep_cache[prereq_type] = {}
|
||||||
cmd = projects_py + " prereq " + prereq_type + " " + cur
|
|
||||||
debug('running', cmd)
|
if True:
|
||||||
p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
|
r = get_modules_from_project_txt(cur, 'pkg.requires.jw',
|
||||||
p.wait()
|
prereq_type, scope = 2, add_self=False, names_only=True)
|
||||||
if p.returncode:
|
else: # legacy
|
||||||
raise Exception("failed to get " + prereq_type + " prerequisites for " + cur + ": " + cmd)
|
projects_py="/usr/bin/python2 " + my_dir + "/projects.py --prefix " + projs_root + " " + os.getenv('PROJECTS_PY_EXTRA_ARGS', "")
|
||||||
r = Set()
|
cmd = projects_py + " prereq " + prereq_type + " " + cur
|
||||||
pattern = re.compile(r'.*') # might be useful at a later point, currently pointless
|
debug('running', cmd)
|
||||||
for line in iter(p.stdout.readline,''):
|
p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
|
||||||
debug(cmd + ' returned: ', line)
|
p.wait()
|
||||||
if not pattern.match(line):
|
if p.returncode:
|
||||||
continue
|
raise Exception("failed to get " + prereq_type + " prerequisites for " + cur + ": " + cmd)
|
||||||
for d in line.split():
|
r = Set()
|
||||||
r.add(d)
|
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:
|
if cur in r:
|
||||||
r.remove(cur)
|
r.remove(cur)
|
||||||
debug('inserting', prereq_type, "prerequisites of", cur, ":", ' '.join(r))
|
debug('inserting', prereq_type, "prerequisites of", cur, ":", ' '.join(r))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue