コード例 #1
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 InputHelper.get_message(question):
                if RpmHelper.install_build_dependencies(spec.get_path(), assume_yes=conf.non_interactive) != 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 InputHelper.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 test_all_packages_installed_one_non_existing(self):
     assert RpmHelper.all_packages_installed(['glibc', 'coreutils', 'non-existing-package']) is False
コード例 #4
0
 def test_all_packages_installed_existing(self):
     assert RpmHelper.all_packages_installed(['glibc', 'coreutils']) is True
コード例 #5
0
ファイル: test_helpers.py プロジェクト: phracek/rebase-helper
 def test_all_packages_installed_one_non_existing(self):
     assert RpmHelper.all_packages_installed(
         ['glibc', 'coreutils', 'non-existing-package']) is False
コード例 #6
0
ファイル: test_helpers.py プロジェクト: phracek/rebase-helper
 def test_all_packages_installed_existing(self):
     assert RpmHelper.all_packages_installed(['glibc', 'coreutils']) is True