コード例 #1
0
ファイル: application.py プロジェクト: hhorak/rebase-helper
 def check_build_requires(spec):
     """
     Check if all build dependencies are installed. If not, asks user they should be installed.
     If yes, it installs build dependencies using PolicyKit.
     :param spec: SpecFile object
     :return:
     """
     req_pkgs = spec.get_requires()
     if not RpmHelper.all_packages_installed(req_pkgs):
         if ConsoleHelper.get_message('\nSome build dependencies are missing. Do you want to install them now'):
             if RpmHelper.install_build_dependencies(spec.get_path()) != 0:
                 raise RebaseHelperError('Failed to install build dependencies')
コード例 #2
0
    def prepare(cls, spec, conf):
        """
        Checks if all build dependencies are installed. If not, asks user whether they should be installed.
        If he agrees, installs build dependencies using PolicyKit.

        :param spec: SpecFile object
        """
        req_pkgs = spec.get_requires()
        if not RpmHelper.all_packages_installed(req_pkgs):
            question = '\nSome build dependencies are missing. Do you want to install them now'
            if conf.non_interactive or ConsoleHelper.get_message(question):
                if RpmHelper.install_build_dependencies(spec.get_path(), assume_yes=conf.non_interactive) != 0:
                    raise RebaseHelperError('Failed to install build dependencies')
コード例 #3
0
    def check_build_requires(spec):
        """
        Check if all build dependencies are installed. If not, asks user they should be installed.
        If yes, it installs build dependencies using PolicyKit.

        :param spec: SpecFile object
        :return: 
        """
        req_pkgs = spec.get_requires()
        if not RpmHelper.all_packages_installed(req_pkgs):
            if ConsoleHelper.get_message(
                    '\nSome build dependencies are missing. Do you want to install them now'
            ):
                if RpmHelper.install_build_dependencies(spec.get_path()) != 0:
                    raise RebaseHelperError(
                        'Failed to install build dependencies')