Update the kernel command.

This commit is contained in:
James Vega 2004-09-10 17:31:13 +00:00
parent a7bdd631e3
commit 82167728e4
1 changed files with 8 additions and 4 deletions

View File

@ -286,17 +286,21 @@ class Http(callbacks.Privmsg):
fd = webutils.getUrlFd('http://kernel.org/kdist/finger_banner') fd = webutils.getUrlFd('http://kernel.org/kdist/finger_banner')
try: try:
stable = 'unknown' stable = 'unknown'
beta = 'unknown' snapshot = 'unknown'
mm = 'unknown'
for line in fd: for line in fd:
(name, version) = line.split(':') (name, version) = line.split(':')
if 'latest stable' in name: if 'latest stable' in name:
stable = version.strip() stable = version.strip()
elif 'latest beta' in name: elif 'snapshot for the stable' in name:
beta = version.strip() snapshot = version.strip()
elif '-mm patch' in name:
mm = version.strip()
finally: finally:
fd.close() fd.close()
irc.reply('The latest stable kernel is %s; ' irc.reply('The latest stable kernel is %s; '
'the latest beta kernel is %s.' % (stable, beta)) 'the latest snapshot of the stable kernel is %s; '
'the latest beta kernel is %s.' % (stable, snapshot, mm))
_pgpkeyre = re.compile(r'pub\s+\d{4}\w/<a href="([^"]+)">' _pgpkeyre = re.compile(r'pub\s+\d{4}\w/<a href="([^"]+)">'
r'([^<]+)</a>[^>]+>([^<]+)</a>') r'([^<]+)</a>[^>]+>([^<]+)</a>')