def get_recursive_dependencies_on(distro, package_names, excludes=None, limit=None, source=False):
    excludes = set(excludes or [])
    limit = set(limit or [])
    dependencies = set([])
    if source and distro.source_packages:
        walker = SourceDependencyWalker(distro)
    else:
        walker = DependencyWalker(distro)

    # to improve performance limit search space if possible
    if limit:
        released_names, _ = get_package_names(distro)
        excludes.update(set(released_names) - limit - set(package_names))

    # redirect all stderr output to logger
    stderr = sys.stderr
    sys.stderr = CustomLogger()
    try:
        for pkg_name in package_names:
            dependencies |= walker.get_recursive_depends_on(
                pkg_name,
                ['buildtool', 'buildtool_export', 'build', 'build_export', 'run', 'test'],
                ignore_pkgs=dependencies | excludes)
    finally:
        sys.stderr = stderr
    dependencies -= set(package_names)
    return dependencies
Beispiel #2
0
def get_recursive_dependencies_on(distro,
                                  package_names,
                                  excludes=None,
                                  limit=None,
                                  source=False):
    excludes = set(excludes or [])
    limit = set(limit or [])
    dependencies = set([])
    if source and distro.source_packages:
        walker = SourceDependencyWalker(distro)
    else:
        walker = DependencyWalker(distro)

    # to improve performance limit search space if possible
    if limit:
        released_names, _ = get_package_names(distro)
        excludes.update(set(released_names) - limit - set(package_names))

    # redirect all stderr output to logger
    stderr = sys.stderr
    sys.stderr = CustomLogger()
    try:
        for pkg_name in package_names:
            dependencies |= walker.get_recursive_depends_on(
                pkg_name, [
                    'buildtool', 'buildtool_export', 'build', 'build_export',
                    'run', 'test'
                ],
                ignore_pkgs=dependencies | excludes)
    finally:
        sys.stderr = stderr
    dependencies -= set(package_names)
    return dependencies
Beispiel #3
0
def get_recursive_dependencies(distro,
                               package_names,
                               excludes=None,
                               limit_depth=None,
                               source=False):
    excludes = set(excludes or [])
    dependencies = set([])
    if source and distro.source_packages:
        walker = SourceDependencyWalker(distro)
    else:
        walker = DependencyWalker(distro)
    # redirect all stderr output to logger
    stderr = sys.stderr
    sys.stderr = CustomLogger()
    try:
        for pkg_name in package_names:
            try:
                dependencies |= walker.get_recursive_depends(
                    pkg_name, [
                        'buildtool', 'buildtool_export', 'build',
                        'build_export', 'run', 'test'
                    ],
                    ros_packages_only=True,
                    ignore_pkgs=dependencies | excludes,
                    limit_depth=limit_depth)
            except AssertionError as e:
                raise RuntimeError(
                    "Failed to fetch recursive dependencies of package '%s': %s"
                    % (pkg_name, e))
    finally:
        sys.stderr = stderr
    dependencies -= set(package_names)
    return dependencies
def get_recursive_dependencies(distro, package_names, excludes=None, limit_depth=None, source=False):
    excludes = set(excludes or [])
    dependencies = set([])
    if source and distro.source_packages:
        walker = SourceDependencyWalker(distro)
    else:
        walker = DependencyWalker(distro)
    # redirect all stderr output to logger
    stderr = sys.stderr
    sys.stderr = CustomLogger()
    try:
        for pkg_name in package_names:
            try:
                dependencies |= walker.get_recursive_depends(pkg_name, ['buildtool', 'build', 'run', 'test'], ros_packages_only=True, ignore_pkgs=dependencies | excludes, limit_depth=limit_depth)
            except AssertionError as e:
                raise RuntimeError("Failed to fetch recursive dependencies of package '%s': %s" % (pkg_name, e))
    finally:
        sys.stderr = stderr
    dependencies -= set(package_names)
    return dependencies