示例#1
0
    def _get_dist_git(
        self,
    ) -> DistGit:
        """
        For given package names, clone the dist-git repo in the given directory
        and return the DistGit class

        :return: DistGit instance (CentOSDistGit if centos_package is set)
        """
        if self.centos_package:
            self.dist_git_branch = self.dist_git_branch or "c8s"
            return CentOSDistGit.clone(
                config=self.config,
                package_config=self.package_config,
                path=self.dist_git_path,
                branch=self.dist_git_branch,
            )
        else:
            # If self.dist_git_branch is None we will checkout/store repo's default branch
            dg = DistGit.clone(
                config=self.config,
                package_config=self.package_config,
                path=self.dist_git_path,
                branch=self.dist_git_branch,
            )
            self.dist_git_branch = (
                self.dist_git_branch or dg.local_project.git_project.default_branch
            )
            return dg
示例#2
0
    def _get_dist_git(self, ) -> DistGit:
        """
        For given package names, clone the dist-git repo in the given directory
        and return the DistGit class

        :return: DistGit instance (CentOSDistGit if centos_package is set)
        """
        if self.centos_package:
            self.dist_git_branch = self.dist_git_branch or "c8s"
            return CentOSDistGit.clone(
                self.config,
                self.package_config,
                self.dist_git_path,
                branch=self.dist_git_branch,
            )

        self.dist_git_branch = self.dist_git_branch or "master"
        return DistGit.clone(
            self.config,
            self.package_config,
            self.dist_git_path,
            branch=self.dist_git_branch,
        )
示例#3
0
    def _get_dist_git(self, ) -> DistGit:
        """
        For given package names, clone the dist-git repo in the given directory
        and return the DistGit class

        :return: DistGit instance
        """
        if self.centos_package:
            self.dist_git_branch = self.dist_git_branch or "c9s"
            # let's be sure to cover anything 9 related,
            # even though "c9" will probably never be a thing
            if "c9" in self.dist_git_branch:
                return CentOS9DistGit.clone(
                    config=self.config,
                    package_config=self.package_config,
                    path=self.dist_git_path,
                    branch=self.dist_git_branch,
                )
            return CentOS8DistGit.clone(
                config=self.config,
                package_config=self.package_config,
                path=self.dist_git_path,
                branch=self.dist_git_branch,
            )
        else:
            # If self.dist_git_branch is None we will checkout/store repo's default branch
            dg = DistGit.clone(
                config=self.config,
                package_config=self.package_config,
                path=self.dist_git_path,
                branch=self.dist_git_branch,
            )
            self.dist_git_branch = (
                self.dist_git_branch
                or dg.local_project.git_project.default_branch)
            return dg