diff options
author | Fredrik Gustafsson <fredrik.gustafsson@axis.com> | 2020-07-24 16:42:30 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-07-27 19:58:10 +0100 |
commit | a0416ca06e9150b19bc572f3ad6a49428312961e (patch) | |
tree | 4ff520839a5c7bb4a8919bfd882342328575111c /meta/lib/oe/manifest.py | |
parent | 34dc8571d2d7c2bb9b5f92e157ab91e9d4f9e992 (diff) | |
download | poky-a0416ca06e9150b19bc572f3ad6a49428312961e.tar.gz |
rpm: Move 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: 87a1c8ee406f73e53888df3b682e8a5f0f610c2f)
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 | 53 |
1 files changed, 2 insertions, 51 deletions
diff --git a/meta/lib/oe/manifest.py b/meta/lib/oe/manifest.py index f7c88f9a09..17461cda64 100644 --- a/meta/lib/oe/manifest.py +++ b/meta/lib/oe/manifest.py | |||
@@ -7,7 +7,6 @@ import os | |||
7 | import re | 7 | import re |
8 | import bb | 8 | import bb |
9 | 9 | ||
10 | |||
11 | class Manifest(object, metaclass=ABCMeta): | 10 | class Manifest(object, metaclass=ABCMeta): |
12 | """ | 11 | """ |
13 | This is an abstract class. Do not instantiate this directly. | 12 | This is an abstract class. Do not instantiate this directly. |
@@ -189,56 +188,6 @@ class Manifest(object, metaclass=ABCMeta): | |||
189 | return installed_pkgs | 188 | return installed_pkgs |
190 | 189 | ||
191 | 190 | ||
192 | class RpmManifest(Manifest): | ||
193 | """ | ||
194 | Returns a dictionary object with mip and mlp packages. | ||
195 | """ | ||
196 | def _split_multilib(self, pkg_list): | ||
197 | pkgs = dict() | ||
198 | |||
199 | for pkg in pkg_list.split(): | ||
200 | pkg_type = self.PKG_TYPE_MUST_INSTALL | ||
201 | |||
202 | ml_variants = self.d.getVar('MULTILIB_VARIANTS').split() | ||
203 | |||
204 | for ml_variant in ml_variants: | ||
205 | if pkg.startswith(ml_variant + '-'): | ||
206 | pkg_type = self.PKG_TYPE_MULTILIB | ||
207 | |||
208 | if not pkg_type in pkgs: | ||
209 | pkgs[pkg_type] = pkg | ||
210 | else: | ||
211 | pkgs[pkg_type] += " " + pkg | ||
212 | |||
213 | return pkgs | ||
214 | |||
215 | def create_initial(self): | ||
216 | pkgs = dict() | ||
217 | |||
218 | with open(self.initial_manifest, "w+") as manifest: | ||
219 | manifest.write(self.initial_manifest_file_header) | ||
220 | |||
221 | for var in self.var_maps[self.manifest_type]: | ||
222 | if var in self.vars_to_split: | ||
223 | split_pkgs = self._split_multilib(self.d.getVar(var)) | ||
224 | if split_pkgs is not None: | ||
225 | pkgs = dict(list(pkgs.items()) + list(split_pkgs.items())) | ||
226 | else: | ||
227 | pkg_list = self.d.getVar(var) | ||
228 | if pkg_list is not None: | ||
229 | pkgs[self.var_maps[self.manifest_type][var]] = self.d.getVar(var) | ||
230 | |||
231 | for pkg_type in pkgs: | ||
232 | for pkg in pkgs[pkg_type].split(): | ||
233 | manifest.write("%s,%s\n" % (pkg_type, pkg)) | ||
234 | |||
235 | def create_final(self): | ||
236 | pass | ||
237 | |||
238 | def create_full(self, pm): | ||
239 | pass | ||
240 | |||
241 | |||
242 | class OpkgManifest(Manifest): | 191 | class OpkgManifest(Manifest): |
243 | """ | 192 | """ |
244 | Returns a dictionary object with mip and mlp packages. | 193 | Returns a dictionary object with mip and mlp packages. |
@@ -332,6 +281,8 @@ class DpkgManifest(Manifest): | |||
332 | 281 | ||
333 | def create_manifest(d, final_manifest=False, manifest_dir=None, | 282 | def create_manifest(d, final_manifest=False, manifest_dir=None, |
334 | manifest_type=Manifest.MANIFEST_TYPE_IMAGE): | 283 | manifest_type=Manifest.MANIFEST_TYPE_IMAGE): |
284 | |||
285 | from oe.package_manager.rpm.manifest import RpmManifest | ||
335 | manifest_map = {'rpm': RpmManifest, | 286 | manifest_map = {'rpm': RpmManifest, |
336 | 'ipk': OpkgManifest, | 287 | 'ipk': OpkgManifest, |
337 | 'deb': DpkgManifest} | 288 | 'deb': DpkgManifest} |