本文整理汇总了Python中cache.Cache.cache_build_by_external_libs方法的典型用法代码示例。如果您正苦于以下问题:Python Cache.cache_build_by_external_libs方法的具体用法?Python Cache.cache_build_by_external_libs怎么用?Python Cache.cache_build_by_external_libs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cache.Cache
的用法示例。
在下文中一共展示了Cache.cache_build_by_external_libs方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: pack_build
# 需要导入模块: from cache import Cache [as 别名]
# 或者: from cache.Cache import cache_build_by_external_libs [as 别名]
def pack_build(cmode, tag, force_update):
build_home = os.getcwd()
attribute_lists = Pack.__pack_init()
distribution = attribute_lists.distribution
source = attribute_lists.source
Pack.__do_clean(build_home)
if "dependences" in list(dir(attribute_lists)):
dependences = attribute_lists.dependences
result = Cache.cache_build_by_external_libs(dependences, cmode, force_update)
if result == False:
return False
dotrc = Glo.dot_buildc_rc_path()
if not os.path.exists(dotrc):
print('Can not found ' + dotrc)
print('Please run buildc init and then config .buildc.rc!')
sys.exit(Errors.conf_file_not_found)
buildc_rc = Load.load_dot_buildc_rc(dotrc)
dotrepository = Glo.dot_buildc_repository_path()
svn_tree = SvnTree()
svn_tree.import_format_tree_from_file(dotrepository)
for dependence in dependences:
Pack.__copy_dependent_library(dependence, svn_tree, buildc_rc, build_home, cmode)
result = Pack.__do_pack(build_home, source, distribution, cmode, tag, force_update)
if result == False:
return False
return True
示例2: __build_component_deps
# 需要导入模块: from cache import Cache [as 别名]
# 或者: from cache.Cache import cache_build_by_external_libs [as 别名]
def __build_component_deps(build_home, url, cmode, force_update):
if not os.path.exists(build_home + os.sep + '.build'):
Util.execute_and_output('mkdir -p ' + build_home + os.sep + '.build')
os.chdir(build_home + os.sep + '.build')
print "Create dir [.build] OK!"
Util.execute_and_output('rm -rf ' + url[url.rindex("/")+1:])
SvnLocalOper.export(url, None, None, Glo.source_svn_user(), Glo.source_svn_passwd(), False)
print "Export [" + url + "] OK!"
source_home = build_home + '/.build/' + url[url.rindex("/")+1:]
os.chdir(source_home)
print "Cd " + source_home
dotrc = Glo.dot_buildc_rc_path()
if not os.path.exists(dotrc):
print('Can not found ' + dotrc)
print('Please run buildc init and then config .buildc.rc!')
sys.exit(Errors.conf_file_not_found)
buildc_rc = Load.load_dot_buildc_rc(dotrc)
buildc_cfg = Load.load_buildc_cfg(Glo.buildc_cfg_path(), Glo.var_str())
is_valid = Cache.cache_build_by_external_libs(buildc_cfg.external_libs, cmode, force_update)
if is_valid == False:
os.chdir(build_home)
print "Cd " + build_home
return False
dotrepository = Glo.dot_buildc_repository_path()
svn_tree = SvnTree()
svn_tree.import_format_tree_from_file(dotrepository)
for dependence in buildc_cfg.external_libs:
Pack.__copy_dependent_all(dependence, svn_tree, buildc_rc, build_home, cmode)
os.chdir(build_home)
print "Cd " + build_home
print 'Build deps [' + url + '] OK!'
return True