diff options
Diffstat (limited to 'meta/lib/oe/package_manager.py')
-rw-r--r-- | meta/lib/oe/package_manager.py | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py index 630b957ba9..c34e4366bf 100644 --- a/meta/lib/oe/package_manager.py +++ b/meta/lib/oe/package_manager.py | |||
@@ -434,24 +434,30 @@ class OpkgPkgsList(PkgsList): | |||
434 | (self.opkg_cmd, self.opkg_args) | 434 | (self.opkg_cmd, self.opkg_args) |
435 | 435 | ||
436 | try: | 436 | try: |
437 | output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True).strip() | 437 | # bb.note(cmd) |
438 | tmp_output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True).strip() | ||
439 | |||
438 | except subprocess.CalledProcessError as e: | 440 | except subprocess.CalledProcessError as e: |
439 | bb.fatal("Cannot get the installed packages list. Command '%s' " | 441 | bb.fatal("Cannot get the installed packages list. Command '%s' " |
440 | "returned %d:\n%s" % (cmd, e.returncode, e.output)) | 442 | "returned %d:\n%s" % (cmd, e.returncode, e.output)) |
441 | 443 | ||
442 | if output and format == "file": | 444 | output = list() |
443 | tmp_output = "" | 445 | for line in tmp_output.split('\n'): |
444 | for line in output.split('\n'): | 446 | if len(line.strip()) == 0: |
447 | continue | ||
448 | if format == "file": | ||
445 | pkg, pkg_file, pkg_arch = line.split() | 449 | pkg, pkg_file, pkg_arch = line.split() |
446 | full_path = os.path.join(self.rootfs_dir, pkg_arch, pkg_file) | 450 | full_path = os.path.join(self.rootfs_dir, pkg_arch, pkg_file) |
447 | if os.path.exists(full_path): | 451 | if os.path.exists(full_path): |
448 | tmp_output += "%s %s %s\n" % (pkg, full_path, pkg_arch) | 452 | output.append('%s %s %s' % (pkg, full_path, pkg_arch)) |
449 | else: | 453 | else: |
450 | tmp_output += "%s %s %s\n" % (pkg, pkg_file, pkg_arch) | 454 | output.append('%s %s %s' % (pkg, pkg_file, pkg_arch)) |
455 | else: | ||
456 | output.append(line) | ||
451 | 457 | ||
452 | output = tmp_output | 458 | output.sort() |
453 | 459 | ||
454 | return output | 460 | return '\n'.join(output) |
455 | 461 | ||
456 | 462 | ||
457 | class DpkgPkgsList(PkgsList): | 463 | class DpkgPkgsList(PkgsList): |