diff options
author | Jonathan Liu <net147@gmail.com> | 2014-02-23 07:35:59 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-02-25 08:03:32 +0000 |
commit | 824cc754267ef70b5b46d57f5f28bb390c04c6d2 (patch) | |
tree | cf5612dcb3ce79637acffa8d7e9def2971010d5c /meta/lib | |
parent | 1571cf6c68e3c75d12ef320d21c6525336f5e5a3 (diff) | |
download | poky-824cc754267ef70b5b46d57f5f28bb390c04c6d2.tar.gz |
package_manager.py: correctly handle empty opkg-query-helper.py output
If the output from opkg-query-helper.py is empty, output.split('\n')
would result in a list containing one element which is an empty string
while iterating over each line in the output. An exception is then
thrown by the line:
pkg, pkg_file, pkg_arch = line.split()
with the message:
Exception: ValueError: need more than 0 values to unpack
To avoid this, we add a condition to only split the output if it isn't
empty.
(From OE-Core rev: ee7b75c895e77ab20f728423c8efc2ced92265e8)
Signed-off-by: Jonathan Liu <net147@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oe/package_manager.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py index b430ee3a62..d29adaca7b 100644 --- a/meta/lib/oe/package_manager.py +++ b/meta/lib/oe/package_manager.py | |||
@@ -1141,7 +1141,7 @@ class OpkgPM(PackageManager): | |||
1141 | bb.fatal("Cannot get the installed packages list. Command '%s' " | 1141 | bb.fatal("Cannot get the installed packages list. Command '%s' " |
1142 | "returned %d:\n%s" % (cmd, e.returncode, e.output)) | 1142 | "returned %d:\n%s" % (cmd, e.returncode, e.output)) |
1143 | 1143 | ||
1144 | if format == "file": | 1144 | if output and format == "file": |
1145 | tmp_output = "" | 1145 | tmp_output = "" |
1146 | for line in output.split('\n'): | 1146 | for line in output.split('\n'): |
1147 | pkg, pkg_file, pkg_arch = line.split() | 1147 | pkg, pkg_file, pkg_arch = line.split() |