ubuntu.py 文件源码

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

项目:charm-ceilometer-agent 作者: openstack 项目源码 文件源码
def get_upstream_version(package):
    """Determine upstream version based on installed package

    @returns None (if not installed) or the upstream version
    """
    import apt_pkg
    cache = apt_cache()
    try:
        pkg = cache[package]
    except Exception:
        # the package is unknown to the current apt cache.
        return None

    if not pkg.current_ver:
        # package is known, but no version is currently installed.
        return None

    return apt_pkg.upstream_version(pkg.current_ver.ver_str)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号