本文整理汇总了Python中cerbero.build.cookbook.CookBook.list_recipe_deps方法的典型用法代码示例。如果您正苦于以下问题:Python CookBook.list_recipe_deps方法的具体用法?Python CookBook.list_recipe_deps怎么用?Python CookBook.list_recipe_deps使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cerbero.build.cookbook.CookBook
的用法示例。
在下文中一共展示了CookBook.list_recipe_deps方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: from cerbero.build.cookbook import CookBook [as 别名]
# 或者: from cerbero.build.cookbook.CookBook import list_recipe_deps [as 别名]
def run(self, config, args):
cookbook = CookBook(config)
recipe_name = args.recipe[0]
recursive = args.recursive
recipe = cookbook.get_recipe(recipe_name)
if recursive:
ordered_recipes = cookbook.list_recipe_deps(recipe_name)
else:
ordered_recipes = [recipe]
for recipe in ordered_recipes:
if cookbook.recipe_needs_build(recipe.name):
raise FatalError(_("Recipe %s is not built yet" % recipe.name))
for recipe in ordered_recipes:
# call step function
stepfunc = None
try:
stepfunc = getattr(recipe, 'check')
except:
m.message('%s has no check step, skipped' % recipe.name)
if stepfunc:
try:
stepfunc()
except FatalError as e:
raise e
except Exception as ex:
raise FatalError(_("Error running %s checks: %s") %
(recipe.name, ex))
示例2: run
# 需要导入模块: from cerbero.build.cookbook import CookBook [as 别名]
# 或者: from cerbero.build.cookbook.CookBook import list_recipe_deps [as 别名]
def run(self, config, args):
cookbook = CookBook(config)
recipe_name = args.recipe[0]
all_deps = args.all
graph = args.graph
if all_deps:
recipes = cookbook.list_recipe_deps(recipe_name)
else:
recipes = [cookbook.get_recipe(x) for x in
cookbook.get_recipe(recipe_name).list_deps()]
if len(recipes) == 0:
m.message(_('%s has 0 dependencies') % recipe_name)
return
if not graph:
for recipe in recipes:
# Don't print the recipe we asked for
if recipe.name == recipe_name:
continue
m.message(recipe.name)
else:
def print_dep(cookbook, recipe, level=0, already_shown=[]):
m.message("%s%s" %( " " * 3 * level, recipe.name))
already_shown.append(recipe)
for r in [cookbook.get_recipe(x) for x in recipe.list_deps()]:
if not r in already_shown:
print_dep(cookbook, r, level + 1, already_shown)
elif not r.name == recipe.name:
m.message("%s(%s)" % ( " " * 3 * (level + 1), r.name))
print_dep(cookbook, cookbook.get_recipe(recipe_name))
示例3: run
# 需要导入模块: from cerbero.build.cookbook import CookBook [as 别名]
# 或者: from cerbero.build.cookbook.CookBook import list_recipe_deps [as 别名]
def run(self, config, args):
cookbook = CookBook(config)
recipe_name = args.recipe[0]
all_deps = args.all
if all_deps:
recipes = cookbook.list_recipe_deps(recipe_name)
else:
recipes = [cookbook.get_recipe(x) for x in
cookbook.get_recipe(recipe_name).list_deps()]
if len(recipes) == 0:
m.message(_('%s has 0 dependencies') % recipe_name)
return
for recipe in recipes:
# Don't print the recipe we asked for
if recipe.name == recipe_name:
continue
m.message(recipe.name)
示例4: run
# 需要导入模块: from cerbero.build.cookbook import CookBook [as 别名]
# 或者: from cerbero.build.cookbook.CookBook import list_recipe_deps [as 别名]
def run(self, config, args):
packages = []
recipes = []
bundle_recipes = []
bundle_dirs = []
setup_args = ['sdist']
if not config.uninstalled:
m.error("Can only be run on cerbero-uninstalled")
store = PackagesStore(config)
cookbook = CookBook(config)
packages = list(args.bundlepackages)
for p in packages:
package = store.get_package(p)
if hasattr(package, 'list_packages'):
packages += package.list_packages()
packages = remove_list_duplicates(packages)
for p in packages:
package = store.get_package(p)
if hasattr(package, 'deps'):
packages += package.deps
packages = remove_list_duplicates(packages)
for p in packages:
package = store.get_package(p)
recipes += package.recipes_dependencies()
recipes += args.add_recipe
for r in recipes:
bundle_recipes += cookbook.list_recipe_deps(r)
bundle_recipes = remove_list_duplicates(bundle_recipes)
for p in packages:
setup_args.append('--package=' + p)
for r in bundle_recipes:
setup_args.append('--recipe=' + r.name)
if r.stype != SourceType.CUSTOM:
bundle_dirs.append(r.repo_dir)
if not args.no_bootstrap:
build_tools = BuildTools(config)
bs_recipes = build_tools.BUILD_TOOLS + \
build_tools.PLAT_BUILD_TOOLS.get(config.platform, [])
b_recipes = []
for r in bs_recipes:
b_recipes += cookbook.list_recipe_deps(r)
b_recipes = remove_list_duplicates(b_recipes)
for r in b_recipes:
if r.stype != SourceType.CUSTOM:
bundle_dirs.append(r.repo_dir)
setup_args.append('--source-dirs=' + ','.join(bundle_dirs))
command = str(config._relative_path('setup.py'))
run_setup(command, setup_args)