From 1559239bd199d5293f424486dbb7c39794779352 Mon Sep 17 00:00:00 2001 From: Ken Conley Date: Wed, 29 Dec 2010 00:16:13 +0000 Subject: [PATCH] roscreate-stack: improvements to ros_comm dependency detection and license list --- tools/roscreate/src/roscreate/roscreatestack.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tools/roscreate/src/roscreate/roscreatestack.py b/tools/roscreate/src/roscreate/roscreatestack.py index 83c0ad9b..2e8c4ef4 100644 --- a/tools/roscreate/src/roscreate/roscreatestack.py +++ b/tools/roscreate/src/roscreate/roscreatestack.py @@ -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():