Ejemplo n.º 1
0
def get_dependencies(workspace, repository_dict, rosdistro):
    build_dependencies = {}
    runtime_dependencies = {}

    packages = {}
    package_urls = {}

    #print repository_dict
    for name, r in sorted(repository_dict.items()):
        if 'url' not in r:
            print "'url' key missing for repository %s; skipping"%(r)
            continue
        url = r['url']
        print "downloading from %s into %s to be able to trace dependencies" % (url, workspace)
        try:
            stack = get_stack_of_remote_repository(name, 'git', url, workspace)
        except IOError, e:
            if rosdistro == 'backports':
                packages[name] = sanitize_package_name(name)
                build_dependencies[name] = []
                runtime_dependencies[name] = []
                package_urls[name] = url
                print "Processing backport %s, no package.xml file found in repo %s. Continuing"%(name, url)
            else:
                print str(e)
            continue

        catkin_project_name = stack.name

        packages[catkin_project_name] = debianize_package_name(rosdistro, catkin_project_name)

        build_dependencies[catkin_project_name] = [d.name for d in stack.build_depends]
        runtime_dependencies[catkin_project_name] = [d.name for d in stack.depends]

        package_urls[catkin_project_name] = url
Ejemplo n.º 2
0
def get_dependencies(rosdistro, stacks):
    packages = {}
    build_dependencies = {}
    runtime_dependencies = {}

    for name in sorted(stacks.keys()):
        stack = stacks[name]

        if stack is None:
            packages[name] = sanitize_package_name(name)
            build_dependencies[name] = []
            runtime_dependencies[name] = []
        else:
            catkin_project_name = stack.name
            packages[catkin_project_name] = debianize_package_name(rosdistro, catkin_project_name)
            build_dependencies[catkin_project_name] = [d.name for d in stack.build_depends]
            runtime_dependencies[catkin_project_name] = [d.name for d in stack.depends]

    result = {}
    # combines direct buildtime- and recursive runtime-dependencies
    for k in packages.keys():
        #print '\nDependencies for: ', k
        build_deps = _get_dependencies(build_dependencies, k, packages)
        # recursive runtime depends of build depends
        recursive_runtime_dependencies = _get_dependencies(runtime_dependencies, k, packages, True)
        #print 'Recursive runtime-dependencies:', ', '.join(recursive_runtime_dependencies)
        result[packages[k]] = build_deps | recursive_runtime_dependencies
        #print 'Combined dependencies:', ', '.join(result[packages[k]])
    return result
Ejemplo n.º 3
0
def get_dependencies(rosdistro, stacks):
    packages = {}
    build_dependencies = {}
    runtime_dependencies = {}

    for name in sorted(stacks.keys()):
        stack = stacks[name]

        if stack is None:
            packages[name] = sanitize_package_name(name)
            build_dependencies[name] = []
            runtime_dependencies[name] = []
        else:
            catkin_project_name = stack.name
            packages[catkin_project_name] = debianize_package_name(
                rosdistro, catkin_project_name)
            build_dependencies[catkin_project_name] = [
                d.name for d in stack.build_depends
            ]
            runtime_dependencies[catkin_project_name] = [
                d.name for d in stack.depends
            ]

    result = {}
    # combines direct buildtime- and recursive runtime-dependencies
    for k in packages.keys():
        #print '\nDependencies for: ', k
        build_deps = _get_dependencies(build_dependencies, k, packages)
        # recursive runtime depends of build depends
        recursive_runtime_dependencies = _get_dependencies(
            runtime_dependencies, k, packages, True)
        #print 'Recursive runtime-dependencies:', ', '.join(recursive_runtime_dependencies)
        result[packages[k]] = build_deps | recursive_runtime_dependencies
        #print 'Combined dependencies:', ', '.join(result[packages[k]])
    return result