dump_cache.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:isar 作者: ilbers 项目源码 文件源码
def main(argv=None):
    """
    Get the mapping for the target recipe.
    """
    if len(argv) != 1:
        print("Error, need one argument!", file=sys.stderr)
        return 2

    cachefile = argv[0]

    with open(cachefile, "rb") as cachefile:
        pickled = pickle.Unpickler(cachefile)
        while cachefile:
            try:
                key = pickled.load()
                val = pickled.load()
            except Exception:
                break
            if isinstance(val, CoreRecipeInfo) and (not val.skipped):
                pn = val.pn
                # Filter out the native recipes.
                if key.startswith('virtual:native:') or pn.endswith("-native"):
                    continue

                # 1.0 is the default version for a no PV recipe.
                if "pv" in val.__dict__:
                    pv = val.pv
                else:
                    pv = "1.0"

                print("%s %s %s %s" % (key, pn, pv, ' '.join(val.packages)))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号