[oe-commits] org.oe.dev classes/insane.bbclass: Do not follow links, fix the issue that made koen add bb.fatal

freyther commit openembedded-commits at lists.openembedded.org
Wed Feb 21 22:51:26 UTC 2007


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.

Author: freyther at openembedded.org
Branch: org.openembedded.dev
Revision: 1bfe0aeb65281cc327c98493c62d9bc1edce7ab9
ViewMTN: http://monotone.openembedded.org/revision.psp?id=1bfe0aeb65281cc327c98493c62d9bc1edce7ab9
Files:
1
classes/insane.bbclass
Diffs:

#
# mt diff -r7e917aac444c4576c1afb538cec1e8700b152f8a -r1bfe0aeb65281cc327c98493c62d9bc1edce7ab9
#
# 
# 
# patch "classes/insane.bbclass"
#  from [c350f1502b059948bb22ca97e78c311c3060593e]
#    to [c9f4140ad707f52be20189d825a8cc36358f6645]
# 
============================================================
--- classes/insane.bbclass	c350f1502b059948bb22ca97e78c311c3060593e
+++ classes/insane.bbclass	c9f4140ad707f52be20189d825a8cc36358f6645
@@ -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):
     """






More information about the Openembedded-commits mailing list