]> code.ossystems Code Review - openembedded-core.git/commitdiff
classes/package: move read_shlib_providers() to a common unit
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Fri, 19 Dec 2014 11:41:44 +0000 (11:41 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 21 Dec 2014 12:37:18 +0000 (12:37 +0000)
This allows us to use this function elsewhere in the code.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/package.bbclass
meta/lib/oe/package.py

index dc4025d327933483caaba381346515225e39392a..fc501fcdea0f4f09b018a3bf460417071027670d 100644 (file)
@@ -1391,32 +1391,11 @@ python package_do_shlibs() {
 
     pkgdest = d.getVar('PKGDEST', True)
 
-    shlibs_dirs = d.getVar('SHLIBSDIRS', True).split()
     shlibswork_dir = d.getVar('SHLIBSWORKDIR', True)
 
     # Take shared lock since we're only reading, not writing
     lf = bb.utils.lockfile(d.expand("${PACKAGELOCK}"))
 
-    def read_shlib_providers():
-        list_re = re.compile('^(.*)\.list$')
-        # Go from least to most specific since the last one found wins
-        for dir in reversed(shlibs_dirs):
-            bb.debug(2, "Reading shlib providers in %s" % (dir))
-            if not os.path.exists(dir):
-                continue
-            for file in os.listdir(dir):
-                m = list_re.match(file)
-                if m:
-                    dep_pkg = m.group(1)
-                    fd = open(os.path.join(dir, file))
-                    lines = fd.readlines()
-                    fd.close()
-                    for l in lines:
-                        s = l.strip().split(":")
-                        if s[0] not in shlib_provider:
-                            shlib_provider[s[0]] = {}
-                        shlib_provider[s[0]][s[1]] = (dep_pkg, s[2])
-
     def linux_so(file, needed, sonames, renames, pkgver):
         needs_ldconfig = False
         ldir = os.path.dirname(file).replace(pkgdest + "/" + pkg, '')
@@ -1513,8 +1492,7 @@ python package_do_shlibs() {
         use_ldconfig = False
 
     needed = {}
-    shlib_provider = {}
-    read_shlib_providers()
+    shlib_provider = oe.package.read_shlib_providers(d)
 
     for pkg in packages.split():
         private_libs = d.getVar('PRIVATE_LIBS_' + pkg, True) or d.getVar('PRIVATE_LIBS', True) or ""
index f8b532220a1c0c8e2a5da604f0a153cfd0a76d1e..ea6feaaea4fab390185aec13d5f364dbda34c3a6 100644 (file)
@@ -97,3 +97,29 @@ def filedeprunner(arg):
         raise e
 
     return (pkg, provides, requires)
+
+
+def read_shlib_providers(d):
+    import re
+
+    shlib_provider = {}
+    shlibs_dirs = d.getVar('SHLIBSDIRS', True).split()
+    list_re = re.compile('^(.*)\.list$')
+    # Go from least to most specific since the last one found wins
+    for dir in reversed(shlibs_dirs):
+        bb.debug(2, "Reading shlib providers in %s" % (dir))
+        if not os.path.exists(dir):
+            continue
+        for file in os.listdir(dir):
+            m = list_re.match(file)
+            if m:
+                dep_pkg = m.group(1)
+                fd = open(os.path.join(dir, file))
+                lines = fd.readlines()
+                fd.close()
+                for l in lines:
+                    s = l.strip().split(":")
+                    if s[0] not in shlib_provider:
+                        shlib_provider[s[0]] = {}
+                    shlib_provider[s[0]][s[1]] = (dep_pkg, s[2])
+    return shlib_provider