Example #1
0
def test_workflow():
    try:
        installer = get_installer(APT_INSTALLER)
        view = get_catkin_view('fuerte', 'ubuntu', 'lucid')
        resolved = resolve_for_os('cmake', view, installer, 'ubuntu', 'lucid')
        assert ['cmake'] == resolved
        resolved = resolve_for_os('python', view, installer, 'ubuntu', 'lucid')
        assert resolved == ['python-dev']
    except ValidationFailed:
        # tests fail on the server because 'rosdep init' has not been run
        pass
def test_workflow():
    try:
        installer = get_installer(APT_INSTALLER)
        view = get_catkin_view("fuerte", "ubuntu", "lucid")
        resolved = resolve_for_os("cmake", view, installer, "ubuntu", "lucid")
        assert ["cmake"] == resolved
        resolved = resolve_for_os("python", view, installer, "ubuntu", "lucid")
        assert resolved == ["python-dev"]
    except ValidationFailed:
        # tests fail on the server because 'rosdep init' has not been run
        pass
Example #3
0
 def resolve_rosdep_key(rosdep_key, view, try_again=True):
     from rosdep2.catkin_support import resolve_for_os
     from rosdep2.lookup import ResolutionError
     try:
         return resolve_for_os(rosdep_key, view,
                               self.apt_installer, os_name,
                               debian_distro)
     except (KeyError, ResolutionError) as err:
         if rosdep_key in self.packages:
             return [sanitize_package_name(
                 'ros-{0}-{1}'.format(self.rosdistro, rosdep_key)
             )]
         if type(err) == KeyError:
             error(
                 "Could not resolve rosdep key '" + rosdep_key + "'"
             )
         else:
             error(
                 "Could not resolve the rosdep key '" + rosdep_key +
                 "' for distro '" + debian_distro + "': \n"
             )
             info(str(err), use_prefix=False)
         if try_again:
             error("Resolve problem with rosdep and then continue to try again.")
             if maybe_continue():
                 self.update_rosdep()
                 new_view = self.get_rosdep_view(debian_distro, os_name)
                 return resolve_rosdep_key(rosdep_key, new_view)
         self.exit("Failed to resolve rosdep key '{0}', aborting."
             .format(rosdep_key))
Example #4
0
def resolve_rosdep_key(key, os_name, os_version, ros_distro=None, ignored=None, retry=True):
    ignored = ignored or []
    ctx = create_default_installer_context()
    try:
        installer_key = ctx.get_default_os_installer_key(os_name)
    except KeyError:
        BloomGenerator.exit("Could not determine the installer for '{0}'".format(os_name))
    installer = ctx.get_installer(installer_key)
    ros_distro = ros_distro or DEFAULT_ROS_DISTRO
    view = get_view(os_name, os_version, ros_distro)
    try:
        return resolve_for_os(key, view, installer, os_name, os_version)
    except (KeyError, ResolutionError) as exc:
        debug(traceback.format_exc())
        if key in ignored:
            return None
        if isinstance(exc, KeyError):
            error("Could not resolve rosdep key '{0}'".format(key))
        else:
            error("Could not resolve rosdep key '{0}' for distro '{1}':".format(key, os_version))
            info(str(exc), use_prefix=False)
        if retry:
            error("Try to resolve the problem with rosdep and then continue.")
            if maybe_continue():
                update_rosdep()
                invalidate_view_cache()
                return resolve_rosdep_key(key, os_name, os_version, ros_distro, ignored, retry=True)
        BloomGenerator.exit("Failed to resolve rosdep key '{0}', aborting.".format(key))
def resolve_names(rosdep_keys, os_name, os_code_name, view, installer):
    debian_pkg_names = set([])
    for rosdep_key in sorted(rosdep_keys):
        try:
            resolved_names = resolve_for_os(
                rosdep_key, view, installer, os_name, os_code_name)
        except KeyError:
            raise RuntimeError(
                "Could not resolve the rosdep key '%s'" % rosdep_key)
        debian_pkg_names.update(resolved_names)
    print('Resolved the dependencies to the following binary packages:')
    for debian_pkg_name in sorted(debian_pkg_names):
        print('  -', debian_pkg_name)
    return debian_pkg_names
Example #6
0
def resolve_names(rosdep_keys, os_name, os_code_name, view, installer):
    debian_pkg_names = set([])
    for rosdep_key in sorted(rosdep_keys):
        try:
            resolved_names = resolve_for_os(rosdep_key, view, installer,
                                            os_name, os_code_name)
        except KeyError:
            raise RuntimeError("Could not resolve the rosdep key '%s'" %
                               rosdep_key)
        debian_pkg_names.update(resolved_names)
    print('Resolved the dependencies to the following binary packages:')
    for debian_pkg_name in sorted(debian_pkg_names):
        print('  -', debian_pkg_name)
    return debian_pkg_names
def resolve_names(rosdep_keys, os_name, os_code_name, view, installer):
    debian_pkg_names = set([])
    for rosdep_key in sorted(rosdep_keys):
        try:
            resolved_names = resolve_for_os(
                rosdep_key, view, installer, os_name, os_code_name)
        except KeyError:
            print(("Could not resolve the rosdep key '%s', ignoring " +
                   "dependency") % rosdep_key, file=sys.stderr)
            continue
        debian_pkg_names.update(resolved_names)
    print('Resolved the dependencies to the following binary packages:')
    for debian_pkg_name in sorted(debian_pkg_names):
        print('  -', debian_pkg_name)
    return debian_pkg_names
Example #8
0
 def resolve_rosdep_key(rosdep_key):
     from rosdep2.catkin_support import resolve_for_os
     from rosdep2.lookup import ResolutionError
     try:
         return resolve_for_os(rosdep_key, rosdep_view,
                               self.apt_installer, os_name,
                               debian_distro)
     except KeyError:
         error("Could not resolve rosdep key '" + rosdep_key + "'")
         self.exit(code.DEBIAN_NO_SUCH_ROSDEP_KEY)
     except ResolutionError as err:
         error("Could not resolve the rosdep key '" + rosdep_key + \
               "' for distro '" + debian_distro + "': \n")
         print(str(err))
         self.exit(code.DEBIAN_NO_ROSDEP_KEY_FOR_DISTRO)
Example #9
0
def resolve_names(rosdep_keys, os_name, os_code_name, view, installer):
    debian_pkg_names = set([])
    for rosdep_key in sorted(rosdep_keys):
        try:
            resolved_names = resolve_for_os(
                rosdep_key, view, installer, os_name, os_code_name)
        except KeyError:
            print(("Could not resolve the rosdep key '%s', ignoring " +
                   "dependency") % rosdep_key, file=sys.stderr)
            continue
        debian_pkg_names.update(resolved_names)
    print('Resolved the dependencies to the following binary packages:')
    for debian_pkg_name in sorted(debian_pkg_names):
        print('  -', debian_pkg_name)
    return debian_pkg_names
Example #10
0
def resolve_rosdep_key(key,
                       os_name,
                       os_version,
                       ros_distro=None,
                       ignored=None,
                       retry=True):
    ignored = ignored or []
    if os_name not in default_installers:
        BloomGenerator.exit(
            "Could not determine the installer for '{0}'".format(os_name))
    installer = get_installer(default_installers[os_name][0])
    ros_distro = ros_distro or DEFAULT_ROS_DISTRO
    view = get_view(os_name, os_version, ros_distro)
    try:
        return resolve_for_os(key, view, installer, os_name, os_version)
    except (KeyError, ResolutionError) as exc:
        debug(traceback.format_exc())
        if key in ignored:
            return None
        if isinstance(exc, KeyError):
            error("Could not resolve rosdep key '{0}'".format(key))
        else:
            error(
                "Could not resolve rosdep key '{0}' for distro '{1}':".format(
                    key, os_version))
            info(str(exc), use_prefix=False)
        if retry:
            error("Try to resolve the problem with rosdep and then continue.")
            if maybe_continue():
                update_rosdep()
                invalidate_view_cache()
                return resolve_rosdep_key(key,
                                          os_name,
                                          os_version,
                                          ros_distro,
                                          ignored,
                                          retry=True)
        BloomGenerator.exit(
            "Failed to resolve rosdep key '{0}', aborting.".format(key))
def resolve_rosdeps(rosdep_keys, rosdistro_name, os_name, os_platform):
    """
    :raises: :exc:`rosdep2.catkin_support.ValidationFailed`
    :raises: :exc:`KeyError`
    :raises: :exc:`rosdep2.ResolutionError`
    """
    assert os_name == OS_FEDORA
    assert os_platform
    assert type(rosdep_keys) == list

    # use the catkin_support module in rosdep2 as it does the same business

    # apt-install resolves data
    yum_installer = get_installer(YUM_INSTALLER)
    # rosdep view is our view into the rosdep database
    rosdep_view = get_catkin_view(rosdistro_name, os_name, os_platform)

    # iterate through all our keys to resolve
    fedora_deps = set()
    for dep in rosdep_keys:
        resolved = resolve_for_os(dep, rosdep_view, yum_installer, os_name, os_platform)
        fedora_deps.update(resolved)
    return list(fedora_deps)
def resolve_rosdeps(rosdep_keys, rosdistro_name, os_name, os_platform):
    """
    :raises: :exc:`rosdep2.catkin_support.ValidationFailed`
    :raises: :exc:`KeyError`
    :raises: :exc:`rosdep2.ResolutionError`
    """
    assert os_name == OS_UBUNTU
    assert os_platform
    assert type(rosdep_keys) == list

    # use the catkin_support module in rosdep2 as it does the same business

    # apt-install resolves data
    apt_installer = get_installer(APT_INSTALLER)
    # rosdep view is our view into the rosdep database
    rosdep_view = get_catkin_view(rosdistro_name, os_name, os_platform)

    # iterate through all our keys to resolve
    ubuntu_deps = set()
    for dep in rosdep_keys:
        resolved = resolve_for_os(dep, rosdep_view, apt_installer, os_name,
                                  os_platform)
        ubuntu_deps.update(resolved)
    return list(ubuntu_deps)
Example #13
0
 def resolve_rosdep_key(rosdep_key):
     from rosdep2.catkin_support import resolve_for_os
     from rosdep2.lookup import ResolutionError
     try:
         return resolve_for_os(rosdep_key, rosdep_view,
                               self.apt_installer, os_name,
                               debian_distro)
     except (KeyError, ResolutionError) as err:
         if rosdep_key not in self.packages:
             if type(err) == KeyError:
                 error(
                     "Could not resolve rosdep key '" + rosdep_key + "'"
                 )
                 self.exit(code.DEBIAN_NO_SUCH_ROSDEP_KEY)
             else:
                 error(
                     "Could not resolve the rosdep key '" + rosdep_key +
                     "' for distro '" + debian_distro + "': \n"
                 )
                 print(str(err))
                 self.exit(code.DEBIAN_NO_ROSDEP_KEY_FOR_DISTRO)
         return [sanitize_package_name(
             'ros-{0}-{1}'.format(self.rosdistro, rosdep_key)
         )]