diff options
-rw-r--r-- | meta/classes/debian.bbclass | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/meta/classes/debian.bbclass b/meta/classes/debian.bbclass index edc6da1ba3..989ea8f8d2 100644 --- a/meta/classes/debian.bbclass +++ b/meta/classes/debian.bbclass | |||
@@ -25,7 +25,7 @@ python () { | |||
25 | } | 25 | } |
26 | 26 | ||
27 | python debian_package_name_hook () { | 27 | python debian_package_name_hook () { |
28 | import glob, copy, stat, errno, re, pathlib | 28 | import glob, copy, stat, errno, re, pathlib, subprocess |
29 | 29 | ||
30 | pkgdest = d.getVar("PKGDEST") | 30 | pkgdest = d.getVar("PKGDEST") |
31 | packages = d.getVar('PACKAGES') | 31 | packages = d.getVar('PACKAGES') |
@@ -76,15 +76,14 @@ python debian_package_name_hook () { | |||
76 | if path in libdirs: | 76 | if path in libdirs: |
77 | has_libs = 1 | 77 | has_libs = 1 |
78 | if so_re.match(os.path.basename(f)): | 78 | if so_re.match(os.path.basename(f)): |
79 | cmd = (d.getVar('TARGET_PREFIX') or "") + "objdump -p " + f + " 2>/dev/null" | 79 | try: |
80 | fd = os.popen(cmd) | 80 | cmd = [d.expand("${TARGET_PREFIX}objdump"), "-p", f] |
81 | lines = fd.readlines() | 81 | output = subprocess.check_output(cmd).decode("utf-8") |
82 | fd.close() | 82 | for m in re.finditer("\s+SONAME\s+([^\s]+)", output): |
83 | for l in lines: | 83 | if m.group(1) not in sonames: |
84 | m = re.match("\s+SONAME\s+([^\s]*)", l) | 84 | sonames.append(m.group(1)) |
85 | if m and not m.group(1) in sonames: | 85 | except subprocess.CalledProcessError: |
86 | sonames.append(m.group(1)) | 86 | pass |
87 | |||
88 | bb.debug(1, 'LIBNAMES: pkg %s libs %d bins %d sonames %s' % (orig_pkg, has_libs, has_bins, sonames)) | 87 | bb.debug(1, 'LIBNAMES: pkg %s libs %d bins %d sonames %s' % (orig_pkg, has_libs, has_bins, sonames)) |
89 | soname = None | 88 | soname = None |
90 | if len(sonames) == 1: | 89 | if len(sonames) == 1: |