summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorLaurentiu Palcu <laurentiu.palcu@intel.com>2014-02-14 17:45:12 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-02-14 22:58:45 +0000
commit155f8a4c54bef65235c54945198f1fcddb642ea0 (patch)
treee1c57ba4a81b2ce8e557dd6d55fb5093c0f2c781 /meta/lib
parent4b967d90ea4e4b5862c550da44439b7e3b9e19a8 (diff)
downloadpoky-155f8a4c54bef65235c54945198f1fcddb642ea0.tar.gz
package_manager.py: move multilib prefix list computation function to RpmIndexer
Since the code from anonymous function in rootfs_rpm.bbclass has been removed, MULTILIB_PREFIX_LIST variable was never set. Hence not all directories got indexed. This commit will move the multilib prefix list computation function from RpmPM class to RpmIndexer, since the indexer needs it too. I was hoping to avoid this but, unfortunately, I couldn't. (From OE-Core rev: d3ba249aa1bf68aaeed226e934a4f4d5b7a19286) Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oe/package_manager.py105
1 files changed, 53 insertions, 52 deletions
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index af14d5ad7f..2faf4224b3 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -35,14 +35,64 @@ class Indexer(object):
35 35
36 36
37class RpmIndexer(Indexer): 37class RpmIndexer(Indexer):
38 def get_ml_prefix_and_os_list(self, arch_var=None, os_var=None):
39 package_archs = {
40 'default': [],
41 }
42
43 target_os = {
44 'default': "",
45 }
46
47 if arch_var is not None and os_var is not None:
48 package_archs['default'] = self.d.getVar(arch_var, True).split()
49 package_archs['default'].reverse()
50 target_os['default'] = self.d.getVar(os_var, True).strip()
51 else:
52 package_archs['default'] = self.d.getVar("PACKAGE_ARCHS", True).split()
53 # arch order is reversed. This ensures the -best- match is
54 # listed first!
55 package_archs['default'].reverse()
56 target_os['default'] = self.d.getVar("TARGET_OS", True).strip()
57 multilibs = self.d.getVar('MULTILIBS', True) or ""
58 for ext in multilibs.split():
59 eext = ext.split(':')
60 if len(eext) > 1 and eext[0] == 'multilib':
61 localdata = bb.data.createCopy(self.d)
62 default_tune_key = "DEFAULTTUNE_virtclass-multilib-" + eext[1]
63 default_tune = localdata.getVar(default_tune_key, False)
64 if default_tune:
65 localdata.setVar("DEFAULTTUNE", default_tune)
66 bb.data.update_data(localdata)
67 package_archs[eext[1]] = localdata.getVar('PACKAGE_ARCHS',
68 True).split()
69 package_archs[eext[1]].reverse()
70 target_os[eext[1]] = localdata.getVar("TARGET_OS",
71 True).strip()
72
73 ml_prefix_list = dict()
74 for mlib in package_archs:
75 if mlib == 'default':
76 ml_prefix_list[mlib] = package_archs[mlib]
77 else:
78 ml_prefix_list[mlib] = list()
79 for arch in package_archs[mlib]:
80 if arch in ['all', 'noarch', 'any']:
81 ml_prefix_list[mlib].append(arch)
82 else:
83 ml_prefix_list[mlib].append(mlib + "_" + arch)
84
85 return (ml_prefix_list, target_os)
86
38 def write_index(self): 87 def write_index(self):
39 sdk_pkg_archs = (self.d.getVar('SDK_PACKAGE_ARCHS', True) or "").replace('-', '_').split() 88 sdk_pkg_archs = (self.d.getVar('SDK_PACKAGE_ARCHS', True) or "").replace('-', '_').split()
40 mlb_prefix_list = (self.d.getVar('MULTILIB_PREFIX_LIST', True) or "").replace('-', '_').split()
41 all_mlb_pkg_archs = (self.d.getVar('ALL_MULTILIB_PACKAGE_ARCHS', True) or "").replace('-', '_').split() 89 all_mlb_pkg_archs = (self.d.getVar('ALL_MULTILIB_PACKAGE_ARCHS', True) or "").replace('-', '_').split()
42 90
91 mlb_prefix_list = self.get_ml_prefix_and_os_list()[0]
92
43 archs = set() 93 archs = set()
44 for item in mlb_prefix_list: 94 for item in mlb_prefix_list:
45 archs = archs.union(set(item.split(':')[1:])) 95 archs = archs.union(set(i.replace('-', '_') for i in mlb_prefix_list[item]))
46 96
47 if len(archs) == 0: 97 if len(archs) == 0:
48 archs = archs.union(set(all_mlb_pkg_archs)) 98 archs = archs.union(set(all_mlb_pkg_archs))
@@ -303,56 +353,7 @@ class RpmPM(PackageManager):
303 353
304 self.indexer = RpmIndexer(self.d, self.deploy_dir) 354 self.indexer = RpmIndexer(self.d, self.deploy_dir)
305 355
306 self.ml_prefix_list, self.ml_os_list = self._get_prefix_and_os_list(arch_var, os_var) 356 self.ml_prefix_list, self.ml_os_list = self.indexer.get_ml_prefix_and_os_list(arch_var, os_var)
307
308 def _get_prefix_and_os_list(self, arch_var, os_var):
309 package_archs = {
310 'default': [],
311 }
312
313 target_os = {
314 'default': "",
315 }
316
317 if arch_var is not None and os_var is not None:
318 package_archs['default'] = self.d.getVar(arch_var, True).split()
319 package_archs['default'].reverse()
320 target_os['default'] = self.d.getVar(os_var, True).strip()
321 else:
322 package_archs['default'] = self.d.getVar("PACKAGE_ARCHS", True).split()
323 # arch order is reversed. This ensures the -best- match is
324 # listed first!
325 package_archs['default'].reverse()
326 target_os['default'] = self.d.getVar("TARGET_OS", True).strip()
327 multilibs = self.d.getVar('MULTILIBS', True) or ""
328 for ext in multilibs.split():
329 eext = ext.split(':')
330 if len(eext) > 1 and eext[0] == 'multilib':
331 localdata = bb.data.createCopy(self.d)
332 default_tune_key = "DEFAULTTUNE_virtclass-multilib-" + eext[1]
333 default_tune = localdata.getVar(default_tune_key, False)
334 if default_tune:
335 localdata.setVar("DEFAULTTUNE", default_tune)
336 bb.data.update_data(localdata)
337 package_archs[eext[1]] = localdata.getVar('PACKAGE_ARCHS',
338 True).split()
339 package_archs[eext[1]].reverse()
340 target_os[eext[1]] = localdata.getVar("TARGET_OS",
341 True).strip()
342
343 ml_prefix_list = dict()
344 for mlib in package_archs:
345 if mlib == 'default':
346 ml_prefix_list[mlib] = package_archs[mlib]
347 else:
348 ml_prefix_list[mlib] = list()
349 for arch in package_archs[mlib]:
350 if arch in ['all', 'noarch', 'any']:
351 ml_prefix_list[mlib].append(arch)
352 else:
353 ml_prefix_list[mlib].append(mlib + "_" + arch)
354
355 return (ml_prefix_list, target_os)
356 357
357 ''' 358 '''
358 Create configs for rpm and smart, and multilib is supported 359 Create configs for rpm and smart, and multilib is supported