diff options
author | Fredrik Gustafsson <fredrik.gustafsson@axis.com> | 2020-07-24 16:42:31 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-07-27 19:58:10 +0100 |
commit | 59397b3a01d03f4063c3665a1d7e7e6e7dfb853d (patch) | |
tree | 48db01f790e0f347c9b368355f536da5bf21b358 /meta/lib/oe/manifest.py | |
parent | a0416ca06e9150b19bc572f3ad6a49428312961e (diff) | |
download | poky-59397b3a01d03f4063c3665a1d7e7e6e7dfb853d.tar.gz |
ipk: Move ipk manifest to its own subdir
This is a part of a refactor that will split the package manager
code so that it's possible to use other package managers in other
layers.
(From OE-Core rev: 405cd8560fed2e05fc82919d728c42516793cc0f)
Signed-off-by: Fredrik Gustafsson <fredrigu@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/manifest.py')
-rw-r--r-- | meta/lib/oe/manifest.py | 72 |
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 | |||
191 | class 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 | |||
260 | class DpkgManifest(Manifest): | 190 | class 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 | ||
282 | def create_manifest(d, final_manifest=False, manifest_dir=None, | 212 | def 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} |