]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
insane: Fix case where S doesn't exist
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 9 May 2024 16:02:39 +0000 (17:02 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 13 May 2024 14:42:28 +0000 (15:42 +0100)
If S doesn't exist, do_qa_patch would fail. Fix the code to not fail
in this situation.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-global/insane.bbclass

index c32dfffd836d7b12ba6fbc1b32c12c83c2a1c3cd..03ac06b102f6e773fb02e6b5324ec3ae5636286e 100644 (file)
@@ -1399,7 +1399,7 @@ python do_qa_patch() {
         oe.qa.handle_error("unimplemented-ptest", "%s: autotools-based tests detected" % d.getVar('PN'), d)
 
     # Last resort, detect a test directory in sources
-    elif any(filename.lower() in ["test", "tests"] for filename in os.listdir(srcdir)):
+    elif os.path.exists(srcdir) and any(filename.lower() in ["test", "tests"] for filename in os.listdir(srcdir)):
         oe.qa.handle_error("unimplemented-ptest", "%s: test subdirectory detected" % d.getVar('PN'), d)
 
     oe.qa.exit_if_errors(d)