aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Jansa <martin.jansa@gmail.com>2014-01-18 15:02:06 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-01-19 17:11:48 +0000
commitc5076f33ac27c0c2b0743bf6dc4edc983254c467 (patch)
tree079b418dc0ce5911f744a5e34c7158d7f2f3fd0d
parent5a5319d2e6f41bb0e290d6a1decbd996e9572690 (diff)
downloadopenembedded-core-contrib-c5076f33ac27c0c2b0743bf6dc4edc983254c467.tar.gz
openembedded-core-contrib-c5076f33ac27c0c2b0743bf6dc4edc983254c467.tar.bz2
openembedded-core-contrib-c5076f33ac27c0c2b0743bf6dc4edc983254c467.zip
package.bbclass: move reading shlibs providers to separate function
* prepare for reading shlibs providers only from dependency tree of current recipe [YOCTO #4628] Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/package.bbclass43
1 files changed, 23 insertions, 20 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 768047caf3..7dcec5ebf4 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -1352,6 +1352,28 @@ python package_do_shlibs() {
# 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):
+ 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()
+ ver_file = os.path.join(dir, dep_pkg + '.ver')
+ lib_ver = None
+ if os.path.exists(ver_file):
+ fd = open(ver_file)
+ lib_ver = fd.readline().rstrip()
+ fd.close()
+ for l in lines:
+ shlib_provider[l.rstrip()] = (dep_pkg, lib_ver)
+
def linux_so(file):
needs_ldconfig = False
cmd = d.getVar('OBJDUMP', True) + " -p " + pipes.quote(file) + " 2>/dev/null"
@@ -1496,26 +1518,7 @@ python package_do_shlibs() {
postinst += d.getVar('ldconfig_postinst_fragment', True)
d.setVar('pkg_postinst_%s' % pkg, postinst)
- list_re = re.compile('^(.*)\.list$')
- # Go from least to most specific since the last one found wins
- for dir in reversed(shlibs_dirs):
- 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()
- ver_file = os.path.join(dir, dep_pkg + '.ver')
- lib_ver = None
- if os.path.exists(ver_file):
- fd = open(ver_file)
- lib_ver = fd.readline().rstrip()
- fd.close()
- for l in lines:
- shlib_provider[l.rstrip()] = (dep_pkg, lib_ver)
+ read_shlib_providers()
bb.utils.unlockfile(lf)