diff options
Diffstat (limited to 'meta/lib/oe')
-rw-r--r-- | meta/lib/oe/package_manager.py | 83 |
1 files changed, 81 insertions, 2 deletions
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py index 505509543d..e4a935a2c5 100644 --- a/meta/lib/oe/package_manager.py +++ b/meta/lib/oe/package_manager.py | |||
@@ -536,12 +536,12 @@ class PackageManager(object): | |||
536 | cmd.extend(['-x', exclude]) | 536 | cmd.extend(['-x', exclude]) |
537 | try: | 537 | try: |
538 | bb.note("Installing complementary packages ...") | 538 | bb.note("Installing complementary packages ...") |
539 | bb.note('Running %s' % cmd) | ||
539 | complementary_pkgs = subprocess.check_output(cmd, stderr=subprocess.STDOUT) | 540 | complementary_pkgs = subprocess.check_output(cmd, stderr=subprocess.STDOUT) |
540 | except subprocess.CalledProcessError as e: | 541 | except subprocess.CalledProcessError as e: |
541 | bb.fatal("Could not compute complementary packages list. Command " | 542 | bb.fatal("Could not compute complementary packages list. Command " |
542 | "'%s' returned %d:\n%s" % | 543 | "'%s' returned %d:\n%s" % |
543 | (' '.join(cmd), e.returncode, e.output)) | 544 | (' '.join(cmd), e.returncode, e.output)) |
544 | |||
545 | self.install(complementary_pkgs.split(), attempt_only=True) | 545 | self.install(complementary_pkgs.split(), attempt_only=True) |
546 | 546 | ||
547 | def deploy_dir_lock(self): | 547 | def deploy_dir_lock(self): |
@@ -952,6 +952,35 @@ class RpmPM(PackageManager): | |||
952 | def update(self): | 952 | def update(self): |
953 | self._invoke_smart('update rpmsys') | 953 | self._invoke_smart('update rpmsys') |
954 | 954 | ||
955 | def get_rdepends_recursively(self, pkgs): | ||
956 | # pkgs will be changed during the loop, so use [:] to make a copy. | ||
957 | for pkg in pkgs[:]: | ||
958 | sub_data = oe.packagedata.read_subpkgdata(pkg, self.d) | ||
959 | sub_rdep = sub_data.get("RDEPENDS_" + pkg) | ||
960 | if not sub_rdep: | ||
961 | continue | ||
962 | done = bb.utils.explode_dep_versions2(sub_rdep).keys() | ||
963 | next = done | ||
964 | # Find all the rdepends on dependency chain | ||
965 | while next: | ||
966 | new = [] | ||
967 | for sub_pkg in next: | ||
968 | sub_data = oe.packagedata.read_subpkgdata(sub_pkg, self.d) | ||
969 | sub_pkg_rdep = sub_data.get("RDEPENDS_" + sub_pkg) | ||
970 | if not sub_pkg_rdep: | ||
971 | continue | ||
972 | for p in bb.utils.explode_dep_versions2(sub_pkg_rdep): | ||
973 | # Already handled, skip it. | ||
974 | if p in done or p in pkgs: | ||
975 | continue | ||
976 | # It's a new dep | ||
977 | if oe.packagedata.has_subpkgdata(p, self.d): | ||
978 | done.append(p) | ||
979 | new.append(p) | ||
980 | next = new | ||
981 | pkgs.extend(done) | ||
982 | return pkgs | ||
983 | |||
955 | ''' | 984 | ''' |
956 | Install pkgs with smart, the pkg name is oe format | 985 | Install pkgs with smart, the pkg name is oe format |
957 | ''' | 986 | ''' |
@@ -960,8 +989,58 @@ class RpmPM(PackageManager): | |||
960 | bb.note("Installing the following packages: %s" % ' '.join(pkgs)) | 989 | bb.note("Installing the following packages: %s" % ' '.join(pkgs)) |
961 | if attempt_only and len(pkgs) == 0: | 990 | if attempt_only and len(pkgs) == 0: |
962 | return | 991 | return |
992 | if not attempt_only: | ||
993 | # Pull in multilib requires since rpm may not pull in them | ||
994 | # correctly, for example, | ||
995 | # lib32-packagegroup-core-standalone-sdk-target requires | ||
996 | # lib32-libc6, but rpm may pull in libc6 rather than lib32-libc6 | ||
997 | # since it doesn't know mlprefix (lib32-), bitbake knows it and | ||
998 | # can handle it well, find out the RDEPENDS on the chain will | ||
999 | # fix the problem. Both do_rootfs and do_populate_sdk have this | ||
1000 | # issue. | ||
1001 | # The attempt_only packages don't need this since they are | ||
1002 | # based on the installed ones. | ||
1003 | # | ||
1004 | # Separate pkgs into two lists, one is multilib, the other one | ||
1005 | # is non-multilib. | ||
1006 | ml_pkgs = [] | ||
1007 | non_ml_pkgs = pkgs[:] | ||
1008 | for pkg in pkgs: | ||
1009 | for mlib in (self.d.getVar("MULTILIB_VARIANTS", True) or "").split(): | ||
1010 | if pkg.startswith(mlib + '-'): | ||
1011 | ml_pkgs.append(pkg) | ||
1012 | non_ml_pkgs.remove(pkg) | ||
1013 | |||
1014 | if len(ml_pkgs) > 0 and len(non_ml_pkgs) > 0: | ||
1015 | # Found both foo and lib-foo | ||
1016 | ml_pkgs = self.get_rdepends_recursively(ml_pkgs) | ||
1017 | non_ml_pkgs = self.get_rdepends_recursively(non_ml_pkgs) | ||
1018 | # Longer list makes smart slower, so only keep the pkgs | ||
1019 | # which have the same BPN, and smart can handle others | ||
1020 | # correctly. | ||
1021 | pkgs_new = [] | ||
1022 | for pkg in non_ml_pkgs: | ||
1023 | for mlib in (self.d.getVar("MULTILIB_VARIANTS", True) or "").split(): | ||
1024 | mlib_pkg = mlib + "-" + pkg | ||
1025 | if mlib_pkg in ml_pkgs: | ||
1026 | pkgs_new.append(pkg) | ||
1027 | pkgs_new.append(mlib_pkg) | ||
1028 | for pkg in pkgs: | ||
1029 | if pkg not in pkgs_new: | ||
1030 | pkgs_new.append(pkg) | ||
1031 | pkgs = pkgs_new | ||
1032 | new_depends = {} | ||
1033 | deps = bb.utils.explode_dep_versions2(" ".join(pkgs)) | ||
1034 | for depend in deps: | ||
1035 | data = oe.packagedata.read_subpkgdata(depend, self.d) | ||
1036 | key = "PKG_%s" % depend | ||
1037 | if key in data: | ||
1038 | new_depend = data[key] | ||
1039 | else: | ||
1040 | new_depend = depend | ||
1041 | new_depends[new_depend] = deps[depend] | ||
1042 | pkgs = bb.utils.join_deps(new_depends, commasep=True).split(', ') | ||
963 | pkgs = self._pkg_translate_oe_to_smart(pkgs, attempt_only) | 1043 | pkgs = self._pkg_translate_oe_to_smart(pkgs, attempt_only) |
964 | |||
965 | if not attempt_only: | 1044 | if not attempt_only: |
966 | bb.note('to be installed: %s' % ' '.join(pkgs)) | 1045 | bb.note('to be installed: %s' % ' '.join(pkgs)) |
967 | cmd = "%s %s install -y %s" % \ | 1046 | cmd = "%s %s install -y %s" % \ |