aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/package.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2014-12-19 11:41:44 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-12-21 12:37:56 +0000
commitde8730ce2dd4d8186f0388ad8205f2cd04726fdd (patch)
tree827458262279663a03fc6914ef1b1e735f5d65a5 /meta/lib/oe/package.py
parent3e6e4e0198eec87f5d7960b815cab6a268bb9015 (diff)
downloadopenembedded-core-contrib-de8730ce2dd4d8186f0388ad8205f2cd04726fdd.tar.gz
classes/package: move read_shlib_providers() to a common unit
This allows us to use this function elsewhere in the code. (From OE-Core rev: 657cff8a0f0e5db171b2ed9388a790ee0b135842) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/package.py')
-rw-r--r--meta/lib/oe/package.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/meta/lib/oe/package.py b/meta/lib/oe/package.py
index f8b532220a..ea6feaaea4 100644
--- a/meta/lib/oe/package.py
+++ b/meta/lib/oe/package.py
@@ -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