]> code.ossystems Code Review - openembedded-core.git/commitdiff
recipetool: ignore zero-length setup.py files
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Tue, 2 Jul 2019 04:23:59 +0000 (16:23 +1200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 3 Jul 2019 08:09:50 +0000 (09:09 +0100)
If a setup.py file exists it ought to have something in it before we
consider the source tree to be a Python module and treating it as such.
(A counter-example is https://www.bro.org/downloads/binpac-0.50.tar.gz -
it's not clear why this has a zero-length setup.py in it but we should
pay no attention to it.)

Fixes [YOCTO #12923].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/recipetool/create_buildsys_python.py

index ac9bc9237ce056f2a5f887d2f6f2d613ebe0be0d..adfa3779561a59742c72fb6c7c014536f9d84941 100644 (file)
@@ -154,8 +154,13 @@ class PythonRecipeHandler(RecipeHandler):
         if 'buildsystem' in handled:
             return False
 
-        if not RecipeHandler.checkfiles(srctree, ['setup.py']):
-            return
+        # Check for non-zero size setup.py files
+        setupfiles = RecipeHandler.checkfiles(srctree, ['setup.py'])
+        for fn in setupfiles:
+            if os.path.getsize(fn):
+                break
+        else:
+            return False
 
         # setup.py is always parsed to get at certain required information, such as
         # distutils vs setuptools