def post_rebase(self, destination): # Determine the current package being generated name = destination.split('/')[-1] distro = destination.split('/')[-2] # Retrieve the stackage stackage, kind = self.packages[name] # Ask to continue if interactive if self.interactive: if not maybe_continue('y'): error("Answered no to continue, aborting.") return code.ANSWERED_NO_TO_CONTINUE ### Start debian generation # Get time of day from dateutil import tz stamp = datetime.datetime.now(tz.tzlocal()) # Convert stackage to debian data data = self.convert_stackage_to_debian_data(stackage, kind) # Get apt_installer from rosdep from rosdep2.catkin_support import get_installer self.apt_installer = get_installer(APT_INSTALLER) # Create debians for each distro with inbranch(destination): self.generate_debian(data, stamp, distro) # Create the tag name for later self.tag_names[destination] = self.generate_tag_name(data) # Update the patch configs patches_branch = 'patches/' + destination config = get_patch_config(patches_branch) # Store it self.store_original_config(config, patches_branch) # Modify the base so import/export patch works config['base'] = get_commit_hash(get_current_branch()) # Set it set_patch_config(patches_branch, config)
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
def post_rebase(self, destination): name = destination.split('/')[-1] # Retrieve the stackage stackage, kind = self.packages[name] # Handle differently if this is a debian vs distro branch if destination in self.debian_branches: info("Placing debian template files into '{0}' branch.".format(destination)) # Check for valid CMakeLists.txt if a metapackage if kind == 'package' and is_metapackage(stackage): check_metapackage_for_valid_cmake(name) # Then this is a debian branch # Place the raw template files self.place_tempalte_files() else: # Check for valid CMakeLists.txt if a metapackage if kind == 'package' and is_metapackage(stackage): check_metapackage_for_valid_cmake(name) # This is a distro specific debian branch # Determine the current package being generated distro = destination.split('/')[-2] ### Start debian generation # Get time of day from dateutil import tz stamp = datetime.datetime.now(tz.tzlocal()) # Convert stackage to debian data data = self.convert_stackage_to_debian_data(stackage, kind) # Get apt_installer from rosdep from rosdep2.catkin_support import get_installer self.apt_installer = get_installer(APT_INSTALLER) # Create debians for each distro with inbranch(destination): self.generate_debian(data, stamp, distro) # Create the tag name for later self.tag_names[destination] = self.generate_tag_name(data) # Update the patch configs patches_branch = 'patches/' + destination config = get_patch_config(patches_branch) # Store it self.store_original_config(config, patches_branch) # Modify the base so import/export patch works current_branch = get_current_branch() if current_branch is None: error("Could not determine current branch.", exit=True) config['base'] = get_commit_hash(current_branch) # Set it set_patch_config(patches_branch, config)
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_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_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)