rpmlibpkg.py 文件源码

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

项目:saltstack-code-snippets 作者: madrisan 项目源码 文件源码
def buildtime():
    '''
    Return the build date and time.

    CLI Example:

        .. code-block:: bash

            salt '*' rpmlibpkg.buildtime
    '''
    installdate = lambda h: h.sprintf("%{INSTALLTID:date}")
    installptime = lambda h: time.strptime(installdate(h), "%c")

    ts = rpm.TransactionSet()
    mi = ts.dbMatch()
    first = min(installptime(h) for h in mi)

    return time.asctime(first)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号