def lastupdate():
'''
Return the date of the last rpm package update/installation.
CLI Example:
.. code-block:: bash
salt '*' rpmlibpkg.lastupdate
'''
installdate = lambda h: h.sprintf("%{INSTALLTID:date}")
installptime = lambda h: time.strptime(installdate(h), "%c")
ts = rpm.TransactionSet()
mi = ts.dbMatch()
last = max(installptime(h) for h in mi)
return time.asctime(last)
评论列表
文章目录