Exemplo n.º 1
0
    def execute(self, repositories, rosdistro_path, distro, upstream_index,
                upstream_distro):
        super().execute(rosdistro_path, distro)
        self.load_upstream(distro, upstream_index, upstream_distro)

        for repo in repositories:
            try:
                source_repo_data = self.upstream_distro.repositories[
                    repo].source_repository.get_data()
                status = self.upstream_distro.repositories[
                    repo].source_repository.status
            except (KeyError, AttributeError):
                click.echo(click.style(
                    f'Unable to find source entry for repo {repo} in upstream distro',
                    fg='yellow'),
                           err=True)
                continue

            source_repo_data.pop('test_pull_requests', None)
            source_repo_data.pop('test_commits', None)

            click.echo(f"Writing source entry for repo {repo} ...")

            try:
                self.internal_distro.repositories[repo].source_repository = \
                    SourceRepositorySpecification(repo, source_repo_data)
            except KeyError:
                self.internal_distro.repositories[repo] = Repository(
                    name=repo,
                    doc_data={},
                    release_data={},
                    status_data={'status': status},
                    source_data=source_repo_data)

        self.write_internal_distro()
Exemplo n.º 2
0
    def execute(self, rosdistro_repo, repositories, upstream_index,
                upstream_distro):
        super().execute(rosdistro_repo)
        upstream = self.rosdistro_repo.get_upstream_distro(
            upstream_index, upstream_distro)

        if not repositories:
            click.echo(click.style('No repositories specified.', fg='yellow'),
                       err=True)
            return

        for repo in repositories:
            try:
                source_repo_data = upstream.repositories[
                    repo].source_repository.get_data()
                status = upstream.repositories[repo].source_repository.status
            except (KeyError, AttributeError):
                click.echo(click.style(
                    f'Unable to find source entry for repo {repo} in upstream distro',
                    fg='yellow'),
                           err=True)
                continue

            source_repo_data.pop('test_pull_requests', None)
            source_repo_data.pop('test_commits', None)

            click.echo(f"Writing source entry for repo {repo} ...")

            repo_entry = self.rosdistro_repo[repo]
            if repo_entry:
                repo_entry.source_repository = SourceRepositorySpecification(
                    repo, source_repo_data)
            else:
                self.rosdistro_repo.set_repo(
                    repo,
                    Repository(name=repo,
                               doc_data={},
                               release_data={},
                               status_data={'status': status},
                               source_data=source_repo_data))

        msg = 'Importing {} from {}'.format('/'.join(repositories),
                                            upstream_index or 'upstream')
        self.rosdistro_repo.write_internal_distro(msg)
def _ros_source_repo():
    return SourceRepositorySpecification('ros', {
        'url': 'https://github.com/ros/ros.git',
        'version': 'kinetic-devel'
    })
def _genmsg_source_tarball():
    return SourceRepositorySpecification(
        'genmsg', {
            'url': 'https://github.com/ros/genmsg/archive/0.5.16.tar.gz',
            'type': 'tar'
        })
def _genmsg_source_repo():
    return SourceRepositorySpecification('genmsg', {
        'url': 'https://github.com/ros/genmsg.git',
        'version': '0.5.11'
    })