def convert_package_to_debian_data(self, package): data = {} # Name, Version, Description data['Name'] = package.name data['Version'] = package.version data['Description'] = debianize_string(package.description) # Websites websites = [str(url) for url in package.urls if url.type == 'website'] homepage = websites[0] if websites else '' if homepage == '': warning("No homepage set, defaulting to ''") data['Homepage'] = homepage # Build rule templates if is_metapackage(package): data['BuildType'] = 'metapackage' else: data['BuildType'] = 'cmake' # Debian Increment Number data['DebianInc'] = self.debian_inc # Package name data['Package'] = self.get_stackage_name(package) # Installation prefix data['InstallationPrefix'] = self.install_prefix # Dependencies self.depends = package.run_depends self.build_depends = package.build_depends + package.buildtool_depends # Maintainers maintainers = [] for m in package.maintainers: maintainers.append(str(m)) data['Maintainer'] = ', '.join(maintainers) return data
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 detect_branches(self): self.packages = None with inbranch(self.src): if self.name is not None: self.packages = [self.name] return [self.name] name, version, packages = get_package_data(self.src) self.packages = packages # Check meta packages for valid CMakeLists.txt if isinstance(self.packages, dict): for path, pkg in self.packages.iteritems(): with change_directory(path): if is_metapackage(pkg): check_metapackage_for_valid_cmake(pkg.name) return name if type(name) is list else [name]