diff options
author | Holger Freyther <zecke@selfish.org> | 2007-02-21 22:48:55 +0000 |
---|---|---|
committer | Holger Freyther <zecke@selfish.org> | 2007-02-21 22:48:55 +0000 |
commit | c9ac9672ebe052a347c40c46152287a6d66b6d0b (patch) | |
tree | 425012b3fb827010ff4fbd2bc98438d4af5a2247 /classes/insane.bbclass | |
parent | e46add2af9557af0174688046b1fb73865d0c2e5 (diff) |
classes/insane.bbclass: Do not follow links, fix the issue that made koen add bb.fatal
udev has a link to host binaries, do not check the architecture
of these binaries. We will skip all links for now for the two
reasons:
-We either point to a file in our package and then we will
check it anyway
-It is a file for a another package, which will be checked
anyway
Make architecture mismatch a fatal/insane error and return False.
This should fix the issue koen has seen when he added a bb.fatal
the make_fatal_error method returns true if the error should be
made fatal, in this case our checks need to set sane to False.
The return not makes sure this is happening.
Diffstat (limited to 'classes/insane.bbclass')
-rw-r--r-- | classes/insane.bbclass | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/classes/insane.bbclass b/classes/insane.bbclass index c950c1e118..ed6d4d0642 100644 --- a/classes/insane.bbclass +++ b/classes/insane.bbclass @@ -250,10 +250,15 @@ def package_qa_check_arch(path,name,d): """ Check if archs are compatible """ - import bb + import bb, os target_os = bb.data.getVar('TARGET_OS', d, True) target_arch = bb.data.getVar('TARGET_ARCH', d, True) + # avoid following links to /usr/bin (e.g. on udev builds) + # we will check the files pointed to anyway... + if os.path.islink(path): + return True + #if this will throw an exception, then fix the dict above (machine, osabi, abiversion, littleendian, bits32) = package_qa_get_machine_dict()[target_os][target_arch] elf = package_qa_get_elf(path, bits32) @@ -263,15 +268,14 @@ def package_qa_check_arch(path,name,d): # just for debbugging to check the parser, remove once convinced... return True - sane = True if not machine == elf.machine(): bb.error("Architecture did not match (%d to %d) on %s" %(machine, elf.machine(), package_qa_clean_path(path,d))) - sane = package_qa_make_fatal_error( 4, name, path, d ) + return not package_qa_make_fatal_error( 4, name, path, d ) elif not littleendian == elf.isLittleEndian(): bb.error("Endiannes did not match (%d to %d) on %s" % (littleendian, elf.isLittleEndian(), package_qa_clean_path(path,d))) - sane = package_qa_make_fatal_error( 4, name, path, d ) + return not package_qa_make_fatal_error( 4, name, path, d ) - return sane + return True def package_qa_check_pcla(path,name,d): """ |