summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/manifest.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oe/manifest.py')
-rw-r--r--meta/lib/oe/manifest.py72
1 files changed, 1 insertions, 71 deletions
diff --git a/meta/lib/oe/manifest.py b/meta/lib/oe/manifest.py
index 17461cda64..f87c150d33 100644
--- a/meta/lib/oe/manifest.py
+++ b/meta/lib/oe/manifest.py
@@ -187,76 +187,6 @@ class Manifest(object, metaclass=ABCMeta):
187 187
188 return installed_pkgs 188 return installed_pkgs
189 189
190
191class OpkgManifest(Manifest):
192 """
193 Returns a dictionary object with mip and mlp packages.
194 """
195 def _split_multilib(self, pkg_list):
196 pkgs = dict()
197
198 for pkg in pkg_list.split():
199 pkg_type = self.PKG_TYPE_MUST_INSTALL
200
201 ml_variants = self.d.getVar('MULTILIB_VARIANTS').split()
202
203 for ml_variant in ml_variants:
204 if pkg.startswith(ml_variant + '-'):
205 pkg_type = self.PKG_TYPE_MULTILIB
206
207 if not pkg_type in pkgs:
208 pkgs[pkg_type] = pkg
209 else:
210 pkgs[pkg_type] += " " + pkg
211
212 return pkgs
213
214 def create_initial(self):
215 pkgs = dict()
216
217 with open(self.initial_manifest, "w+") as manifest:
218 manifest.write(self.initial_manifest_file_header)
219
220 for var in self.var_maps[self.manifest_type]:
221 if var in self.vars_to_split:
222 split_pkgs = self._split_multilib(self.d.getVar(var))
223 if split_pkgs is not None:
224 pkgs = dict(list(pkgs.items()) + list(split_pkgs.items()))
225 else:
226 pkg_list = self.d.getVar(var)
227 if pkg_list is not None:
228 pkgs[self.var_maps[self.manifest_type][var]] = self.d.getVar(var)
229
230 for pkg_type in sorted(pkgs):
231 for pkg in sorted(pkgs[pkg_type].split()):
232 manifest.write("%s,%s\n" % (pkg_type, pkg))
233
234 def create_final(self):
235 pass
236
237 def create_full(self, pm):
238 if not os.path.exists(self.initial_manifest):
239 self.create_initial()
240
241 initial_manifest = self.parse_initial_manifest()
242 pkgs_to_install = list()
243 for pkg_type in initial_manifest:
244 pkgs_to_install += initial_manifest[pkg_type]
245 if len(pkgs_to_install) == 0:
246 return
247
248 output = pm.dummy_install(pkgs_to_install)
249
250 with open(self.full_manifest, 'w+') as manifest:
251 pkg_re = re.compile('^Installing ([^ ]+) [^ ].*')
252 for line in set(output.split('\n')):
253 m = pkg_re.match(line)
254 if m:
255 manifest.write(m.group(1) + '\n')
256
257 return
258
259
260class DpkgManifest(Manifest): 190class DpkgManifest(Manifest):
261 def create_initial(self): 191 def create_initial(self):
262 with open(self.initial_manifest, "w+") as manifest: 192 with open(self.initial_manifest, "w+") as manifest:
@@ -281,8 +211,8 @@ class DpkgManifest(Manifest):
281 211
282def create_manifest(d, final_manifest=False, manifest_dir=None, 212def create_manifest(d, final_manifest=False, manifest_dir=None,
283 manifest_type=Manifest.MANIFEST_TYPE_IMAGE): 213 manifest_type=Manifest.MANIFEST_TYPE_IMAGE):
284
285 from oe.package_manager.rpm.manifest import RpmManifest 214 from oe.package_manager.rpm.manifest import RpmManifest
215 from oe.package_manager.ipk.manifest import OpkgManifest
286 manifest_map = {'rpm': RpmManifest, 216 manifest_map = {'rpm': RpmManifest,
287 'ipk': OpkgManifest, 217 'ipk': OpkgManifest,
288 'deb': DpkgManifest} 218 'deb': DpkgManifest}