summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/lib/oe/manifest.py51
1 files changed, 44 insertions, 7 deletions
diff --git a/meta/lib/oe/manifest.py b/meta/lib/oe/manifest.py
index 5d01022c36..3c5715e74a 100644
--- a/meta/lib/oe/manifest.py
+++ b/meta/lib/oe/manifest.py
@@ -33,6 +33,10 @@ class Manifest(object):
33 self.initial_manifest = os.path.join(self.manifest_dir, "initial_manifest") 33 self.initial_manifest = os.path.join(self.manifest_dir, "initial_manifest")
34 self.final_manifest = os.path.join(self.manifest_dir, "final_manifest") 34 self.final_manifest = os.path.join(self.manifest_dir, "final_manifest")
35 35
36 self.var_map = {"PACKAGE_INSTALL": "mip",
37 "PACKAGE_INSTALL_ATTEMPTONLY": "aop",
38 "LINGUAS_INSTALL": "lgp"}
39
36 """ 40 """
37 This creates a standard initial manifest for core-image-(minimal|sato|sato-sdk). 41 This creates a standard initial manifest for core-image-(minimal|sato|sato-sdk).
38 This will be used for testing until the class is implemented properly! 42 This will be used for testing until the class is implemented properly!
@@ -119,8 +123,45 @@ class RpmManifest(Manifest):
119 123
120 124
121class OpkgManifest(Manifest): 125class OpkgManifest(Manifest):
126 """
127 Returns a dictionary object with mip and mlp packages.
128 """
129 def _split_multilib(self, pkg_list):
130 pkgs = dict()
131
132 for pkg in pkg_list.split():
133 pkg_type = 'mip'
134
135 ml_variants = self.d.getVar('MULTILIB_VARIANTS', True).split()
136
137 for ml_variant in ml_variants:
138 if pkg.startswith(ml_variant + '-'):
139 pkg_type = 'mlp'
140
141 if not pkg_type in pkgs:
142 pkgs[pkg_type] = pkg
143 else:
144 pkgs[pkg_type] += " " + pkg
145
146 return pkgs
147
122 def create_initial(self): 148 def create_initial(self):
123 self._create_dummy_initial() 149 pkgs = dict()
150
151 with open(self.initial_manifest, "w+") as manifest:
152 manifest.write(self.initial_manifest_file_header)
153
154 for var in self.var_map:
155 if var == "PACKAGE_INSTALL":
156 split_pkgs = self._split_multilib(self.d.getVar(var, True))
157 if split_pkgs is not None:
158 pkgs = dict(pkgs.items() + split_pkgs.items())
159 else:
160 pkgs[self.var_map[var]] = self.d.getVar(var, True)
161
162 for pkg_type in pkgs:
163 for pkg in pkgs[pkg_type].split():
164 manifest.write("%s,%s\n" % (pkg_type, pkg))
124 165
125 def create_final(self): 166 def create_final(self):
126 pass 167 pass
@@ -128,21 +169,17 @@ class OpkgManifest(Manifest):
128 169
129class DpkgManifest(Manifest): 170class DpkgManifest(Manifest):
130 def create_initial(self): 171 def create_initial(self):
131 var_map = {"PACKAGE_INSTALL": "mip",
132 "PACKAGE_INSTALL_ATTEMPTONLY": "aop",
133 "LINGUAS_INSTALL": "lgp"}
134
135 with open(self.initial_manifest, "w+") as manifest: 172 with open(self.initial_manifest, "w+") as manifest:
136 manifest.write(self.initial_manifest_file_header) 173 manifest.write(self.initial_manifest_file_header)
137 174
138 for var in var_map: 175 for var in self.var_map:
139 pkg_list = self.d.getVar(var, True) 176 pkg_list = self.d.getVar(var, True)
140 177
141 if pkg_list is None: 178 if pkg_list is None:
142 continue 179 continue
143 180
144 for pkg in pkg_list.split(): 181 for pkg in pkg_list.split():
145 manifest.write("%s,%s\n" % (var_map[var], pkg)) 182 manifest.write("%s,%s\n" % (self.var_map[var], pkg))
146 183
147 def create_final(self): 184 def create_final(self):
148 pass 185 pass