summaryrefslogtreecommitdiff
path: root/meta/lib/oe
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:18 +0000
commit657cff8a0f0e5db171b2ed9388a790ee0b135842 (patch)
tree9cf2ce43757a1deaaf1cd30b2ab22afe326670ff /meta/lib/oe
parente9a211321b4570282d0d65a0bb519e05a3d477bb (diff)
downloadopenembedded-core-657cff8a0f0e5db171b2ed9388a790ee0b135842.tar.gz
openembedded-core-657cff8a0f0e5db171b2ed9388a790ee0b135842.tar.bz2
openembedded-core-657cff8a0f0e5db171b2ed9388a790ee0b135842.zip
classes/package: move read_shlib_providers() to a common unit
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>
Diffstat (limited to 'meta/lib/oe')
-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