diff options
Diffstat (limited to 'meta')
-rw-r--r-- | meta/lib/oe/package_manager.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py index e6319dc3b8..4d9e501f0e 100644 --- a/meta/lib/oe/package_manager.py +++ b/meta/lib/oe/package_manager.py | |||
@@ -578,6 +578,11 @@ class PackageManager(object, metaclass=ABCMeta): | |||
578 | # oe-pkgdata-util reads it from a file | 578 | # oe-pkgdata-util reads it from a file |
579 | with tempfile.NamedTemporaryFile(mode="w+", prefix="installed-pkgs") as installed_pkgs: | 579 | with tempfile.NamedTemporaryFile(mode="w+", prefix="installed-pkgs") as installed_pkgs: |
580 | pkgs = self.list_installed() | 580 | pkgs = self.list_installed() |
581 | |||
582 | provided_pkgs = set() | ||
583 | for pkg in pkgs.values(): | ||
584 | provided_pkgs |= set(pkg.get('provs', [])) | ||
585 | |||
581 | output = oe.utils.format_pkg_list(pkgs, "arch") | 586 | output = oe.utils.format_pkg_list(pkgs, "arch") |
582 | installed_pkgs.write(output) | 587 | installed_pkgs.write(output) |
583 | installed_pkgs.flush() | 588 | installed_pkgs.flush() |
@@ -589,10 +594,15 @@ class PackageManager(object, metaclass=ABCMeta): | |||
589 | if exclude: | 594 | if exclude: |
590 | cmd.extend(['--exclude=' + '|'.join(exclude.split())]) | 595 | cmd.extend(['--exclude=' + '|'.join(exclude.split())]) |
591 | try: | 596 | try: |
592 | bb.note("Installing complementary packages ...") | ||
593 | bb.note('Running %s' % cmd) | 597 | bb.note('Running %s' % cmd) |
594 | complementary_pkgs = subprocess.check_output(cmd, stderr=subprocess.STDOUT).decode("utf-8") | 598 | complementary_pkgs = subprocess.check_output(cmd, stderr=subprocess.STDOUT).decode("utf-8") |
595 | self.install(complementary_pkgs.split(), attempt_only=True) | 599 | complementary_pkgs = set(complementary_pkgs.split()) |
600 | skip_pkgs = sorted(complementary_pkgs & provided_pkgs) | ||
601 | install_pkgs = sorted(complementary_pkgs - provided_pkgs) | ||
602 | bb.note("Installing complementary packages ... %s (skipped already provided packages %s)" % ( | ||
603 | ' '.join(install_pkgs), | ||
604 | ' '.join(skip_pkgs))) | ||
605 | self.install(install_pkgs, attempt_only=True) | ||
596 | except subprocess.CalledProcessError as e: | 606 | except subprocess.CalledProcessError as e: |
597 | bb.fatal("Could not compute complementary packages list. Command " | 607 | bb.fatal("Could not compute complementary packages list. Command " |
598 | "'%s' returned %d:\n%s" % | 608 | "'%s' returned %d:\n%s" % |