All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] package_manager.py: move multilib prefix list computation function to RpmIndexer
@ 2014-02-14 20:14 Laurentiu Palcu
  2014-02-14 20:14 ` [PATCH 1/1] " Laurentiu Palcu
  0 siblings, 1 reply; 2+ messages in thread
From: Laurentiu Palcu @ 2014-02-14 20:14 UTC (permalink / raw)
  To: openembedded-core

I tested this with the following:

rm -rf tmp/ && bb core-image-sato && bb -c populate_sdk core-image-sato &&
bb lib32-core-image-minimal && rm -rf tmp/ && bb lib32-core-image-minimal

laurentiu

The following changes since commit b38c7cb7a6ab787d7be2b2c295ba58a98a954cd5:

  socat: upgrade to 1.7.2.3 (2014-02-14 12:31:10 +0000)

are available in the git repository at:

  git://mirror.rb.intel.com/git.yoctoproject.org/poky-contrib lpalcu/rpm_ml_build_fix

for you to fetch changes up to 4e62efc1659a4be94b6437049a771ec444515600:

  package_manager.py: move multilib prefix list computation function to RpmIndexer (2014-02-14 20:59:17 +0200)

----------------------------------------------------------------
Laurentiu Palcu (1):
      package_manager.py: move multilib prefix list computation function to RpmIndexer

 meta/lib/oe/package_manager.py |  105 ++++++++++++++++++++--------------------
 1 file changed, 53 insertions(+), 52 deletions(-)

Laurentiu Palcu (1):
  package_manager.py: move multilib prefix list computation function to
    RpmIndexer

 meta/lib/oe/package_manager.py |  105 ++++++++++++++++++++--------------------
 1 file changed, 53 insertions(+), 52 deletions(-)

-- 
1.7.9.5



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 1/1] package_manager.py: move multilib prefix list computation function to RpmIndexer
  2014-02-14 20:14 [PATCH 0/1] package_manager.py: move multilib prefix list computation function to RpmIndexer Laurentiu Palcu
@ 2014-02-14 20:14 ` Laurentiu Palcu
  0 siblings, 0 replies; 2+ messages in thread
From: Laurentiu Palcu @ 2014-02-14 20:14 UTC (permalink / raw)
  To: openembedded-core

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.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
---
 meta/lib/oe/package_manager.py |  105 ++++++++++++++++++++--------------------
 1 file changed, 53 insertions(+), 52 deletions(-)

diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index af14d5a..2faf422 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -35,14 +35,64 @@ class Indexer(object):
 
 
 class RpmIndexer(Indexer):
+    def get_ml_prefix_and_os_list(self, arch_var=None, os_var=None):
+        package_archs = {
+            'default': [],
+        }
+
+        target_os = {
+            'default': "",
+        }
+
+        if arch_var is not None and os_var is not None:
+            package_archs['default'] = self.d.getVar(arch_var, True).split()
+            package_archs['default'].reverse()
+            target_os['default'] = self.d.getVar(os_var, True).strip()
+        else:
+            package_archs['default'] = self.d.getVar("PACKAGE_ARCHS", True).split()
+            # arch order is reversed.  This ensures the -best- match is
+            # listed first!
+            package_archs['default'].reverse()
+            target_os['default'] = self.d.getVar("TARGET_OS", True).strip()
+            multilibs = self.d.getVar('MULTILIBS', True) or ""
+            for ext in multilibs.split():
+                eext = ext.split(':')
+                if len(eext) > 1 and eext[0] == 'multilib':
+                    localdata = bb.data.createCopy(self.d)
+                    default_tune_key = "DEFAULTTUNE_virtclass-multilib-" + eext[1]
+                    default_tune = localdata.getVar(default_tune_key, False)
+                    if default_tune:
+                        localdata.setVar("DEFAULTTUNE", default_tune)
+                        bb.data.update_data(localdata)
+                        package_archs[eext[1]] = localdata.getVar('PACKAGE_ARCHS',
+                                                                  True).split()
+                        package_archs[eext[1]].reverse()
+                        target_os[eext[1]] = localdata.getVar("TARGET_OS",
+                                                              True).strip()
+
+        ml_prefix_list = dict()
+        for mlib in package_archs:
+            if mlib == 'default':
+                ml_prefix_list[mlib] = package_archs[mlib]
+            else:
+                ml_prefix_list[mlib] = list()
+                for arch in package_archs[mlib]:
+                    if arch in ['all', 'noarch', 'any']:
+                        ml_prefix_list[mlib].append(arch)
+                    else:
+                        ml_prefix_list[mlib].append(mlib + "_" + arch)
+
+        return (ml_prefix_list, target_os)
+
     def write_index(self):
         sdk_pkg_archs = (self.d.getVar('SDK_PACKAGE_ARCHS', True) or "").replace('-', '_').split()
-        mlb_prefix_list = (self.d.getVar('MULTILIB_PREFIX_LIST', True) or "").replace('-', '_').split()
         all_mlb_pkg_archs = (self.d.getVar('ALL_MULTILIB_PACKAGE_ARCHS', True) or "").replace('-', '_').split()
 
+        mlb_prefix_list = self.get_ml_prefix_and_os_list()[0]
+
         archs = set()
         for item in mlb_prefix_list:
-            archs = archs.union(set(item.split(':')[1:]))
+            archs = archs.union(set(i.replace('-', '_') for i in mlb_prefix_list[item]))
 
         if len(archs) == 0:
             archs = archs.union(set(all_mlb_pkg_archs))
@@ -303,56 +353,7 @@ class RpmPM(PackageManager):
 
         self.indexer = RpmIndexer(self.d, self.deploy_dir)
 
-        self.ml_prefix_list, self.ml_os_list = self._get_prefix_and_os_list(arch_var, os_var)
-
-    def _get_prefix_and_os_list(self, arch_var, os_var):
-        package_archs = {
-            'default': [],
-        }
-
-        target_os = {
-            'default': "",
-        }
-
-        if arch_var is not None and os_var is not None:
-            package_archs['default'] = self.d.getVar(arch_var, True).split()
-            package_archs['default'].reverse()
-            target_os['default'] = self.d.getVar(os_var, True).strip()
-        else:
-            package_archs['default'] = self.d.getVar("PACKAGE_ARCHS", True).split()
-            # arch order is reversed.  This ensures the -best- match is
-            # listed first!
-            package_archs['default'].reverse()
-            target_os['default'] = self.d.getVar("TARGET_OS", True).strip()
-            multilibs = self.d.getVar('MULTILIBS', True) or ""
-            for ext in multilibs.split():
-                eext = ext.split(':')
-                if len(eext) > 1 and eext[0] == 'multilib':
-                    localdata = bb.data.createCopy(self.d)
-                    default_tune_key = "DEFAULTTUNE_virtclass-multilib-" + eext[1]
-                    default_tune = localdata.getVar(default_tune_key, False)
-                    if default_tune:
-                        localdata.setVar("DEFAULTTUNE", default_tune)
-                        bb.data.update_data(localdata)
-                        package_archs[eext[1]] = localdata.getVar('PACKAGE_ARCHS',
-                                                                  True).split()
-                        package_archs[eext[1]].reverse()
-                        target_os[eext[1]] = localdata.getVar("TARGET_OS",
-                                                              True).strip()
-
-        ml_prefix_list = dict()
-        for mlib in package_archs:
-            if mlib == 'default':
-                ml_prefix_list[mlib] = package_archs[mlib]
-            else:
-                ml_prefix_list[mlib] = list()
-                for arch in package_archs[mlib]:
-                    if arch in ['all', 'noarch', 'any']:
-                        ml_prefix_list[mlib].append(arch)
-                    else:
-                        ml_prefix_list[mlib].append(mlib + "_" + arch)
-
-        return (ml_prefix_list, target_os)
+        self.ml_prefix_list, self.ml_os_list = self.indexer.get_ml_prefix_and_os_list(arch_var, os_var)
 
     '''
     Create configs for rpm and smart, and multilib is supported
-- 
1.7.9.5



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-02-14 20:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-14 20:14 [PATCH 0/1] package_manager.py: move multilib prefix list computation function to RpmIndexer Laurentiu Palcu
2014-02-14 20:14 ` [PATCH 1/1] " Laurentiu Palcu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.