Andrew Geissler | 635e0e4 | 2020-08-21 15:58:33 -0500 | [diff] [blame] | 1 | # |
| 2 | # SPDX-License-Identifier: GPL-2.0-only |
| 3 | # |
| 4 | |
| 5 | from oe.manifest import Manifest |
| 6 | |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 7 | class PkgManifest(Manifest): |
Andrew Geissler | 635e0e4 | 2020-08-21 15:58:33 -0500 | [diff] [blame] | 8 | """ |
| 9 | Returns a dictionary object with mip and mlp packages. |
| 10 | """ |
| 11 | def _split_multilib(self, pkg_list): |
| 12 | pkgs = dict() |
| 13 | |
| 14 | for pkg in pkg_list.split(): |
| 15 | pkg_type = self.PKG_TYPE_MUST_INSTALL |
| 16 | |
| 17 | ml_variants = self.d.getVar('MULTILIB_VARIANTS').split() |
| 18 | |
| 19 | for ml_variant in ml_variants: |
| 20 | if pkg.startswith(ml_variant + '-'): |
| 21 | pkg_type = self.PKG_TYPE_MULTILIB |
| 22 | |
| 23 | if not pkg_type in pkgs: |
| 24 | pkgs[pkg_type] = pkg |
| 25 | else: |
| 26 | pkgs[pkg_type] += " " + pkg |
| 27 | |
| 28 | return pkgs |
| 29 | |
| 30 | def create_initial(self): |
| 31 | pkgs = dict() |
| 32 | |
| 33 | with open(self.initial_manifest, "w+") as manifest: |
| 34 | manifest.write(self.initial_manifest_file_header) |
| 35 | |
| 36 | for var in self.var_maps[self.manifest_type]: |
| 37 | if var in self.vars_to_split: |
| 38 | split_pkgs = self._split_multilib(self.d.getVar(var)) |
| 39 | if split_pkgs is not None: |
| 40 | pkgs = dict(list(pkgs.items()) + list(split_pkgs.items())) |
| 41 | else: |
| 42 | pkg_list = self.d.getVar(var) |
| 43 | if pkg_list is not None: |
| 44 | pkgs[self.var_maps[self.manifest_type][var]] = self.d.getVar(var) |
| 45 | |
| 46 | for pkg_type in pkgs: |
| 47 | for pkg in pkgs[pkg_type].split(): |
| 48 | manifest.write("%s,%s\n" % (pkg_type, pkg)) |
| 49 | |
| 50 | def create_final(self): |
| 51 | pass |
| 52 | |
| 53 | def create_full(self, pm): |
| 54 | pass |