summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2018-01-16 13:37:53 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-01-18 12:50:36 +0000
commiteaf2636f6ce518f983e3007612c61c410fd74195 (patch)
tree129ad63ba9eebfc4c13baaefd1099e0a1d86e053 /meta/classes
parent9a5547d0884d825f73b38ac32c4ceadcd27bbde4 (diff)
downloadpoky-eaf2636f6ce518f983e3007612c61c410fd74195.tar.gz
classes/debian: fix library path handling
The existing code is looking for libraries in all paths which end in ${libdir}. This caused false-positives for recipes such as lz4 which had files called /usr/lib/lz4/ptest/usr/lib/liblz4.so, and resulted in lz4-ptest being incorrectly renamed to liblz4. Solve this by explicitly looking for ${libdir} etc under the packages-split directory. (From OE-Core rev: 7b1896f6f5367010b54c6a8b300db84037734533) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/debian.bbclass26
1 files changed, 16 insertions, 10 deletions
diff --git a/meta/classes/debian.bbclass b/meta/classes/debian.bbclass
index 5cdbf360dc..edc6da1ba3 100644
--- a/meta/classes/debian.bbclass
+++ b/meta/classes/debian.bbclass
@@ -25,12 +25,10 @@ python () {
25} 25}
26 26
27python debian_package_name_hook () { 27python debian_package_name_hook () {
28 import glob, copy, stat, errno, re 28 import glob, copy, stat, errno, re, pathlib
29 29
30 pkgdest = d.getVar('PKGDEST') 30 pkgdest = d.getVar("PKGDEST")
31 packages = d.getVar('PACKAGES') 31 packages = d.getVar('PACKAGES')
32 bin_re = re.compile(".*/s?" + os.path.basename(d.getVar("bindir")) + "$")
33 lib_re = re.compile(".*/" + os.path.basename(d.getVar("libdir")) + "$")
34 so_re = re.compile("lib.*\.so") 32 so_re = re.compile("lib.*\.so")
35 33
36 def socrunch(s): 34 def socrunch(s):
@@ -60,17 +58,25 @@ python debian_package_name_hook () {
60 d.appendVar('RPROVIDES_' + pkg, " " + pkg + " (=" + d.getVar("PKGV") + ")") 58 d.appendVar('RPROVIDES_' + pkg, " " + pkg + " (=" + d.getVar("PKGV") + ")")
61 59
62 def auto_libname(packages, orig_pkg): 60 def auto_libname(packages, orig_pkg):
61 p = lambda var: pathlib.PurePath(d.getVar(var))
62 libdirs = (p("base_libdir"), p("libdir"))
63 bindirs = (p("base_bindir"), p("base_sbindir"), p("bindir"), p("sbindir"))
64
63 sonames = [] 65 sonames = []
64 has_bins = 0 66 has_bins = 0
65 has_libs = 0 67 has_libs = 0
66 for file in pkgfiles[orig_pkg]: 68 for f in pkgfiles[orig_pkg]:
67 root = os.path.dirname(file) 69 # This is .../packages-split/orig_pkg/
68 if bin_re.match(root): 70 pkgpath = pathlib.PurePath(pkgdest, orig_pkg)
71 # Strip pkgpath off the full path to a file in the package, re-root
72 # so it is absolute, and then get the parent directory of the file.
73 path = pathlib.PurePath("/") / (pathlib.PurePath(f).relative_to(pkgpath).parent)
74 if path in bindirs:
69 has_bins = 1 75 has_bins = 1
70 if lib_re.match(root): 76 if path in libdirs:
71 has_libs = 1 77 has_libs = 1
72 if so_re.match(os.path.basename(file)): 78 if so_re.match(os.path.basename(f)):
73 cmd = (d.getVar('TARGET_PREFIX') or "") + "objdump -p " + file + " 2>/dev/null" 79 cmd = (d.getVar('TARGET_PREFIX') or "") + "objdump -p " + f + " 2>/dev/null"
74 fd = os.popen(cmd) 80 fd = os.popen(cmd)
75 lines = fd.readlines() 81 lines = fd.readlines()
76 fd.close() 82 fd.close()