Esempio n. 1
0
def test_getlist_empty(configuration: Configuration) -> None:
    """
    must return list of string correctly for non-existing option
    """
    assert configuration.getlist("build", "test_list") == []
    configuration.set("build", "test_list", "")
    assert configuration.getlist("build", "test_list") == []
Esempio n. 2
0
    def __init__(self, package: Package, configuration: Configuration, paths: RepositoryPaths) -> None:
        """
        default constructor
        :param package: package definitions
        :param configuration: configuration instance
        :param paths: repository paths instance
        """
        self.logger = logging.getLogger("builder")
        self.build_logger = logging.getLogger("build_details")
        self.package = package
        self.paths = paths

        self.archbuild_flags = configuration.getlist("build", "archbuild_flags")
        self.build_command = configuration.get("build", "build_command")
        self.makepkg_flags = configuration.getlist("build", "makepkg_flags")
        self.makechrootpkg_flags = configuration.getlist("build", "makechrootpkg_flags")
Esempio n. 3
0
 def __init__(self, architecture: str,
              configuration: Configuration) -> None:
     """
     default constructor
     :param architecture: repository architecture
     :param configuration: configuration instance
     """
     Upload.__init__(self, architecture, configuration)
     self.command = configuration.getlist("rsync", "command")
     self.remote = configuration.get("rsync", "remote")
Esempio n. 4
0
 def __init__(self, configuration: Configuration) -> None:
     """
     default constructor
     :param configuration: configuration instance
     """
     root = configuration.get("alpm", "root")
     pacman_root = configuration.getpath("alpm", "database")
     self.handle = Handle(root, str(pacman_root))
     for repository in configuration.getlist("alpm", "repositories"):
         self.handle.register_syncdb(repository, 0)  # 0 is pgp_level
Esempio n. 5
0
 def sign_options(
     configuration: Configuration
 ) -> Tuple[Set[SignSettings], Optional[str]]:
     """
     extract default sign options from configuration
     :param configuration: configuration instance
     :return: tuple of sign targets and default PGP key
     """
     targets = {
         SignSettings.from_option(option)
         for option in configuration.getlist("sign", "target")
     }
     default_key = configuration.get("sign", "key") if targets else None
     return targets, default_key
Esempio n. 6
0
    def __init__(self, architecture: str,
                 configuration: Configuration) -> None:
        self.logger = logging.getLogger("builder")
        self.architecture = architecture
        self.configuration = configuration

        self.aur_url = configuration.get("alpm", "aur_url")
        self.name = configuration.get("repository", "name")

        self.paths = RepositoryPaths(
            configuration.getpath("repository", "root"), architecture)
        self.paths.create_tree()

        self.ignore_list = configuration.getlist("build", "ignore_packages")
        self.pacman = Pacman(configuration)
        self.sign = GPG(architecture, configuration)
        self.repo = Repo(self.name, self.paths, self.sign.repository_sign_args)
        self.reporter = Client.load(configuration)
Esempio n. 7
0
    def __init__(self, architecture: str,
                 configuration: Configuration) -> None:
        """
        default constructor
        :param architecture: repository architecture
        :param configuration: configuration instance
        """
        Report.__init__(self, architecture, configuration)
        JinjaTemplate.__init__(self, "email", configuration)

        # base smtp settings
        self.host = configuration.get("email", "host")
        self.no_empty_report = configuration.getboolean("email",
                                                        "no_empty_report",
                                                        fallback=True)
        self.password = configuration.get("email", "password", fallback=None)
        self.port = configuration.getint("email", "port")
        self.receivers = configuration.getlist("email", "receivers")
        self.sender = configuration.get("email", "sender")
        self.ssl = SmtpSSLSettings.from_option(
            configuration.get("email", "ssl", fallback="disabled"))
        self.user = configuration.get("email", "user", fallback=None)
Esempio n. 8
0
def test_getlist_single(configuration: Configuration) -> None:
    """
    must return list of strings for single string
    """
    configuration.set("build", "test_list", "a")
    assert configuration.getlist("build", "test_list") == ["a"]
Esempio n. 9
0
def test_getlist(configuration: Configuration) -> None:
    """
    must return list of string correctly
    """
    configuration.set("build", "test_list", "a b c")
    assert configuration.getlist("build", "test_list") == ["a", "b", "c"]