summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2019-07-01 10:30:02 +1200
committerPaul Eggleton <paul.eggleton@linux.intel.com>2019-07-02 16:23:17 +1200
commitd08a9825c7632ce886ec1749bdbb73beb54eab3f (patch)
tree131f7db6a8bc5320cb6d8bc85878d972904a82f1
parent1f8a73261c7a134821c40845da27d8edbb0763b6 (diff)
downloadopenembedded-core-contrib-d08a9825c7632ce886ec1749bdbb73beb54eab3f.tar.gz
recipetool: ignore zero-length setup.py files
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>
-rw-r--r--scripts/lib/recipetool/create_buildsys_python.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/lib/recipetool/create_buildsys_python.py b/scripts/lib/recipetool/create_buildsys_python.py
index ac9bc9237c..adfa377956 100644
--- a/scripts/lib/recipetool/create_buildsys_python.py
+++ b/scripts/lib/recipetool/create_buildsys_python.py
@@ -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