示例#1
0
def main(opts, per_package_main=build_pkg_main):
    # use PWD in order to work when being invoked in a symlinked location
    cwd = os.getenv('PWD', os.curdir)
    opts.directory = os.path.abspath(os.path.join(cwd, opts.directory))
    if not os.path.exists(opts.basepath):
        raise RuntimeError("The specified base path '%s' does not exist" %
                           opts.basepath)
    opts.build_space = determine_path_argument(
        cwd, opts.directory, opts.build_space,
        'build' if not opts.isolated else 'build_isolated')
    opts.install_space = determine_path_argument(
        cwd, opts.directory, opts.install_space,
        'install' if not opts.isolated else 'install_isolated')

    packages = topological_order(opts.basepath)

    circular_dependencies = [
        package_names for path, package_names, _ in packages if path is None
    ]
    if circular_dependencies:
        raise VerbExecutionError('Circular dependency within the following '
                                 'packages: %s' % circular_dependencies[0])

    pkg_names = [p.name for _, p, _ in packages]
    check_opts(opts, pkg_names)
    consolidate_package_selection(opts, pkg_names)
    print_topological_order(opts, pkg_names)

    if set(pkg_names) <= set(opts.skip_packages):
        print('All selected packages are being skipped. Nothing to do.',
              file=sys.stderr)
        return 0

    return iterate_packages(opts, packages, per_package_main)
示例#2
0
文件: cli.py 项目: ament/ament_tools
def main(opts, per_package_main=build_pkg_main):
    # use PWD in order to work when being invoked in a symlinked location
    cwd = os.getenv('PWD', os.curdir)
    opts.directory = os.path.abspath(os.path.join(cwd, opts.directory))
    if not os.path.exists(opts.basepath):
        raise RuntimeError("The specified base path '%s' does not exist" %
                           opts.basepath)
    opts.build_space = determine_path_argument(
        cwd, opts.directory, opts.build_space,
        'build' if not opts.isolated else 'build_isolated')
    opts.install_space = determine_path_argument(
        cwd, opts.directory, opts.install_space,
        'install' if not opts.isolated else 'install_isolated')

    packages = topological_order(opts.basepath)

    circular_dependencies = [
        package_names for path, package_names, _ in packages if path is None]
    if circular_dependencies:
        raise VerbExecutionError('Circular dependency within the following '
                                 'packages: %s' % circular_dependencies[0])

    pkg_names = [p.name for _, p, _ in packages]
    check_opts(opts, pkg_names)
    consolidate_package_selection(opts, pkg_names)
    print_topological_order(opts, pkg_names)

    if set(pkg_names) <= set(opts.skip_packages):
        print('All selected packages are being skipped. Nothing to do.',
              file=sys.stderr)
        return 0

    return iterate_packages(opts, packages, per_package_main)
示例#3
0
def main(opts, per_package_main=build_pkg_main):
    # use PWD in order to work when being invoked in a symlinked location
    cwd = os.getenv('PWD', os.curdir)
    opts.directory = os.path.abspath(os.path.join(cwd, opts.directory))
    if not os.path.exists(opts.basepath):
        raise RuntimeError("The specified base path '%s' does not exist" %
                           opts.basepath)
    opts.build_space = determine_path_argument(
        cwd, opts.directory, opts.build_space,
        'build' if not opts.isolated else 'build_isolated')
    opts.install_space = determine_path_argument(
        cwd, opts.directory, opts.install_space,
        'install' if not opts.isolated else 'install_isolated')

    packages = topological_order(opts.basepath)

    circular_dependencies = [
        package_names for path, package_names, _ in packages if path is None
    ]
    if circular_dependencies:
        raise VerbExecutionError('Circular dependency within the following '
                                 'packages: %s' % circular_dependencies[0])

    print_topological_order(opts, packages)

    iterate_packages(opts, packages, per_package_main)
示例#4
0
def main(opts, per_package_main=build_pkg_main):
    # use PWD in order to work when being invoked in a symlinked location
    cwd = os.getenv('PWD', os.curdir)
    opts.directory = os.path.abspath(os.path.join(cwd, opts.directory))
    if not os.path.exists(opts.basepath):
        raise RuntimeError("The specified base path '%s' does not exist" %
                           opts.basepath)
    opts.build_space = determine_path_argument(
        cwd, opts.directory, opts.build_space,
        'build' if not opts.isolated else 'build_isolated')
    opts.install_space = determine_path_argument(
        cwd, opts.directory, opts.install_space,
        'install' if not opts.isolated else 'install_isolated')

    packages = topological_order(opts.basepath)

    circular_dependencies = [
        package_names for path, package_names, _ in packages if path is None]
    if circular_dependencies:
        raise VerbExecutionError('Circular dependency within the following '
                                 'packages: %s' % circular_dependencies[0])

    print_topological_order(opts, packages)

    iterate_packages(opts, packages, per_package_main)
示例#5
0
文件: cli.py 项目: ament/ament_tools
def update_options(opts):
    # use PWD in order to work when being invoked in a symlinked location
    cwd = os.getenv('PWD', os.curdir)
    # no -C / --directory argument yet
    opts.directory = cwd
    opts.path = determine_path_argument(cwd, opts.directory, opts.path,
                                        os.curdir)
    opts.build_space = determine_path_argument(cwd, opts.directory,
                                               opts.build_space, 'build')
    opts.install_space = determine_path_argument(cwd, opts.directory,
                                                 opts.install_space, 'install')

    try:
        validate_package_path(opts.path)
    except ValueError as exc:
        sys.exit('Error: {0}'.format(exc))
示例#6
0
def update_options(opts):
    # use PWD in order to work when being invoked in a symlinked location
    cwd = os.getenv('PWD', os.curdir)
    # no -C / --directory argument yet
    opts.directory = cwd
    opts.path = determine_path_argument(cwd, opts.directory, opts.path,
                                        os.curdir)
    opts.build_space = determine_path_argument(cwd, opts.directory,
                                               opts.build_space, 'build')
    opts.install_space = determine_path_argument(cwd, opts.directory,
                                                 opts.install_space, 'install')

    try:
        validate_package_path(opts.path)
    except ValueError as exc:
        sys.exit("Error: {0}".format(exc))