mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-30 14:14:37 +01:00
Fixed a few bugs in debfile.
This commit is contained in:
parent
2aee3490d5
commit
d3fd184995
@ -105,11 +105,18 @@ class Debian(callbacks.Privmsg, PeriodicFileDownloader):
|
|||||||
(fd, _) = popen2.popen2(['zegrep', regexp, 'Contents-i386.gz'])
|
(fd, _) = popen2.popen2(['zegrep', regexp, 'Contents-i386.gz'])
|
||||||
packages = []
|
packages = []
|
||||||
for line in fd:
|
for line in fd:
|
||||||
(filename, package) = line[:-1].split()
|
try:
|
||||||
|
(filename, package) = line[:-1].split()
|
||||||
|
if filename == 'FILE':
|
||||||
|
# This is the last line before the actual files.
|
||||||
|
continue
|
||||||
|
except ValueError: # Unpack list of wrong size.
|
||||||
|
continue # We've not gotten to the files yet.
|
||||||
if r.search(filename):
|
if r.search(filename):
|
||||||
packages.extend(package.split(','))
|
packages.extend(package.split(','))
|
||||||
if len(packages) > 40:
|
if len(packages) > 40:
|
||||||
irc.error(msg, '>40 results returned, be more specific.')
|
irc.error(msg, 'More than 40 results returned, ' \
|
||||||
|
'please be more specific.')
|
||||||
return
|
return
|
||||||
if len(packages) == 0:
|
if len(packages) == 0:
|
||||||
irc.reply(msg, 'I found no packages with that file.')
|
irc.reply(msg, 'I found no packages with that file.')
|
||||||
|
Loading…
Reference in New Issue
Block a user