Beispiel #1
0
 def run(cls: Type[Handler], args: argparse.Namespace, architecture: str,
         configuration: Configuration) -> None:
     """
     callback for command line
     :param args: command line args
     :param architecture: repository architecture
     :param configuration: configuration instance
     """
     application = Application(architecture, configuration)
     if args.ahriman:
         ahriman = application.repository.reporter.get_self()
         print(ahriman.pretty_print())
         print()
     if args.package:
         packages: Iterable[Tuple[Package, BuildStatus]] = sum([
             application.repository.reporter.get(base)
             for base in args.package
         ],
                                                               start=[])
     else:
         packages = application.repository.reporter.get(None)
     for package, package_status in sorted(packages,
                                           key=lambda item: item[0].base):
         print(package.pretty_print())
         print(f"\t{package.version}")
         print(f"\t{package_status.pretty_print()}")
Beispiel #2
0
 def run(cls: Type[Handler], args: argparse.Namespace, architecture: str, configuration: Configuration) -> None:
     """
     callback for command line
     :param args: command line args
     :param architecture: repository architecture
     :param configuration: configuration instance
     """
     Application(architecture, configuration).report(args.target, [])
Beispiel #3
0
 def run(cls: Type[Handler], args: argparse.Namespace, architecture: str,
         configuration: Configuration) -> None:
     """
     callback for command line
     :param args: command line args
     :param architecture: repository architecture
     :param configuration: configuration instance
     """
     Application(architecture,
                 configuration).clean(args.no_build, args.no_cache,
                                      args.no_chroot, args.no_manual,
                                      args.no_packages)
Beispiel #4
0
 def run(cls: Type[Handler], args: argparse.Namespace, architecture: str, configuration: Configuration) -> None:
     """
     callback for command line
     :param args: command line args
     :param architecture: repository architecture
     :param configuration: configuration instance
     """
     application = Application(architecture, configuration)
     Setup.create_makepkg_configuration(args.packager, application.repository.paths)
     Setup.create_executable(args.build_command, architecture)
     Setup.create_devtools_configuration(args.build_command, architecture, args.from_configuration,
                                         args.no_multilib, args.repository, application.repository.paths)
     Setup.create_ahriman_configuration(args, architecture, args.repository, configuration.include)
     Setup.create_sudo_configuration(args.build_command, architecture)
Beispiel #5
0
    def run(cls: Type[Handler], args: argparse.Namespace, architecture: str,
            configuration: Configuration) -> None:
        """
        callback for command line
        :param args: command line args
        :param architecture: repository architecture
        :param configuration: configuration instance
        """
        application = Application(architecture, configuration)
        packages = application.get_updates(
            args.package, args.no_aur, args.no_manual, args.no_vcs,
            Update.log_fn(application, args.dry_run))
        if args.dry_run:
            return

        application.update(packages)
Beispiel #6
0
    def run(cls: Type[Handler], args: argparse.Namespace, architecture: str,
            configuration: Configuration) -> None:
        """
        callback for command line
        :param args: command line args
        :param architecture: repository architecture
        :param configuration: configuration instance
        """
        application = Application(architecture, configuration)
        application.add(args.package, args.without_dependencies)
        if not args.now:
            return

        packages = application.get_updates(args.package, True, False, True,
                                           application.logger.info)
        application.update(packages)
Beispiel #7
0
    def run(cls: Type[Handler], args: argparse.Namespace, architecture: str, configuration: Configuration) -> None:
        """
        callback for command line
        :param args: command line args
        :param architecture: repository architecture
        :param configuration: configuration instance
        """
        depends_on = set(args.depends_on) if args.depends_on else None

        application = Application(architecture, configuration)
        packages = [
            package
            for package in application.repository.packages()
            if depends_on is None or depends_on.intersection(package.depends)
        ]  # we have to use explicit list here for testing purpose
        application.update(packages)
Beispiel #8
0
 def run(cls: Type[Handler], args: argparse.Namespace, architecture: str,
         configuration: Configuration) -> None:
     """
     callback for command line
     :param args: command line args
     :param architecture: repository architecture
     :param configuration: configuration instance
     """
     client = Application(architecture, configuration).repository.reporter
     callback: Callable[[str], None] = lambda p: client.remove(
         p) if args.remove else client.update(p, args.status)
     if args.package:
         # update packages statuses
         for package in args.package:
             callback(package)
     else:
         # update service status
         client.update_self(args.status)
Beispiel #9
0
def application(configuration: Configuration,
                mocker: MockerFixture) -> Application:
    mocker.patch("pathlib.Path.mkdir")
    return Application("x86_64", configuration)