Exemple #1
0
 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]
Exemple #2
0
 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)