diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2019-07-02 16:23:59 +1200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-07-03 17:00:57 +0100 |
commit | 1dffd9c2ec5d7b69b95b46230d12cead88a47977 (patch) | |
tree | 750eae4780b9f61b5afe55eb2c9a56cd52c3e704 /scripts | |
parent | 9a08720b3a1dbac51a5e5ecad0ab271828230358 (diff) | |
download | poky-1dffd9c2ec5d7b69b95b46230d12cead88a47977.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].
(From OE-Core rev: 548a5c8f42c6ac1b0f7962926d05276e71505678)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/lib/recipetool/create_buildsys_python.py | 9 |
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): | |||
154 | if 'buildsystem' in handled: | 154 | if 'buildsystem' in handled: |
155 | return False | 155 | return False |
156 | 156 | ||
157 | if not RecipeHandler.checkfiles(srctree, ['setup.py']): | 157 | # Check for non-zero size setup.py files |
158 | return | 158 | setupfiles = RecipeHandler.checkfiles(srctree, ['setup.py']) |
159 | for fn in setupfiles: | ||
160 | if os.path.getsize(fn): | ||
161 | break | ||
162 | else: | ||
163 | return False | ||
159 | 164 | ||
160 | # setup.py is always parsed to get at certain required information, such as | 165 | # setup.py is always parsed to get at certain required information, such as |
161 | # distutils vs setuptools | 166 | # distutils vs setuptools |