Fix pecl list if no package installed

This commit is contained in:
Hung-te Liang 2012-10-24 19:20:57 +08:00
parent 0bc4d05f31
commit 1a9f41ced4

View File

@ -55,12 +55,19 @@ def list():
List installed pecl extensions.
'''
pecls = {}
lines = _pecl('list').splitlines()
lines.pop(0)
'''
Only one line if no package installed:
(no packages installed from channel pecl.php.net)
'''
if not lines:
return pecls
lines.pop(0)
lines.pop(0)
pecls = {}
for line in lines:
m = re.match('^([^ ]+)[ ]+([^ ]+)[ ]+([^ ]+)', line)
if m: