diff options
author | Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com> | 2021-01-26 17:35:13 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-01-27 10:17:45 +0000 |
commit | f22225a413be9e648210089eb75ab2d0f7072281 (patch) | |
tree | a28bc4612ec143968abde7abcf55ca1c74111c16 /meta/lib | |
parent | 6bc8f8ac0f362e2e4eac8fcafcca78d9ca93d37d (diff) | |
download | poky-f22225a413be9e648210089eb75ab2d0f7072281.tar.gz |
lib/oe/package_manager: Do not pass stderr to package manager as an argument
The cmd redirected stderr to stdout that was then assigned to variable
with pkgs to install. Then this variable was passed to package manager
that then tried to install it and generated confusing warnings.
For example this variable could contain:
| ['(en_US.UTF-8)', 'LC_ALL:', 'bash:', 'cannot', 'change', 'locale', 'setlocale:', 'warning:']
and the warning was:
| WARNING: addon-bci-1.0-r0 do_populate_sdk: Unable to install packages.
| Command 'PATH/usr/bin/opkg ... install (en_US.UTF-8) LC_ALL: bash:
| cannot change locale setlocale: warning:' returned 255:
| Collected errors:
| * opkg_prepare_url_for_install: Couldn't find anything to satisfy '(en_US.UTF-8)'.
In this change I remove stderr redirection to stdout and pass it to
bb.note instead.
(From OE-Core rev: 70d8ced3d7f53f988c02ff03d8dfa448f088fdf1)
Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oe/package_manager/__init__.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/meta/lib/oe/package_manager/__init__.py b/meta/lib/oe/package_manager/__init__.py index 42225a3b2e..8e7128b195 100644 --- a/meta/lib/oe/package_manager/__init__.py +++ b/meta/lib/oe/package_manager/__init__.py | |||
@@ -328,7 +328,11 @@ class PackageManager(object, metaclass=ABCMeta): | |||
328 | try: | 328 | try: |
329 | bb.note("Installing globbed packages...") | 329 | bb.note("Installing globbed packages...") |
330 | cmd = ["oe-pkgdata-util", "-p", pkgdatadir, "list-pkgs", globs] | 330 | cmd = ["oe-pkgdata-util", "-p", pkgdatadir, "list-pkgs", globs] |
331 | pkgs = subprocess.check_output(cmd, stderr=subprocess.STDOUT).decode("utf-8") | 331 | bb.note('Running %s' % cmd) |
332 | proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) | ||
333 | stdout, stderr = proc.communicate() | ||
334 | if stderr: bb.note(stderr.decode("utf-8")) | ||
335 | pkgs = stdout.decode("utf-8") | ||
332 | self.install(pkgs.split(), attempt_only=True) | 336 | self.install(pkgs.split(), attempt_only=True) |
333 | except subprocess.CalledProcessError as e: | 337 | except subprocess.CalledProcessError as e: |
334 | # Return code 1 means no packages matched | 338 | # Return code 1 means no packages matched |
@@ -384,7 +388,10 @@ class PackageManager(object, metaclass=ABCMeta): | |||
384 | cmd.extend(['--exclude=' + '|'.join(exclude.split())]) | 388 | cmd.extend(['--exclude=' + '|'.join(exclude.split())]) |
385 | try: | 389 | try: |
386 | bb.note('Running %s' % cmd) | 390 | bb.note('Running %s' % cmd) |
387 | complementary_pkgs = subprocess.check_output(cmd, stderr=subprocess.STDOUT).decode("utf-8") | 391 | proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
392 | stdout, stderr = proc.communicate() | ||
393 | if stderr: bb.note(stderr.decode("utf-8")) | ||
394 | complementary_pkgs = stdout.decode("utf-8") | ||
388 | complementary_pkgs = set(complementary_pkgs.split()) | 395 | complementary_pkgs = set(complementary_pkgs.split()) |
389 | skip_pkgs = sorted(complementary_pkgs & provided_pkgs) | 396 | skip_pkgs = sorted(complementary_pkgs & provided_pkgs) |
390 | install_pkgs = sorted(complementary_pkgs - provided_pkgs) | 397 | install_pkgs = sorted(complementary_pkgs - provided_pkgs) |