是否有任何选项可以查询Launchpad API以获得所有LTS版本的列表?
否则,我可以通过
from launchpadlib.launchpad import Launchpad, STAGING_SERVICE_ROOT
cachedir = "/tmp/launchpadlib/cache/"
lp = Launchpad.login_anonymously('ppastats', 'edge', cachedir, version='devel')
launchpad = lp
[s.status for s in launchpad.distributions["ubuntu"].series]但是如何根据LTS标准过滤这一点呢?
提前谢谢。
发布于 2015-03-22 17:04:37
恐怕Launchpad本身并不是以一种简单的机器可读的方式真正了解这一点,所以它现在无法导出这些信息。您最好的选择可能是对描述进行过滤,尽管我认为现在需要了解此信息的大多数脚本只是硬编码列表,因为它很少更改。
此外,请不要使用“边缘”,因为它是长期过时的,只存在于兼容性。用“生产”代替。
发布于 2015-06-03 23:37:46
有什么理由不能假设最老的活动版本是最老的LTS吗?LTS是支持时间最长的,所以永远不会有比LTS更长的非LTS。例:
>>> [s.name for s in lp.distributions['ubuntu'].series if s.active][-1]
'precise'此外,LTS是在偶数年的4月发布的,因此要获得所有当前支持的LTS,您可以这样做:
>>> [s.name for s in lp.distributions['ubuntu'].series if s.active and s.version.endswith('.04') and not int(s.version.split('.')[0]) % 2]
['trusty', 'precise']https://askubuntu.com/questions/599525
复制相似问题