blob: 6ee7c329f0c79c4e0fa885e8d0f2c3327847bfe6 [file] [log] [blame]
Andrew Geissler635e0e42020-08-21 15:58:33 -05001#
Patrick Williams92b42cb2022-09-03 06:53:57 -05002# Copyright OpenEmbedded Contributors
3#
Andrew Geissler635e0e42020-08-21 15:58:33 -05004# SPDX-License-Identifier: GPL-2.0-only
5#
6
7from oe.manifest import Manifest
8
Andrew Geissler6ce62a22020-11-30 19:58:47 -06009class PkgManifest(Manifest):
Andrew Geissler635e0e42020-08-21 15:58:33 -050010 """
11 Returns a dictionary object with mip and mlp packages.
12 """
13 def _split_multilib(self, pkg_list):
14 pkgs = dict()
15
16 for pkg in pkg_list.split():
17 pkg_type = self.PKG_TYPE_MUST_INSTALL
18
19 ml_variants = self.d.getVar('MULTILIB_VARIANTS').split()
20
21 for ml_variant in ml_variants:
22 if pkg.startswith(ml_variant + '-'):
23 pkg_type = self.PKG_TYPE_MULTILIB
24
25 if not pkg_type in pkgs:
26 pkgs[pkg_type] = pkg
27 else:
28 pkgs[pkg_type] += " " + pkg
29
30 return pkgs
31
32 def create_initial(self):
33 pkgs = dict()
34
35 with open(self.initial_manifest, "w+") as manifest:
36 manifest.write(self.initial_manifest_file_header)
37
38 for var in self.var_maps[self.manifest_type]:
39 if var in self.vars_to_split:
40 split_pkgs = self._split_multilib(self.d.getVar(var))
41 if split_pkgs is not None:
42 pkgs = dict(list(pkgs.items()) + list(split_pkgs.items()))
43 else:
44 pkg_list = self.d.getVar(var)
45 if pkg_list is not None:
46 pkgs[self.var_maps[self.manifest_type][var]] = self.d.getVar(var)
47
48 for pkg_type in pkgs:
49 for pkg in pkgs[pkg_type].split():
50 manifest.write("%s,%s\n" % (pkg_type, pkg))
51
52 def create_final(self):
53 pass
54
55 def create_full(self, pm):
56 pass