Ejemplo n.º 1
0
 def run_tool(self, args):
     start_time = time.perf_counter()
     arch = args.arch
     tool_name = args.tool_name
     os_name = args.host
     output_dir = args.outputdir
     sevenzip = self._set_sevenzip(args)
     version = args.version
     mirror = args.base
     self._run_common_part(output_dir, mirror)
     if not self._check_tools_arg_combination(os_name, tool_name, arch):
         self.logger.warning(
             "Specified target combination is not valid: {} {} {}".format(
                 os_name, tool_name, arch))
     try:
         tool_archives = ToolArchives(os_name,
                                      tool_name,
                                      version,
                                      arch,
                                      mirror=mirror,
                                      logging=self.logger)
     except ArchiveDownloadError or ArchiveListError:
         exit(1)
     else:
         installer = QtInstaller(tool_archives,
                                 logging=self.logger,
                                 command=sevenzip,
                                 target_dir=output_dir)
         installer.install()
     self.logger.info("Finished installation")
     self.logger.info("Time elasped: {time:.8f} second".format(
         time=time.perf_counter() - start_time))
Ejemplo n.º 2
0
 def run_install(self, args):
     start_time = time.perf_counter()
     arch = args.arch
     target = args.target
     os_name = args.host
     qt_version = args.qt_version
     output_dir = args.outputdir
     arch = self._set_arch(args, arch, os_name, target, qt_version)
     modules = args.modules
     sevenzip = self._set_sevenzip(args)
     mirror = args.base
     self.show_aqt_version()
     if not self._check_mirror(mirror):
         self.parser.print_help()
         exit(1)
     if not self._check_qt_arg_versions(qt_version):
         self.logger.warning("Specified Qt version is unknown: {}.".format(qt_version))
     if not self._check_qt_arg_combination(qt_version, os_name, target, arch):
         self.logger.warning("Specified target combination is not valid or unknown: {} {} {}".format(os_name,
                                                                                                     target, arch))
     all_extra = True if modules is not None and 'all' in modules else False
     if not all_extra and not self._check_modules_arg(qt_version, modules):
         self.logger.warning("Some of specified modules are unknown.")
     QtInstaller(QtArchives(os_name, target, qt_version, arch, modules=modules, mirror=mirror, logging=self.logger,
                            all_extra=all_extra),
                 logging=self.logger, command=sevenzip, target_dir=output_dir).install()
     self.logger.info("Time elasped: {time:.8f} second".format(time=time.perf_counter() - start_time))
Ejemplo n.º 3
0
 def run_install(self, args):
     arch = args.arch
     target = args.target
     os_name = args.host
     qt_version = args.qt_version
     output_dir = args.outputdir
     arch = self._set_arch(args, arch, os_name, target, qt_version)
     modules = args.modules
     sevenzip = self._set_sevenzip(args)
     mirror = args.base
     if not self._check_mirror(mirror):
         self.parser.print_help()
         exit(1)
     if not self._check_qt_arg_combination(qt_version, os_name, target,
                                           arch):
         self.logger.warning(
             "Specified target combination is not valid: {} {} {}".format(
                 os_name, target, arch))
     all_extra = True if modules is not None and 'all' in modules else False
     if not all_extra and not self._check_modules_arg(qt_version, modules):
         self.logger.warning("Some of specified modules are unknown.")
     QtInstaller(QtArchives(os_name,
                            target,
                            qt_version,
                            arch,
                            modules=modules,
                            mirror=mirror,
                            logging=self.logger,
                            all_extra=all_extra),
                 logging=self.logger).install(command=sevenzip,
                                              target_dir=output_dir)
     sys.stdout.write("\033[K")
     print("Finished installation")
Ejemplo n.º 4
0
 def run_tool(self, args):
     start_time = time.perf_counter()
     arch = args.arch
     tool_name = args.tool_name
     os_name = args.host
     output_dir = args.outputdir
     sevenzip = self._set_sevenzip(args)
     version = args.version
     mirror = args.base
     self._check_mirror(mirror)
     if not self._check_tools_arg_combination(os_name, tool_name, arch):
         self.logger.warning(
             "Specified target combination is not valid: {} {} {}".format(
                 os_name, tool_name, arch))
     QtInstaller(ToolArchives(os_name,
                              tool_name,
                              version,
                              arch,
                              mirror=mirror,
                              logging=self.logger),
                 logging=self.logger,
                 command=sevenzip,
                 target_dir=output_dir).install()
     self.logger.info("Time elasped: {time:.8f} second".format(
         time=time.perf_counter() - start_time))
Ejemplo n.º 5
0
 def _run_src_doc_examples(self, flavor, args):
     start_time = time.perf_counter()
     target = args.target
     os_name = args.host
     qt_version = args.qt_version
     output_dir = args.outputdir
     mirror = args.base
     sevenzip = self._set_sevenzip(args)
     if flavor in ['doc', 'examples']:
         modules = args.modules
         archives = args.archives
     else:
         modules = None
         archives = None
     self._run_common_part(output_dir, mirror)
     all_extra = True if modules is not None and 'all' in modules else False
     if not self._check_qt_arg_versions(qt_version):
         self.logger.warning(
             "Specified Qt version is unknown: {}.".format(qt_version))
     try:
         srcdocexamples_archives = SrcDocExamplesArchives(
             flavor,
             os_name,
             target,
             qt_version,
             subarchives=archives,
             modules=modules,
             mirror=mirror,
             logging=self.logger,
             all_extra=all_extra)
     except ArchiveDownloadError or ArchiveListError:
         exit(1)
     else:
         installer = QtInstaller(srcdocexamples_archives,
                                 logging=self.logger,
                                 command=sevenzip,
                                 target_dir=output_dir)
         installer.install()
     self.logger.info("Finished installation")
     self.logger.info("Time elasped: {time:.8f} second".format(
         time=time.perf_counter() - start_time))
Ejemplo n.º 6
0
 def run_tool(self, args):
     arch = args.arch
     tool_name = args.tool_name
     os_name = args.host
     output_dir = args.outputdir
     sevenzip = self._set_sevenzip(args)
     version = args.version
     mirror = self._check_mirror(args)
     if not self._check_tools_arg_combination(os_name, tool_name, arch):
         self.logger.error("Specified target combination is not valid: {} {} {}".format(os_name, tool_name, arch))
         exit(1)
     QtInstaller(ToolArchives(os_name, tool_name, version, arch, mirror=mirror, logging=self.logger),
                 logging=self.logger).install(command=sevenzip, target_dir=output_dir)
Ejemplo n.º 7
0
    def run_install(self, args):
        arch = args.arch
        target = args.target
        os_name = args.host
        output_dir = args.outputdir
        mirror = args.base
        if arch is None:
            if os_name == "linux" and target == "desktop":
                arch = "gcc_64"
            elif os_name == "mac" and target == "desktop":
                arch = "clang_64"
            elif os_name == "mac" and target == "ios":
                arch = "ios"
        if arch == "":
            print("Please supply a target architecture.")
            args.print_help()
            exit(1)
        qt_version = args.qt_version
        if not self.check_arg_combination(qt_version, os_name, target, arch):
            print("Specified target combination is not valid: {} {} {}".format(
                os_name, target, arch))
            exit(1)
        if mirror is not None:
            if not mirror.startswith('http://') or mirror.startswith(
                    'https://') or mirror.startswith('ftp://'):
                args.print_help()
                exit(1)
        if output_dir is not None:
            QtInstaller(
                QtArchives(os_name, qt_version, target, arch,
                           mirror=mirror)).install(target_dir=output_dir)
        else:
            QtInstaller(
                QtArchives(os_name, qt_version, target, arch,
                           mirror=mirror)).install()

        sys.stdout.write("\033[K")
        print("Finished installation")
Ejemplo n.º 8
0
 def run_install(self, args):
     arch = args.arch
     target = args.target
     os_name = args.host
     output_dir = args.outputdir
     arch = self._set_arch(args, arch, os_name, target)
     modules = args.modules
     sevenzip = self._set_sevenzip(args)
     mirror = self._check_mirror(args)
     qt_version = args.qt_version
     if not self._check_qt_arg_combination(qt_version, os_name, target, arch):
         self.logger.error("Specified target combination is not valid: {} {} {}".format(os_name, target, arch))
         exit(1)
     QtInstaller(QtArchives(os_name, target, qt_version, arch, modules=modules, mirror=mirror, logging=self.logger),
                 logging=self.logger).install(command=sevenzip, target_dir=output_dir)
     sys.stdout.write("\033[K")
     print("Finished installation")
Ejemplo n.º 9
0
 def run_install(self, args):
     start_time = time.perf_counter()
     arch = args.arch
     target = args.target
     os_name = args.host
     qt_version = args.qt_version
     output_dir = args.outputdir
     arch = self._set_arch(args, arch, os_name, target, qt_version)
     modules = args.modules
     sevenzip = self._set_sevenzip(args)
     mirror = args.base
     archives = args.archives
     self._run_common_part(output_dir, mirror)
     if not self._check_qt_arg_versions(qt_version):
         self.logger.warning(
             "Specified Qt version is unknown: {}.".format(qt_version))
     if not self._check_qt_arg_combination(qt_version, os_name, target,
                                           arch):
         self.logger.warning(
             "Specified target combination is not valid or unknown: {} {} {}"
             .format(os_name, target, arch))
     all_extra = True if modules is not None and 'all' in modules else False
     if not all_extra and not self._check_modules_arg(qt_version, modules):
         self.logger.warning("Some of specified modules are unknown.")
     try:
         qt_archives = QtArchives(os_name,
                                  target,
                                  qt_version,
                                  arch,
                                  subarchives=archives,
                                  modules=modules,
                                  mirror=mirror,
                                  logging=self.logger,
                                  all_extra=all_extra)
     except ArchiveDownloadError or ArchiveListError:
         exit(1)
     else:
         installer = QtInstaller(qt_archives,
                                 logging=self.logger,
                                 command=sevenzip,
                                 target_dir=output_dir)
         installer.install()
         installer.finalize()
     self.logger.info("Finished installation")
     self.logger.info("Time elasped: {time:.8f} second".format(
         time=time.perf_counter() - start_time))