Debian: fix @new and add <version> parameter

master
Valentin Lorentz 2011-03-03 09:58:14 +01:00
parent db445ed0b8
commit 9b8dfdccab
1 changed files with 7 additions and 4 deletions

View File

@ -399,17 +399,19 @@ class Debian(callbacks.Plugin, PeriodicFileDownloader):
irc.reply(s) irc.reply(s)
stats = wrap(stats, ['somethingWithoutSpaces']) stats = wrap(stats, ['somethingWithoutSpaces'])
_newpkgre = re.compile(r'<li><a href[^>]+>([^<]+)</a>') _newpkgre = re.compile(r'<li><a href[^>/]+>([^<]+)</a>')
def new(self, irc, msg, args, section, glob): def new(self, irc, msg, args, section, version, glob):
"""[{main,contrib,non-free}] [<glob>] """[{main,contrib,non-free}] [<version>] [<glob>]
Checks for packages that have been added to Debian's unstable branch Checks for packages that have been added to Debian's unstable branch
in the past week. If no glob is specified, returns a list of all in the past week. If no glob is specified, returns a list of all
packages. If no section is specified, defaults to main. packages. If no section is specified, defaults to main.
""" """
if version is None:
version = 'unstable'
try: try:
fd = utils.web.getUrlFd( fd = utils.web.getUrlFd(
'http://packages.debian.org/unstable/newpkg_%s' % section) 'http://packages.debian.org/%s/%s/newpkg' % (version, section))
except utils.web.Error, e: except utils.web.Error, e:
irc.error(str(e), Raise=True) irc.error(str(e), Raise=True)
packages = [] packages = []
@ -426,6 +428,7 @@ class Debian(callbacks.Plugin, PeriodicFileDownloader):
irc.error('No packages matched that search.') irc.error('No packages matched that search.')
new = wrap(new, [optional(('literal', ('main', 'contrib', 'non-free')), new = wrap(new, [optional(('literal', ('main', 'contrib', 'non-free')),
'main'), 'main'),
optional('something'),
additional('glob', '*')]) additional('glob', '*')])
_severity = re.compile(r'.*(?:severity set to `([^\']+)\'|' _severity = re.compile(r'.*(?:severity set to `([^\']+)\'|'