diff options
author | Laurentiu Palcu <laurentiu.palcu@intel.com> | 2014-02-14 13:01:05 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-02-14 12:30:19 +0000 |
commit | a0a045098115d94d31f6fcd3c16dd286ce16d84a (patch) | |
tree | 93649f13ee5a5a6d0bcb1d59f90b482e81c254cd /meta/lib/oe/rootfs.py | |
parent | aed96f6a6aee74d677c4647af159174477c134ab (diff) | |
download | poky-a0a045098115d94d31f6fcd3c16dd286ce16d84a.tar.gz |
package_manager.py, rootfs.py, sdk.py: add Indexer class
Because the package-index.bb needs to create package indexes outside
do_rootfs environment, move the indexing capability out of
PackageManager class to a smaller Indexer class.
This commit:
* simply moves the indexing functions for ipk/deb with no changes;
* rewrites the RPM indexing function so that it can be easily moved out
of the PackageManager class;
* removes some RPM duplicate code, moves it into a method inside
RpmPM class and changes the RpmPM constructor so that the new method
is effective;
(From OE-Core rev: d339d6f48f81330e94162f333aad76f3c65d6bfd)
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/rootfs.py')
-rw-r--r-- | meta/lib/oe/rootfs.py | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py index 6114f5652a..d149ca3eff 100644 --- a/meta/lib/oe/rootfs.py +++ b/meta/lib/oe/rootfs.py | |||
@@ -233,37 +233,8 @@ class RpmRootfs(Rootfs): | |||
233 | 233 | ||
234 | self.manifest = RpmManifest(d, manifest_dir) | 234 | self.manifest = RpmManifest(d, manifest_dir) |
235 | 235 | ||
236 | package_archs = { | ||
237 | 'default': [], | ||
238 | } | ||
239 | target_os = { | ||
240 | 'default': "", | ||
241 | } | ||
242 | package_archs['default'] = self.d.getVar("PACKAGE_ARCHS", True).split() | ||
243 | # arch order is reversed. This ensures the -best- match is | ||
244 | # listed first! | ||
245 | package_archs['default'].reverse() | ||
246 | target_os['default'] = self.d.getVar("TARGET_OS", True).strip() | ||
247 | multilibs = self.d.getVar('MULTILIBS', True) or "" | ||
248 | for ext in multilibs.split(): | ||
249 | eext = ext.split(':') | ||
250 | if len(eext) > 1 and eext[0] == 'multilib': | ||
251 | localdata = bb.data.createCopy(self.d) | ||
252 | default_tune_key = "DEFAULTTUNE_virtclass-multilib-" + eext[1] | ||
253 | default_tune = localdata.getVar(default_tune_key, False) | ||
254 | if default_tune: | ||
255 | localdata.setVar("DEFAULTTUNE", default_tune) | ||
256 | bb.data.update_data(localdata) | ||
257 | package_archs[eext[1]] = localdata.getVar('PACKAGE_ARCHS', | ||
258 | True).split() | ||
259 | package_archs[eext[1]].reverse() | ||
260 | target_os[eext[1]] = localdata.getVar("TARGET_OS", | ||
261 | True).strip() | ||
262 | |||
263 | self.pm = RpmPM(d, | 236 | self.pm = RpmPM(d, |
264 | d.getVar('IMAGE_ROOTFS', True), | 237 | d.getVar('IMAGE_ROOTFS', True), |
265 | package_archs, | ||
266 | target_os, | ||
267 | self.d.getVar('TARGET_VENDOR', True) | 238 | self.d.getVar('TARGET_VENDOR', True) |
268 | ) | 239 | ) |
269 | 240 | ||
@@ -634,37 +605,8 @@ def list_installed_packages(d, format=None, rootfs_dir=None): | |||
634 | 605 | ||
635 | img_type = d.getVar('IMAGE_PKGTYPE', True) | 606 | img_type = d.getVar('IMAGE_PKGTYPE', True) |
636 | if img_type == "rpm": | 607 | if img_type == "rpm": |
637 | package_archs = { | ||
638 | 'default': [], | ||
639 | } | ||
640 | target_os = { | ||
641 | 'default': "", | ||
642 | } | ||
643 | package_archs['default'] = d.getVar("PACKAGE_ARCHS", True).split() | ||
644 | # arch order is reversed. This ensures the -best- match is | ||
645 | # listed first! | ||
646 | package_archs['default'].reverse() | ||
647 | target_os['default'] = d.getVar("TARGET_OS", True).strip() | ||
648 | multilibs = d.getVar('MULTILIBS', True) or "" | ||
649 | for ext in multilibs.split(): | ||
650 | eext = ext.split(':') | ||
651 | if len(eext) > 1 and eext[0] == 'multilib': | ||
652 | localdata = bb.data.createCopy(d) | ||
653 | default_tune_key = "DEFAULTTUNE_virtclass-multilib-" + eext[1] | ||
654 | default_tune = localdata.getVar(default_tune_key, False) | ||
655 | if default_tune: | ||
656 | localdata.setVar("DEFAULTTUNE", default_tune) | ||
657 | bb.data.update_data(localdata) | ||
658 | package_archs[eext[1]] = localdata.getVar('PACKAGE_ARCHS', | ||
659 | True).split() | ||
660 | package_archs[eext[1]].reverse() | ||
661 | target_os[eext[1]] = localdata.getVar("TARGET_OS", | ||
662 | True).strip() | ||
663 | |||
664 | return RpmPM(d, | 608 | return RpmPM(d, |
665 | rootfs_dir, | 609 | rootfs_dir, |
666 | package_archs, | ||
667 | target_os, | ||
668 | d.getVar('TARGET_VENDOR', True) | 610 | d.getVar('TARGET_VENDOR', True) |
669 | ).list_installed(format) | 611 | ).list_installed(format) |
670 | elif img_type == "ipk": | 612 | elif img_type == "ipk": |