def check_build_dependencies(self): """check and try to install build dependencies, otherwise fail.""" build_deps = self.spec.source.buildDependencies if not ctx.get_option('bypass_safety'): if ctx.componentdb.has_component('system.devel'): build_deps_names = set([x.package for x in build_deps]) devel_deps_names = set(ctx.componentdb.get_component('system.devel').packages) extra_names = devel_deps_names - build_deps_names extra_names = filter(lambda x: not ctx.installdb.is_installed(x), extra_names) if extra_names: ctx.ui.warning(_('Safety switch: following extra packages in system.devel will be installed: ') + util.strlist(extra_names)) extra_deps = [dependency.Dependency(package = x) for x in extra_names] build_deps.extend(extra_deps) else: ctx.ui.warning(_('Safety switch: system.devel is already installed')) else: ctx.ui.warning(_('Safety switch: the component system.devel cannot be found')) # find out the build dependencies that are not satisfied... dep_unsatis = [] for dep in build_deps: if not dependency.installed_satisfies_dep(dep): dep_unsatis.append(dep) if dep_unsatis: ctx.ui.info(_("Unsatisfied Build Dependencies:") + ' ' + util.strlist([str(x) for x in dep_unsatis]) ) def fail(): raise Error(_('Cannot build package due to unsatisfied build dependencies')) if ctx.config.get_option('no_install'): fail() if not ctx.config.get_option('ignore_dependency'): for dep in dep_unsatis: if not dependency.repo_satisfies_dep(dep): raise Error(_('Build dependency %s cannot be satisfied') % str(dep)) if ctx.ui.confirm( _('Do you want to install the unsatisfied build dependencies')): ctx.ui.info(_('Installing build dependencies.')) operations.install([dep.package for dep in dep_unsatis]) else: fail() else: ctx.ui.warning(_('Ignoring build dependencies.'))
def check_build_dependencies(self): """fail if dependencies not satisfied""" # find out the build dependencies that are not satisfied... dep_unsatis = [] for dep in self.spec.source.buildDependencies: if not dependency.installed_satisfies_dep(dep): dep_unsatis.append(dep) if dep_unsatis: ctx.ui.info(_("Unsatisfied Build Dependencies:")) for dep in dep_unsatis: ctx.ui.warning(dep.package) if not ctx.config.get_option("ignore_dependency"): if ctx.ui.confirm(_("Do you want to install the unsatisfied build dependencies")): ctx.ui.info(_("Installing build dependencies.")) operations.install([dep.package for dep in dep_unsatis]) else: raise Error(_("Cannot build package due to unsatisfied build dependencies")) else: ctx.ui.warning(_("Ignoring build dependencies."))
def check_build_dependencies(self): """fail if dependencies not satisfied""" build_deps = set(self.spec.source.buildDependencies) if not ctx.get_option('bypass_safety'): if ctx.componentdb.has_component('system.devel'): build_deps_names = set([x.package for x in build_deps]) devel_deps_names = set(ctx.componentdb.get_component('system.devel').packages) extra_names = devel_deps_names - build_deps_names ctx.ui.warning(_('Safety switch: following extra packages in system.devel will be installed: ') + util.strlist(extra_names)) extra_deps = [dependency.Dependency(package = x) for x in extra_names] build_deps = build_deps.union(extra_deps) else: ctx.ui.warning(_('Safety switch: the component system.devel cannot be found')) # find out the build dependencies that are not satisfied... dep_unsatis = [] for dep in build_deps: if not dependency.installed_satisfies_dep(dep): dep_unsatis.append(dep) if dep_unsatis: ctx.ui.info(_("Unsatisfied Build Dependencies:")) for dep in dep_unsatis: ctx.ui.warning(dep.package) if not ctx.config.get_option('ignore_dependency'): if ctx.ui.confirm( _('Do you want to install the unsatisfied build dependencies')): ctx.ui.info(_('Installing build dependencies.')) operations.install([dep.package for dep in dep_unsatis]) else: raise Error(_('Cannot build package due to unsatisfied build dependencies')) else: ctx.ui.warning(_('Ignoring build dependencies.'))
def check_build_dependencies(self): """check and try to install build dependencies, otherwise fail.""" build_deps = self.spec.source.buildDependencies if not ctx.get_option('bypass_safety'): if ctx.componentdb.has_component('system.devel'): build_deps_names = set([x.package for x in build_deps]) devel_deps_names = set( ctx.componentdb.get_component('system.devel').packages) extra_names = devel_deps_names - build_deps_names extra_names = filter( lambda x: not ctx.installdb.is_installed(x), extra_names) if extra_names: ctx.ui.warning( _('Safety switch: following extra packages in system.devel will be installed: ' ) + util.strlist(extra_names)) extra_deps = [ dependency.Dependency(package=x) for x in extra_names ] build_deps.extend(extra_deps) else: ctx.ui.warning( _('Safety switch: system.devel is already installed')) else: ctx.ui.warning( _('Safety switch: the component system.devel cannot be found' )) # find out the build dependencies that are not satisfied... dep_unsatis = [] for dep in build_deps: if not dependency.installed_satisfies_dep(dep): dep_unsatis.append(dep) if dep_unsatis: ctx.ui.info( _("Unsatisfied Build Dependencies:") + ' ' + util.strlist([str(x) for x in dep_unsatis])) def fail(): raise Error( _('Cannot build package due to unsatisfied build dependencies' )) if ctx.config.get_option('no_install'): fail() if not ctx.config.get_option('ignore_dependency'): for dep in dep_unsatis: if not dependency.repo_satisfies_dep(dep): raise Error( _('Build dependency %s cannot be satisfied') % str(dep)) if ctx.ui.confirm( _('Do you want to install the unsatisfied build dependencies' )): ctx.ui.info(_('Installing build dependencies.')) operations.install([dep.package for dep in dep_unsatis]) else: fail() else: ctx.ui.warning(_('Ignoring build dependencies.'))