diff options
author | Martin Jansa <martin.jansa@gmail.com> | 2014-01-18 15:02:06 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-01-21 10:20:12 +0000 |
commit | bd938fe51052e8d25156b60b3762d01b3f2e176c (patch) | |
tree | 19d5ec626b89f8f1703bb3f14edcfe26780dfbbe /meta | |
parent | ea94e0fdee2b3494e8ed6526afe940bea9f57be3 (diff) | |
download | poky-bd938fe51052e8d25156b60b3762d01b3f2e176c.tar.gz |
package.bbclass: move reading shlibs providers to separate function
* prepare for reading shlibs providers only from dependency tree of
current recipe
[YOCTO #4628]
(From OE-Core rev: c5076f33ac27c0c2b0743bf6dc4edc983254c467)
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/package.bbclass | 43 |
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() { | |||
1352 | # Take shared lock since we're only reading, not writing | 1352 | # Take shared lock since we're only reading, not writing |
1353 | lf = bb.utils.lockfile(d.expand("${PACKAGELOCK}")) | 1353 | lf = bb.utils.lockfile(d.expand("${PACKAGELOCK}")) |
1354 | 1354 | ||
1355 | def read_shlib_providers(): | ||
1356 | list_re = re.compile('^(.*)\.list$') | ||
1357 | # Go from least to most specific since the last one found wins | ||
1358 | for dir in reversed(shlibs_dirs): | ||
1359 | if not os.path.exists(dir): | ||
1360 | continue | ||
1361 | for file in os.listdir(dir): | ||
1362 | m = list_re.match(file) | ||
1363 | if m: | ||
1364 | dep_pkg = m.group(1) | ||
1365 | fd = open(os.path.join(dir, file)) | ||
1366 | lines = fd.readlines() | ||
1367 | fd.close() | ||
1368 | ver_file = os.path.join(dir, dep_pkg + '.ver') | ||
1369 | lib_ver = None | ||
1370 | if os.path.exists(ver_file): | ||
1371 | fd = open(ver_file) | ||
1372 | lib_ver = fd.readline().rstrip() | ||
1373 | fd.close() | ||
1374 | for l in lines: | ||
1375 | shlib_provider[l.rstrip()] = (dep_pkg, lib_ver) | ||
1376 | |||
1355 | def linux_so(file): | 1377 | def linux_so(file): |
1356 | needs_ldconfig = False | 1378 | needs_ldconfig = False |
1357 | cmd = d.getVar('OBJDUMP', True) + " -p " + pipes.quote(file) + " 2>/dev/null" | 1379 | cmd = d.getVar('OBJDUMP', True) + " -p " + pipes.quote(file) + " 2>/dev/null" |
@@ -1496,26 +1518,7 @@ python package_do_shlibs() { | |||
1496 | postinst += d.getVar('ldconfig_postinst_fragment', True) | 1518 | postinst += d.getVar('ldconfig_postinst_fragment', True) |
1497 | d.setVar('pkg_postinst_%s' % pkg, postinst) | 1519 | d.setVar('pkg_postinst_%s' % pkg, postinst) |
1498 | 1520 | ||
1499 | list_re = re.compile('^(.*)\.list$') | 1521 | read_shlib_providers() |
1500 | # Go from least to most specific since the last one found wins | ||
1501 | for dir in reversed(shlibs_dirs): | ||
1502 | if not os.path.exists(dir): | ||
1503 | continue | ||
1504 | for file in os.listdir(dir): | ||
1505 | m = list_re.match(file) | ||
1506 | if m: | ||
1507 | dep_pkg = m.group(1) | ||
1508 | fd = open(os.path.join(dir, file)) | ||
1509 | lines = fd.readlines() | ||
1510 | fd.close() | ||
1511 | ver_file = os.path.join(dir, dep_pkg + '.ver') | ||
1512 | lib_ver = None | ||
1513 | if os.path.exists(ver_file): | ||
1514 | fd = open(ver_file) | ||
1515 | lib_ver = fd.readline().rstrip() | ||
1516 | fd.close() | ||
1517 | for l in lines: | ||
1518 | shlib_provider[l.rstrip()] = (dep_pkg, lib_ver) | ||
1519 | 1522 | ||
1520 | bb.utils.unlockfile(lf) | 1523 | bb.utils.unlockfile(lf) |
1521 | 1524 | ||