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')
def test_all_packages_installed_one_non_existing(self): assert RpmHelper.all_packages_installed(['glibc', 'coreutils', 'non-existing-package']) is False
def test_all_packages_installed_existing(self): assert RpmHelper.all_packages_installed(['glibc', 'coreutils']) is True
def test_all_packages_installed_one_non_existing(self): assert RpmHelper.all_packages_installed( ['glibc', 'coreutils', 'non-existing-package']) is False