summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/lib/oe/package_manager.py83
1 files changed, 81 insertions, 2 deletions
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index 292ed44461..c51e88be58 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -605,12 +605,12 @@ class PackageManager(object):
605 cmd.extend(['-x', exclude]) 605 cmd.extend(['-x', exclude])
606 try: 606 try:
607 bb.note("Installing complementary packages ...") 607 bb.note("Installing complementary packages ...")
608 bb.note('Running %s' % cmd)
608 complementary_pkgs = subprocess.check_output(cmd, stderr=subprocess.STDOUT) 609 complementary_pkgs = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
609 except subprocess.CalledProcessError as e: 610 except subprocess.CalledProcessError as e:
610 bb.fatal("Could not compute complementary packages list. Command " 611 bb.fatal("Could not compute complementary packages list. Command "
611 "'%s' returned %d:\n%s" % 612 "'%s' returned %d:\n%s" %
612 (' '.join(cmd), e.returncode, e.output)) 613 (' '.join(cmd), e.returncode, e.output))
613
614 self.install(complementary_pkgs.split(), attempt_only=True) 614 self.install(complementary_pkgs.split(), attempt_only=True)
615 615
616 def deploy_dir_lock(self): 616 def deploy_dir_lock(self):
@@ -1050,6 +1050,35 @@ class RpmPM(PackageManager):
1050 def update(self): 1050 def update(self):
1051 self._invoke_smart('update rpmsys') 1051 self._invoke_smart('update rpmsys')
1052 1052
1053 def get_rdepends_recursively(self, pkgs):
1054 # pkgs will be changed during the loop, so use [:] to make a copy.
1055 for pkg in pkgs[:]:
1056 sub_data = oe.packagedata.read_subpkgdata(pkg, self.d)
1057 sub_rdep = sub_data.get("RDEPENDS_" + pkg)
1058 if not sub_rdep:
1059 continue
1060 done = bb.utils.explode_dep_versions2(sub_rdep).keys()
1061 next = done
1062 # Find all the rdepends on dependency chain
1063 while next:
1064 new = []
1065 for sub_pkg in next:
1066 sub_data = oe.packagedata.read_subpkgdata(sub_pkg, self.d)
1067 sub_pkg_rdep = sub_data.get("RDEPENDS_" + sub_pkg)
1068 if not sub_pkg_rdep:
1069 continue
1070 for p in bb.utils.explode_dep_versions2(sub_pkg_rdep):
1071 # Already handled, skip it.
1072 if p in done or p in pkgs:
1073 continue
1074 # It's a new dep
1075 if oe.packagedata.has_subpkgdata(p, self.d):
1076 done.append(p)
1077 new.append(p)
1078 next = new
1079 pkgs.extend(done)
1080 return pkgs
1081
1053 ''' 1082 '''
1054 Install pkgs with smart, the pkg name is oe format 1083 Install pkgs with smart, the pkg name is oe format
1055 ''' 1084 '''
@@ -1059,8 +1088,58 @@ class RpmPM(PackageManager):
1059 bb.note("There are no packages to install") 1088 bb.note("There are no packages to install")
1060 return 1089 return
1061 bb.note("Installing the following packages: %s" % ' '.join(pkgs)) 1090 bb.note("Installing the following packages: %s" % ' '.join(pkgs))
1091 if not attempt_only:
1092 # Pull in multilib requires since rpm may not pull in them
1093 # correctly, for example,
1094 # lib32-packagegroup-core-standalone-sdk-target requires
1095 # lib32-libc6, but rpm may pull in libc6 rather than lib32-libc6
1096 # since it doesn't know mlprefix (lib32-), bitbake knows it and
1097 # can handle it well, find out the RDEPENDS on the chain will
1098 # fix the problem. Both do_rootfs and do_populate_sdk have this
1099 # issue.
1100 # The attempt_only packages don't need this since they are
1101 # based on the installed ones.
1102 #
1103 # Separate pkgs into two lists, one is multilib, the other one
1104 # is non-multilib.
1105 ml_pkgs = []
1106 non_ml_pkgs = pkgs[:]
1107 for pkg in pkgs:
1108 for mlib in (self.d.getVar("MULTILIB_VARIANTS", True) or "").split():
1109 if pkg.startswith(mlib + '-'):
1110 ml_pkgs.append(pkg)
1111 non_ml_pkgs.remove(pkg)
1112
1113 if len(ml_pkgs) > 0 and len(non_ml_pkgs) > 0:
1114 # Found both foo and lib-foo
1115 ml_pkgs = self.get_rdepends_recursively(ml_pkgs)
1116 non_ml_pkgs = self.get_rdepends_recursively(non_ml_pkgs)
1117 # Longer list makes smart slower, so only keep the pkgs
1118 # which have the same BPN, and smart can handle others
1119 # correctly.
1120 pkgs_new = []
1121 for pkg in non_ml_pkgs:
1122 for mlib in (self.d.getVar("MULTILIB_VARIANTS", True) or "").split():
1123 mlib_pkg = mlib + "-" + pkg
1124 if mlib_pkg in ml_pkgs:
1125 pkgs_new.append(pkg)
1126 pkgs_new.append(mlib_pkg)
1127 for pkg in pkgs:
1128 if pkg not in pkgs_new:
1129 pkgs_new.append(pkg)
1130 pkgs = pkgs_new
1131 new_depends = {}
1132 deps = bb.utils.explode_dep_versions2(" ".join(pkgs))
1133 for depend in deps:
1134 data = oe.packagedata.read_subpkgdata(depend, self.d)
1135 key = "PKG_%s" % depend
1136 if key in data:
1137 new_depend = data[key]
1138 else:
1139 new_depend = depend
1140 new_depends[new_depend] = deps[depend]
1141 pkgs = bb.utils.join_deps(new_depends, commasep=True).split(', ')
1062 pkgs = self._pkg_translate_oe_to_smart(pkgs, attempt_only) 1142 pkgs = self._pkg_translate_oe_to_smart(pkgs, attempt_only)
1063
1064 if not attempt_only: 1143 if not attempt_only:
1065 bb.note('to be installed: %s' % ' '.join(pkgs)) 1144 bb.note('to be installed: %s' % ' '.join(pkgs))
1066 cmd = "%s %s install -y %s" % \ 1145 cmd = "%s %s install -y %s" % \