diff options
Diffstat (limited to 'meta/classes/chrpath.bbclass')
-rw-r--r-- | meta/classes/chrpath.bbclass | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/meta/classes/chrpath.bbclass b/meta/classes/chrpath.bbclass index 2870c10d51..67b197ec22 100644 --- a/meta/classes/chrpath.bbclass +++ b/meta/classes/chrpath.bbclass | |||
@@ -2,7 +2,13 @@ CHRPATH_BIN ?= "chrpath" | |||
2 | PREPROCESS_RELOCATE_DIRS ?= "" | 2 | PREPROCESS_RELOCATE_DIRS ?= "" |
3 | 3 | ||
4 | def process_file_linux(cmd, fpath, rootdir, baseprefix, tmpdir, d, break_hardlinks = False): | 4 | def process_file_linux(cmd, fpath, rootdir, baseprefix, tmpdir, d, break_hardlinks = False): |
5 | import subprocess as sub | 5 | import subprocess as sub, oe.qa |
6 | |||
7 | with oe.qa.ELFFile(fpath) as elf: | ||
8 | try: | ||
9 | elf.open() | ||
10 | except oe.qa.NotELFFileError: | ||
11 | return | ||
6 | 12 | ||
7 | p = sub.Popen([cmd, '-l', fpath],stdout=sub.PIPE,stderr=sub.PIPE) | 13 | p = sub.Popen([cmd, '-l', fpath],stdout=sub.PIPE,stderr=sub.PIPE) |
8 | out, err = p.communicate() | 14 | out, err = p.communicate() |
@@ -72,6 +78,10 @@ def process_file_darwin(cmd, fpath, rootdir, baseprefix, tmpdir, d, break_hardli | |||
72 | out, err = p.communicate() | 78 | out, err = p.communicate() |
73 | 79 | ||
74 | def process_dir(rootdir, directory, d, break_hardlinks = False): | 80 | def process_dir(rootdir, directory, d, break_hardlinks = False): |
81 | bb.debug(2, "Checking %s for binaries to process" % directory) | ||
82 | if not os.path.exists(directory): | ||
83 | return | ||
84 | |||
75 | import stat | 85 | import stat |
76 | 86 | ||
77 | rootdir = os.path.normpath(rootdir) | 87 | rootdir = os.path.normpath(rootdir) |
@@ -80,10 +90,6 @@ def process_dir(rootdir, directory, d, break_hardlinks = False): | |||
80 | baseprefix = os.path.normpath(d.expand('${base_prefix}')) | 90 | baseprefix = os.path.normpath(d.expand('${base_prefix}')) |
81 | hostos = d.getVar("HOST_OS") | 91 | hostos = d.getVar("HOST_OS") |
82 | 92 | ||
83 | #bb.debug("Checking %s for binaries to process" % directory) | ||
84 | if not os.path.exists(directory): | ||
85 | return | ||
86 | |||
87 | if "linux" in hostos: | 93 | if "linux" in hostos: |
88 | process_file = process_file_linux | 94 | process_file = process_file_linux |
89 | elif "darwin" in hostos: | 95 | elif "darwin" in hostos: |