summaryrefslogtreecommitdiffstats
path: root/meta/lib
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
parent3e6e4e0198eec87f5d7960b815cab6a268bb9015 (diff)
downloadpoky-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')
-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):
97 raise e 97 raise e
98 98
99 return (pkg, provides, requires) 99 return (pkg, provides, requires)
100
101
102def read_shlib_providers(d):
103 import re
104
105 shlib_provider = {}
106 shlibs_dirs = d.getVar('SHLIBSDIRS', True).split()
107 list_re = re.compile('^(.*)\.list$')
108 # Go from least to most specific since the last one found wins
109 for dir in reversed(shlibs_dirs):
110 bb.debug(2, "Reading shlib providers in %s" % (dir))
111 if not os.path.exists(dir):
112 continue
113 for file in os.listdir(dir):
114 m = list_re.match(file)
115 if m:
116 dep_pkg = m.group(1)
117 fd = open(os.path.join(dir, file))
118 lines = fd.readlines()
119 fd.close()
120 for l in lines:
121 s = l.strip().split(":")
122 if s[0] not in shlib_provider:
123 shlib_provider[s[0]] = {}
124 shlib_provider[s[0]][s[1]] = (dep_pkg, s[2])
125 return shlib_provider