roscreate-stack: improvements to ros_comm dependency detection and license list

This commit is contained in:
Ken Conley 2010-12-29 00:16:13 +00:00
parent f56fa3ac07
commit 1559239bd1
1 changed files with 13 additions and 3 deletions

View File

@ -146,7 +146,7 @@ def compute_stack_depends_and_licenses(stack_dir):
depends = dict()
licenses = ['BSD']
# add in bare ros dependency into any stack as an implicit depend
if not 'ros' in depends:
if not 'ros' in depends and stack != 'ros':
depends['ros'] = []
return depends, licenses
@ -156,7 +156,7 @@ def _compute_stack_depends_and_licenses(stack, packages):
for pkg in packages:
m = roslib.manifest.parse_file(roslib.manifest.manifest_file(pkg))
pkg_depends.extend([d.package for d in m.depends])
licenses.append(m.license)
licenses.extend([l.strip() for l in m.license.split(',')])
stack_depends = {}
for pkg in pkg_depends:
@ -173,8 +173,18 @@ def _compute_stack_depends_and_licenses(stack, packages):
if st == stack:
continue
if not st in stack_depends:
stack_depends[st] = []
stack_depends[st] = []
stack_depends[st].append(pkg)
# check for genmsg implicit dependency
pkg_dir = roslib.packages.get_pkg_dir(pkg)
if (os.path.isdir(os.path.join(pkg_dir, 'msg')) or \
os.path.isdir(os.path.join(pkg_dir, 'srv'))) and \
st not in ['ros', 'ros_comm']:
if not 'ros_comm' in stack_depends:
stack_depends['ros_comm'] = []
stack_depends['ros_comm'].append(pkg)
return stack_depends, set(licenses)
def roscreatestack_main():